commit 95ebb6f
Devine Lu Linvega
·
2026-02-08 09:51:54 +0000 UTC
parent bcfa57d
Clear screen on reboot
1 files changed,
+10,
-10
+10,
-10
1@@ -39,6 +39,9 @@ static int emu_x11;
2 static int emu_timer;
3 static unsigned int uxn_eval(Uint16 pc);
4
5+static int console_vector, screen_vector, controller_vector, mouse_vector;
6+static int rX, rY, rA, rMX, rMY, rMA, rML, rDX, rDY, rL1, rL2;
7+
8 /* clang-format off */
9
10 #define BANKS 0x10
11@@ -102,6 +105,8 @@ system_reboot(const unsigned int soft)
12 else
13 memset(uxn.ram, 0, 0x10000);
14 uxn.ptr[0] = uxn.ptr[1] = 0;
15+ console_vector = screen_vector = controller_vector = mouse_vector = 0;
16+ rX = rY = rA = rMX = rMY = rMA = rML = rDX = rDY = rL1 = rL2 = 0;
17 return system_load(system_boot_path);
18 }
19
20@@ -143,8 +148,6 @@ static void system_deo_print(void) { system_print("WST", 0), system_print("RST",
21 #define CONSOLE_EOA 0x3
22 #define CONSOLE_END 0x4
23
24-static unsigned int console_vector;
25-
26 static unsigned int
27 console_input(int c, unsigned int type)
28 {
29@@ -348,8 +351,7 @@ static void console_deo_lb(void) { fprintf(stderr, "%02x", uxn.dev[0x1b]); }
30 static int screen_zoom = 1, screen_reqsize, screen_reqdraw;
31 static int screen_width, screen_height, screen_wmar2, screen_hmar2;
32 static int screen_x1, screen_y1, screen_x2, screen_y2;
33-static int screen_vector, *screen_pixels, screen_palette[16];
34-static int rX, rY, rA, rMX, rMY, rMA, rML, rDX, rDY;
35+static int *screen_pixels, screen_palette[16];
36 static Uint8 *screen_layers;
37
38 static const Uint8 blend_lut[16][2][4] = {
39@@ -579,8 +581,6 @@ static void screen_deo_addr(void) { rA = (uxn.dev[0x2c] << 8) | uxn.dev[0x2d]; }
40 /*
41 @|Controller -------------------------------------------------------- */
42
43-static unsigned int controller_vector;
44-
45 static void
46 controller_down(Uint8 mask)
47 {
48@@ -618,8 +618,6 @@ controller_deo_vector(void)
49 /*
50 @|Mouse ------------------------------------------------------------- */
51
52-static unsigned int mouse_vector;
53-
54 static void
55 mouse_down(Uint8 mask)
56 {
57@@ -678,7 +676,6 @@ typedef struct {
58 } UxnFile;
59
60 static UxnFile ufs[2];
61-static unsigned int rL1, rL2;
62
63 static void
64 make_pathfile(char *pathbuf, const char *filepath, const char *basename)
65@@ -1127,7 +1124,10 @@ emu_redraw(void)
66 static void
67 emu_restart(unsigned int soft)
68 {
69- screen_resize(WIDTH, HEIGHT), system_reboot(soft), uxn_eval(0x100);
70+ system_reboot(soft);
71+ screen_width = screen_height = 0;
72+ screen_resize(WIDTH, HEIGHT);
73+ uxn_eval(0x100);
74 }
75
76 static Uint8