commit 03328cf

Devine Lu Linvega  ·  2024-07-01 05:09:49 +0000 UTC
parent 5571e0a
Do not pass memory for screen_palette
3 files changed,  +6, -6
+4, -4
 1@@ -156,14 +156,14 @@ screen_rect(Uint8 *layer, Uint16 x1, Uint16 y1, Uint16 x2, Uint16 y2, int color)
 2 }
 3 
 4 void
 5-screen_palette(Uint8 *addr)
 6+screen_palette(void)
 7 {
 8 	int i, shift;
 9 	for(i = 0, shift = 4; i < 4; ++i, shift ^= 4) {
10 		Uint8
11-			r = (addr[0 + i / 2] >> shift) & 0xf,
12-			g = (addr[2 + i / 2] >> shift) & 0xf,
13-			b = (addr[4 + i / 2] >> shift) & 0xf;
14+			r = (uxn.dev[0x8 + i / 2] >> shift) & 0xf,
15+			g = (uxn.dev[0xa + i / 2] >> shift) & 0xf,
16+			b = (uxn.dev[0xc + i / 2] >> shift) & 0xf;
17 		uxn_screen.palette[i] = 0x0f000000 | r << 16 | g << 8 | b;
18 		uxn_screen.palette[i] |= uxn_screen.palette[i] << 4;
19 	}
+1, -1
1@@ -21,7 +21,7 @@ int screen_changed(void);
2 void screen_change(int x1, int y1, int x2, int y2);
3 void screen_fill(Uint8 *layer, int color);
4 void screen_rect(Uint8 *layer, Uint16 x1, Uint16 y1, Uint16 x2, Uint16 y2, int color);
5-void screen_palette(Uint8 *addr);
6+void screen_palette(void);
7 void screen_resize(Uint16 width, Uint16 height, int scale);
8 void screen_redraw();
9 
+1, -1
1@@ -65,7 +65,7 @@ emu_deo(Uint8 addr, Uint8 value)
2 	case 0x00:
3 		system_deo(p);
4 		if(p > 0x7 && p < 0xe)
5-			screen_palette(&uxn.dev[0x8]);
6+			screen_palette();
7 		break;
8 	case 0x10: console_deo(p); break;
9 	case 0x20: screen_deo(p); break;