Message ID | 20211008114518.757615-11-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
Series | [PULL,01/13] macfb: handle errors that occur during realize | expand |
diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 2759fb5e34d1..e49c8b6f4b52 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);