commit 218eb38
Devine Lu Linvega
·
2026-01-07 18:28:33 +0000 UTC
parent 3b1da29
Removed trampolines
1 files changed,
+10,
-17
+10,
-17
1@@ -177,8 +177,9 @@ system_reboot(const unsigned int soft)
2 }
3
4 static void
5-system_expansion(const Uint16 exp)
6+system_deo_expansion(void)
7 {
8+ const Uint16 exp = PEEK2(dev + 2);
9 Uint8 *aptr = ram + exp;
10 Uint16 length = PEEK2(aptr + 1), limit;
11 unsigned int bank = PEEK2(aptr + 3) * 0x10000;
12@@ -386,7 +387,7 @@ kill_child(void)
13 }
14
15 static void
16-console_start_fork(void)
17+console_deo_fork(void)
18 {
19 fflush(stderr);
20 kill_child();
21@@ -442,7 +443,7 @@ screen_change(const int x1, const int y1, const int x2, const int y2)
22 }
23
24 static void
25-screen_colorize(void)
26+system_deo_colorize(void)
27 {
28 unsigned int i, shift, colors[4];
29 for(i = 0, shift = 4; i < 4; ++i, shift ^= 4) {
30@@ -530,7 +531,7 @@ screen_update(void)
31 }
32
33 static void
34-screen_draw_pixel(void)
35+screen_deo_pixel(void)
36 {
37 int layer_mask, color, px;
38 const int ctrl = dev[0x2e];
39@@ -591,7 +592,7 @@ screen_draw_pixel(void)
40 /* clang-format on */
41
42 static void
43-screen_draw_sprite(void)
44+screen_deo_sprite(void)
45 {
46 int i, x = rX, y = rY, layer_mask;
47 int fx, fy, qfx, qfy, dxy, dyx, row;
48@@ -989,11 +990,9 @@ datetime_update(void)
49
50 #define CONINBUFSIZE 256
51
52-typedef Uint8 (*dei_handler)(void);
53-typedef void (*deo_handler)(void);
54-
55 /* clang-format off */
56
57+typedef Uint8 (*dei_handler)(void);
58 static dei_handler dei_handlers[256];
59
60 Uint8 system_dei_wst(void) { return ptr[0]; }
61@@ -1018,19 +1017,17 @@ Uint8 datetime_dei_ydayhb(void) { datetime_update(); return datetime_t->tm_yday
62 Uint8 datetime_dei_ydaylb(void) { datetime_update(); return datetime_t->tm_yday; }
63 Uint8 datetime_dei_dst(void) { datetime_update(); return datetime_t->tm_isdst; }
64
65+typedef void (*deo_handler)(void);
66 static deo_handler deo_handlers[256];
67
68-void system_deo_expansion(void) { system_expansion(PEEK2(dev + 2)); }
69 void system_deo_wst(void) { ptr[0] = dev[4]; }
70 void system_deo_rst(void) { ptr[0] = dev[4]; }
71-void system_deo_colorize(void) { screen_colorize(); }
72 void system_deo_print(void) { system_print("WST", 0), system_print("RST", 1); }
73 void console_deo_vector(void) { console_vector = PEEK2(&dev[0x10]); }
74 void console_deo_stdout(void) { fputc(dev[0x18], stdout), fflush(stdout); }
75 void console_deo_stderr(void) { fputc(dev[0x19], stderr), fflush(stderr); }
76 void console_deo_hb(void) { fprintf(stderr, "%02x", dev[0x1a]); }
77 void console_deo_lb(void) { fprintf(stderr, "%02x", dev[0x1b]); }
78-void console_deo_fork(void) { console_start_fork(); }
79 void screen_deo_vector(void) { screen_vector = PEEK2(&dev[0x20]); }
80 void screen_deo_width(void) { screen_resize(PEEK2(&dev[0x22]) & 0xfff, screen_height & 0xfff); }
81 void screen_deo_height(void) { screen_resize(screen_width & 0xfff, PEEK2(&dev[0x24]) & 0xfff); }
82@@ -1038,8 +1035,6 @@ void screen_deo_auto(void) { rMX = dev[0x26] & 0x1, rMY = dev[0x26] & 0x2, rMA =
83 void screen_deo_x(void) { rX = (dev[0x28] << 8) | dev[0x29], rX = TWOS(rX); }
84 void screen_deo_y(void) { rY = (dev[0x2a] << 8) | dev[0x2b], rY = TWOS(rY); }
85 void screen_deo_addr(void) { rA = (dev[0x2c] << 8) | dev[0x2d]; }
86-void screen_deo_pixel(void) { screen_draw_pixel(); }
87-void screen_deo_sprite(void) { screen_draw_sprite(); }
88 void controller_deo_vector(void) { controller_vector = PEEK2(&dev[0x80]); }
89 void mouse_deo_vector(void) { mouse_vector = PEEK2(&dev[0x90]); }
90 void filea_deo_vector(void) { rL1 = PEEK2(&dev[0xaa]); }
91@@ -1048,7 +1043,7 @@ void filea_deo_delete(void) { file_success(0xa2, file_delete(0)); }
92 void filea_deo_name(void) { file_success(0xa2, file_init(0, PEEK2(&dev[0xa8]))); }
93 void filea_deo_read(void) { file_success(0xa2, file_read(0, PEEK2(&dev[0xac]), rL1)); }
94 void filea_deo_write(void) { file_success(0xa2, file_write(0, PEEK2(&dev[0xae]), rL1, dev[0xa7])); }
95-void fileb_deo_vector(void) { rL1 = PEEK2(&dev[0xba]); }
96+void fileb_deo_vector(void) { rL2 = PEEK2(&dev[0xba]); }
97 void fileb_deo_stat(void) { file_success(0xb2, file_stat(0, PEEK2(&dev[0xb4]), rL1)); }
98 void fileb_deo_delete(void) { file_success(0xb2, file_delete(0)); }
99 void fileb_deo_name(void) { file_success(0xb2, file_init(0, PEEK2(&dev[0xb8]))); }
100@@ -1139,10 +1134,8 @@ void
101 emu_deo(const Uint8 port, const Uint8 value)
102 {
103 dev[port] = value;
104- if(deo_handlers[port]) {
105+ if(deo_handlers[port])
106 deo_handlers[port]();
107- return;
108- }
109 }
110
111 void