commit c2825bc

Devine Lu Linvega  ·  2025-05-17 22:06:25 +0000 UTC
parent 6ee8ce5
Removed Uint32 type
2 files changed,  +26, -28
+14, -15
 1@@ -24,7 +24,6 @@ cc -DNDEBUG -O2 -g0 -s src/uxn11.c -lX11 -lutil -o bin/uxn11
 2 
 3 typedef unsigned char Uint8;
 4 typedef unsigned short Uint16;
 5-typedef unsigned int Uint32;
 6 
 7 typedef struct {
 8 	Uint8 dat[0x100], ptr;
 9@@ -83,7 +82,7 @@ void emu_deo(Uint8 addr, Uint8 value);
10 int
11 uxn_eval(Uint16 pc)
12 {
13-	Uint32 a, b, c, x[2], y[2], z[2], step;
14+	unsigned int a, b, c, x[2], y[2], z[2], step;
15 	for(step = 0x80000000; step; step--) {
16 		switch(ram[pc++]) {
17 		/* BRK */ case 0x00: return 1;
18@@ -183,22 +182,22 @@ static void
19 system_expansion(Uint16 addr)
20 {
21 	Uint8 *aptr = ram + addr;
22-	Uint16 value, length = PEEK2(aptr + 1);
23+	Uint16 length = PEEK2(aptr + 1);
24 	if(ram[addr] == 0x0) {
25-		Uint32 a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
26-		Uint32 b = a + length;
27-		value = ram[addr + 7];
28+		unsigned int a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
29+		unsigned int b = a + length;
30+		unsigned int value = ram[addr + 7];
31 		for(; a < b; ram[a++] = value);
32 	} else if(ram[addr] == 0x1) {
33-		Uint32 a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
34-		Uint32 b = a + length;
35-		Uint32 c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
36+		unsigned int a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
37+		unsigned int b = a + length;
38+		unsigned int c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
39 		for(; a < b; ram[c++] = ram[a++]);
40 	} else if(ram[addr] == 0x2) {
41-		Uint32 a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
42-		Uint32 b = a + length;
43-		Uint32 c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
44-		Uint32 d = c + length;
45+		unsigned int a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
46+		unsigned int b = a + length;
47+		unsigned int c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
48+		unsigned int d = c + length;
49 		for(; b >= a; ram[--d] = ram[--b]);
50 	} else
51 		fprintf(stderr, "Unknown command: %s\n", &ram[addr]);
52@@ -407,7 +406,7 @@ console_input(int c, int type)
53 
54 typedef struct UxnScreen {
55 	int width, height, zoom, x1, y1, x2, y2;
56-	Uint32 palette[16], *pixels;
57+	unsigned int palette[16], *pixels;
58 	Uint8 *fg, *bg;
59 } UxnScreen;
60 
61@@ -1031,7 +1030,7 @@ emu_resize(void)
62 	int height = uxn_screen.height * uxn_screen.zoom;
63 	XResizeWindow(display, window, width, height);
64 	uxn_screen.pixels = realloc(uxn_screen.pixels,
65-		uxn_screen.width * uxn_screen.height * sizeof(Uint32) * uxn_screen.zoom * uxn_screen.zoom);
66+		uxn_screen.width * uxn_screen.height * sizeof(unsigned int) * uxn_screen.zoom * uxn_screen.zoom);
67 	if(ximage)
68 		free(ximage);
69 	ximage = XCreateImage(display, DefaultVisual(display, 0), DefaultDepth(display, DefaultScreen(display)), ZPixmap, 0, (char *)uxn_screen.pixels, width, height, 32, 0);
+12, -13
 1@@ -18,7 +18,6 @@ cc -DNDEBUG -O2 -g0 -s src/uxncli.c -lutil -o bin/uxncli
 2 
 3 typedef unsigned char Uint8;
 4 typedef unsigned short Uint16;
 5-typedef unsigned int Uint32;
 6 
 7 typedef struct {
 8 	Uint8 dat[0x100], ptr;
 9@@ -70,7 +69,7 @@ void emu_deo(Uint8 addr, Uint8 value);
10 int
11 uxn_eval(Uint16 pc)
12 {
13-	Uint32 a, b, c, x[2], y[2], z[2], step = 0x80000000;
14+	unsigned int a, b, c, x[2], y[2], z[2], step = 0x80000000;
15 	if(dev[0x0f]) return 0;
16 	while(step--) {
17 		switch(ram[pc++]) {
18@@ -162,22 +161,22 @@ static void
19 system_expansion(Uint16 addr)
20 {
21 	Uint8 *aptr = ram + addr;
22-	Uint16 value, length = PEEK2(aptr + 1);
23+	Uint16 length = PEEK2(aptr + 1);
24 	if(ram[addr] == 0x0) {
25-		Uint32 a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
26-		Uint32 b = a + length;
27-		value = ram[addr + 7];
28+		unsigned int a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
29+		unsigned int b = a + length;
30+		unsigned int value = ram[addr + 7];
31 		for(; a < b; ram[a++] = value);
32 	} else if(ram[addr] == 0x1) {
33-		Uint32 a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
34-		Uint32 b = a + length;
35-		Uint32 c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
36+		unsigned int a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
37+		unsigned int b = a + length;
38+		unsigned int c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
39 		for(; a < b; ram[c++] = ram[a++]);
40 	} else if(ram[addr] == 0x2) {
41-		Uint32 a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
42-		Uint32 b = a + length;
43-		Uint32 c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
44-		Uint32 d = c + length;
45+		unsigned int a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
46+		unsigned int b = a + length;
47+		unsigned int c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
48+		unsigned int d = c + length;
49 		for(; b >= a; ram[--d] = ram[--b]);
50 	} else
51 		fprintf(stderr, "Unknown command: %s\n", &ram[addr]);