commit 1706cdb

neauoire  ·  2023-11-12 23:59:15 +0000 UTC
parent 8fb1c78
Housekeeping
1 files changed,  +8, -12
+8, -12
 1@@ -212,29 +212,27 @@ screen_dei(Uxn *u, Uint8 addr)
 2 void
 3 screen_deo(Uint8 *ram, Uint8 *d, Uint8 port)
 4 {
 5-	Uint8 *port_height, *port_x, *port_y, *port_addr;
 6+	Uint8 *port_x, *port_y, *port_addr;
 7 	Uint16 x, y, dx, dy, dxy, dyx, addr, addr_incr;
 8 	switch(port) {
 9 	case 0x3: {
10 		Uint8 *port_width = d + 0x2;
11 		screen_resize(PEEK2(port_width), uxn_screen.height);
12 	} break;
13-	case 0x5:
14-		port_height = d + 0x4;
15+	case 0x5: {
16+		Uint8 *port_height = d + 0x4;
17 		screen_resize(uxn_screen.width, PEEK2(port_height));
18-		break;
19+	} break;
20 	case 0xe: {
21 		Uint8 ctrl = d[0xe];
22 		Uint8 color = ctrl & 0x3;
23 		Uint8 *layer = (ctrl & 0x40) ? uxn_screen.fg : uxn_screen.bg;
24-		port_x = d + 0x8;
25-		port_y = d + 0xa;
26+		port_x = d + 0x8, port_y = d + 0xa;
27 		x = PEEK2(port_x);
28 		y = PEEK2(port_y);
29 		/* fill mode */
30 		if(ctrl & 0x80) {
31-			Uint16 x2 = uxn_screen.width;
32-			Uint16 y2 = uxn_screen.height;
33+			Uint16 x2 = uxn_screen.width, y2 = uxn_screen.height;
34 			if(ctrl & 0x10) x2 = x, x = 0;
35 			if(ctrl & 0x20) y2 = y, y = 0;
36 			screen_rect(layer, x, y, x2, y2, color);
37@@ -242,8 +240,7 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port)
38 		}
39 		/* pixel mode */
40 		else {
41-			Uint16 width = uxn_screen.width;
42-			Uint16 height = uxn_screen.height;
43+			Uint16 width = uxn_screen.width, height = uxn_screen.height;
44 			if(x < width && y < height)
45 				layer[x + y * width] = color;
46 			screen_change(x, y, x + 1, y + 1);
47@@ -262,8 +259,7 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port)
48 		Uint8 color = ctrl & 0xf;
49 		int flipx = (ctrl & 0x10), fx = flipx ? -1 : 1;
50 		int flipy = (ctrl & 0x20), fy = flipy ? -1 : 1;
51-		port_x = d + 0x8;
52-		port_y = d + 0xa;
53+		port_x = d + 0x8, port_y = d + 0xa;
54 		port_addr = d + 0xc;
55 		x = PEEK2(port_x), dx = (move & 0x1) << 3, dxy = dx * fy;
56 		y = PEEK2(port_y), dy = (move & 0x2) << 2, dyx = dy * fx;