[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/12] macfb: fix up 1-bit pixel encoding
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v2 09/12] macfb: fix up 1-bit pixel encoding |
Date: |
Mon, 4 Oct 2021 22:19:25 +0100 |
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>
---
hw/display/macfb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index 357fe18be5..ae0cf02dff 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);
--
2.20.1
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, (continued)
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Mark Cave-Ayland, 2021/10/05
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Laurent Vivier, 2021/10/05
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Mark Cave-Ayland, 2021/10/05
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Laurent Vivier, 2021/10/06
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Mark Cave-Ayland, 2021/10/06
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Laurent Vivier, 2021/10/06
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Mark Cave-Ayland, 2021/10/06
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Laurent Vivier, 2021/10/06
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Laurent Vivier, 2021/10/06
- Re: [PATCH v2 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM, Mark Cave-Ayland, 2021/10/07
[PATCH v2 09/12] macfb: fix up 1-bit pixel encoding,
Mark Cave-Ayland <=
[PATCH v2 11/12] macfb: add vertical blank interrupt, Mark Cave-Ayland, 2021/10/04
[PATCH v2 12/12] q800: wire macfb IRQ to separate video interrupt on VIA2, Mark Cave-Ayland, 2021/10/04