commit 65f1d70
Devine Lu Linvega
·
2026-01-02 21:36:31 +0000 UTC
parent 03517f3
Fixed boundary issue in screen
1 files changed,
+5,
-5
+5,
-5
1@@ -558,8 +558,8 @@ screen_draw_pixel(void)
2 }
3 /* pixel mode */
4 else {
5- const int x = rX, y = rY;
6- if(x < len && y < screen_height) {
7+ const unsigned int x = rX, y = rY;
8+ if(x < screen_width && y < screen_height) {
9 Uint8 *dst = &screen_layers[(x + 8) + (y + 8) * len];
10 *dst = (*dst & layer_mask) | color;
11 }
12@@ -615,7 +615,7 @@ screen_draw_sprite(void)
13 const Uint16 xmar2 = x + 16, ymar2 = y + 16, xmar = x + 8, ymar = y + 8;
14 if(xmar2 == xmar + 8 && ymar2 == ymar + 8 && xmar2 < screen_wmar2 && ymar2 < screen_hmar2) {
15 Uint8 *dst = &screen_layers[xmar + ymar * screen_wmar2];
16- Uint8 *sch1 = &ram[rA + qfy], *sch2 = sch1 + 8;
17+ const Uint8 *sch1 = &ram[rA + qfy], *sch2 = sch1 + 8;
18 if(opaque)
19 for(row = 0; row < 8; row++, dst += screen_wmar2, sch1 += fy, sch2 += fy)
20 PUT_PIXELS(n, 1, 1, *sch1, *sch2 << 1)
21@@ -630,7 +630,7 @@ screen_draw_sprite(void)
22 const Uint16 xmar2 = x + 16, ymar2 = y + 16, xmar = x + 8, ymar = y + 8;
23 if(xmar2 == xmar + 8 && ymar2 == ymar + 8 && xmar2 < screen_wmar2 && ymar2 < screen_hmar2) {
24 Uint8 *dst = &screen_layers[xmar + ymar * screen_wmar2];
25- Uint8 *sch1 = &ram[rA + qfy];
26+ const Uint8 *sch1 = &ram[rA + qfy];
27 if(opaque)
28 for(row = 0; row < 8; row++, dst += screen_wmar2, sch1 += fy)
29 PUT_PIXELS(n, 1, 0, *sch1, 0)
30@@ -1269,7 +1269,7 @@ main(int argc, char **argv)
31 {
32 int i = 1;
33 if(argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v')
34- return !fprintf(stdout, "%s - Varvara Emulator, 30 Dec 2025.\n", argv[0]);
35+ return !fprintf(stdout, "%s - Varvara Emulator, 2 Jan 2026.\n", argv[0]);
36 else if(argc == 1)
37 return !fprintf(stdout, "usage: %s [-v] file.rom [args..]\n", argv[0]);
38 else if(!system_boot(argv[i++], argc > 2))