Skip to content

Commit 432d59c

Browse files
mcaylandvivier
authored andcommitted
macfb: fix 24-bit RGB pixel encoding
According to Apple Technical Note HW26: "Macintosh Quadra Built-In Video" the in-built framebuffer encodes each 24-bit pixel into 4 bytes. Adjust the 24-bit RGB pixel encoding accordingly which agrees with the encoding expected by MacOS when changing into 24-bit colour mode. 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 57eeaf4 commit 432d59c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hw/display/macfb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ static void macfb_draw_line24(MacfbState *s, uint8_t *d, uint32_t addr,
224224
int x;
225225

226226
for (x = 0; x < width; x++) {
227-
r = macfb_read_byte(s, addr);
228-
g = macfb_read_byte(s, addr + 1);
229-
b = macfb_read_byte(s, addr + 2);
230-
addr += 3;
227+
r = macfb_read_byte(s, addr + 1);
228+
g = macfb_read_byte(s, addr + 2);
229+
b = macfb_read_byte(s, addr + 3);
230+
addr += 4;
231231

232232
*(uint32_t *)d = rgb_to_pixel32(r, g, b);
233233
d += 4;

0 commit comments

Comments
 (0)