From a8df7ca410d7cba4702bda9c29be2421d5dab918 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Mon, 20 Sep 2021 23:02:42 +0100 Subject: [PATCH] Fixed palette array --- src/uxnemu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/uxnemu.c b/src/uxnemu.c index 1c88ef1..c11a47b 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -36,7 +36,7 @@ static SDL_Rect gRect; static Ppu ppu; static Apu apu[POLYPHONY]; static Device *devsystem, *devscreen, *devmouse, *devctrl, *devaudio0, *devconsole; -static Uint32 *ppu_screen, stdin_event, audio0_event, palette[4]; +static Uint32 *ppu_screen, stdin_event, audio0_event, palette[16]; static Uint8 zoom = 1; static unsigned int reqdraw = 0; @@ -300,6 +300,8 @@ update_palette(Uint8 *addr) b = (*(addr + 4 + i / 2) >> (!(i % 2) << 2)) & 0x0f; palette[i] = 0xff000000 | (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | b; } + for(i = 4; i < 16; ++i) + palette[i] = palette[i / 4]; reqdraw = 1; }