Skip to content

Commit 57eeaf4

Browse files
mcaylandvivier
authored andcommitted
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 <[email protected]> Reviewed-by: Laurent Vivier <[email protected]> Message-Id: <[email protected]> Signed-off-by: Laurent Vivier <[email protected]>
1 parent df8abbb commit 57eeaf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hw/display/macfb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ static void macfb_draw_line1(MacfbState *s, uint8_t *d, uint32_t addr,
128128
for (x = 0; x < width; x++) {
129129
int bit = x & 7;
130130
int idx = (macfb_read_byte(s, addr) >> (7 - bit)) & 1;
131-
r = g = b = ((1 - idx) << 7);
131+
r = s->color_palette[idx * 3];
132+
g = s->color_palette[idx * 3 + 1];
133+
b = s->color_palette[idx * 3 + 2];
132134
addr += (bit == 7);
133135

134136
*(uint32_t *)d = rgb_to_pixel32(r, g, b);

0 commit comments

Comments
 (0)