diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2021-10-07 23:12:50 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2021-10-08 13:31:03 +0200 |
commit | 57eeaf44ce6964e6e86275318f5fc35610c1dc68 (patch) | |
tree | 4a4d501d4bdc135d05113805c84b4e3444bfc7ed /hw/display | |
parent | df8abbbadf743bef6be5543b26f51231285b8923 (diff) |
macfb: fix up 1-bit pixel encoding
The MacOS driver expects the RGB values for the pixel to be in entries 0 and 1
of the colour palette.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20211007221253.29024-11-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/display')
-rw-r--r-- | hw/display/macfb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 2759fb5e34..e49c8b6f4b 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -128,7 +128,9 @@ static void macfb_draw_line1(MacfbState *s, uint8_t *d, uint32_t addr, for (x = 0; x < width; x++) { int bit = x & 7; int idx = (macfb_read_byte(s, addr) >> (7 - bit)) & 1; - r = g = b = ((1 - idx) << 7); + r = s->color_palette[idx * 3]; + g = s->color_palette[idx * 3 + 1]; + b = s->color_palette[idx * 3 + 2]; addr += (bit == 7); *(uint32_t *)d = rgb_to_pixel32(r, g, b); |