commit 743b3b0

Devie Lu Linvega  ·  2025-12-24 19:45:56 +0000 UTC
parent 29e5753
Using pixel byte requests full redraw
1 files changed,  +12, -6
+12, -6
 1@@ -531,10 +531,13 @@ static int rX, rY, rA, rMX, rMY, rMA, rML, rDX, rDY;
 2 static void
 3 screen_draw_pixel(void)
 4 {
 5+	int layer_mask, color;
 6 	const int ctrl = dev[0x2e];
 7 	const int len = MAR2(screen_width);
 8-	const int above = ctrl & 0x40, layer_mask = above ? 0x3 : 0xc;
 9-	const int color = above ? (ctrl & 0x3) << 2 : ctrl & 0x3;
10+	if(ctrl & 0x40)
11+		layer_mask = 0x3, color = (ctrl & 0x3) << 2;
12+	else
13+		layer_mask = 0xc, color = ctrl & 0x3;
14 	/* fill mode */
15 	if(ctrl & 0x80) {
16 		int x1, y1, x2, y2, ax, bx, ay, by, hor, ver;
17@@ -562,7 +565,7 @@ screen_draw_pixel(void)
18 			const int src = screen_layers[ax] & layer_mask;
19 			screen_layers[ax] = src | color;
20 		}
21-		if(!screen_reqdraw) screen_change(rX, rY, rX + 1, rY + 1);
22+		screen_reqdraw = 1;
23 		if(rMX) rX++;
24 		if(rMY) rY++;
25 	}
26@@ -571,17 +574,20 @@ screen_draw_pixel(void)
27 static void
28 screen_draw_sprite(void)
29 {
30+	const Uint8 *table;
31 	const int ctrl = dev[0x2f];
32 	const int blend = ctrl & 0xf;
33-	const int above = ctrl & 0x40, layer_mask = above ? 0x3 : 0xc;
34 	const int opaque = blend % 5;
35 	const int fx = ctrl & 0x10 ? -1 : 1, fy = ctrl & 0x20 ? -1 : 1;
36 	const int qfx = fx > 0 ? 7 : 0, qfy = fy < 0 ? 7 : 0;
37 	const int dxy = fy * rDX, dyx = fx * rDY;
38 	const int wmar = MAR(screen_width), wmar2 = MAR2(screen_width);
39 	const int hmar2 = MAR2(screen_height);
40-	const Uint8 *table = blending[blend][!!above];
41-	int i, x1, x2, y1, y2, ax, ay, bx, by, qx, qy, x = rX, y = rY;
42+	int i, x1, x2, y1, y2, ax, ay, bx, by, qx, qy, x = rX, y = rY, layer_mask;
43+	if(ctrl & 0x40)
44+		layer_mask = 0x3, table = blending[blend][1];
45+	else
46+		layer_mask = 0xc, table = blending[blend][0];
47 	if(ctrl & 0x80) {
48 		const int addr_incr = rMA << 2;
49 		for(i = 0; i <= rML; i++, x += dyx, y += dxy, rA += addr_incr) {