Do not pass memory for screen_palette

This commit is contained in:
Devine Lu Linvega 2024-06-30 21:09:49 -08:00
parent 5571e0a92b
commit 03328cfc68
3 changed files with 6 additions and 6 deletions

View File

@ -156,14 +156,14 @@ screen_rect(Uint8 *layer, Uint16 x1, Uint16 y1, Uint16 x2, Uint16 y2, int color)
} }
void void
screen_palette(Uint8 *addr) screen_palette(void)
{ {
int i, shift; int i, shift;
for(i = 0, shift = 4; i < 4; ++i, shift ^= 4) { for(i = 0, shift = 4; i < 4; ++i, shift ^= 4) {
Uint8 Uint8
r = (addr[0 + i / 2] >> shift) & 0xf, r = (uxn.dev[0x8 + i / 2] >> shift) & 0xf,
g = (addr[2 + i / 2] >> shift) & 0xf, g = (uxn.dev[0xa + i / 2] >> shift) & 0xf,
b = (addr[4 + i / 2] >> shift) & 0xf; b = (uxn.dev[0xc + i / 2] >> shift) & 0xf;
uxn_screen.palette[i] = 0x0f000000 | r << 16 | g << 8 | b; uxn_screen.palette[i] = 0x0f000000 | r << 16 | g << 8 | b;
uxn_screen.palette[i] |= uxn_screen.palette[i] << 4; uxn_screen.palette[i] |= uxn_screen.palette[i] << 4;
} }

View File

@ -21,7 +21,7 @@ int screen_changed(void);
void screen_change(int x1, int y1, int x2, int y2); void screen_change(int x1, int y1, int x2, int y2);
void screen_fill(Uint8 *layer, int color); void screen_fill(Uint8 *layer, int color);
void screen_rect(Uint8 *layer, Uint16 x1, Uint16 y1, Uint16 x2, Uint16 y2, int color); void screen_rect(Uint8 *layer, Uint16 x1, Uint16 y1, Uint16 x2, Uint16 y2, int color);
void screen_palette(Uint8 *addr); void screen_palette(void);
void screen_resize(Uint16 width, Uint16 height, int scale); void screen_resize(Uint16 width, Uint16 height, int scale);
void screen_redraw(); void screen_redraw();

View File

@ -65,7 +65,7 @@ emu_deo(Uint8 addr, Uint8 value)
case 0x00: case 0x00:
system_deo(p); system_deo(p);
if(p > 0x7 && p < 0xe) if(p > 0x7 && p < 0xe)
screen_palette(&uxn.dev[0x8]); screen_palette();
break; break;
case 0x10: console_deo(p); break; case 0x10: console_deo(p); break;
case 0x20: screen_deo(p); break; case 0x20: screen_deo(p); break;