commit 8a61a87

Devine Lu Linvega  ·  2026-06-07 17:21:42 +0000 UTC
parent b65a061
Trying to make zoomed redraw faster
1 files changed,  +9, -9
+9, -9
 1@@ -384,7 +384,7 @@ system_deo_colorize(void)
 2 		colors[i] |= colors[i] << 4;
 3 	}
 4 	for(i = 0; i < 16; i++)
 5-		screen_palette[i] = colors[i >> 2 ? i >> 2 : i & 3];
 6+		screen_palette[i] = colors[i < 4 ? i : i >> 2];
 7 	screen_reqdraw = 1;
 8 }
 9 
10@@ -417,17 +417,17 @@ screen_redraw(void)
11 			src_ptr += 0x10;
12 		}
13 	} else {
14-		int x, y, i, k, l;
15 		const int stride = screen_width * screen_zoom;
16-		for(y = 0; y < screen_height; y++) {
17-			const int ys = y * screen_zoom;
18-			for(x = 0, i = (x + 8) + (y + 8) * screen_wmar2; x < screen_width; x++, i++) {
19+		const int zoom_stride = screen_zoom * stride;
20+		int x, y, k, l, row_base = 0, i_base = 8 * screen_wmar2 + 8;
21+		for(y = 0; y < screen_height; y++, row_base += zoom_stride, i_base += screen_wmar2) {
22+			int i = i_base, xs = 0;
23+			for(x = 0; x < screen_width; x++, i++, xs += screen_zoom) {
24 				const int c = screen_palette[screen_layers[i]];
25-				int oo = ys * stride + x * screen_zoom;
26-				for(k = 0; k < screen_zoom; k++, oo += stride) {
27+				int oo = row_base + xs;
28+				for(k = 0; k < screen_zoom; k++, oo += stride)
29 					for(l = 0; l < screen_zoom; l++)
30 						screen_pixels[oo + l] = c;
31-				}
32 			}
33 		}
34 	}
35@@ -1323,7 +1323,7 @@ main(int argc, char **argv)
36 {
37 	int i = 1;
38 	if(argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v')
39-		return !fprintf(stdout, "%s - Varvara Emulator(80K), 1 Jun 2026.\n", argv[0]);
40+		return !fprintf(stdout, "%s - Varvara Emulator(80K), 7 Jun 2026.\n", argv[0]);
41 	else if(argc == 1)
42 		return !fprintf(stdout, "usage: %s [-v] file.rom [args..]\n", argv[0]);
43 	else if(!system_boot(argv[i++], argc > 2))