commit 674acb3
Devine Lu Linvega
·
2025-08-13 19:50:11 +0000 UTC
parent 90e7f56
Cleanup
2 files changed,
+8,
-6
+7,
-5
1@@ -40,15 +40,17 @@ void emu_deo(const Uint8 port, const Uint8 value);
2
3 /* clang-format off */
4
5+#define WIDTH (64 * 8)
6+#define HEIGHT (40 * 8)
7+
8+#define clamp(v, a, b) { if(v < a) v = a; else if(v >= b) v = b; }
9+#define twos(v) (v & 0x8000 ? (int)v - 0x10000 : (int)v)
10+
11 #define BANKS 0x10
12 #define BANKS_CAP BANKS * 0x10000
13
14-#define WIDTH (64 * 8)
15-#define HEIGHT (40 * 8)
16 #define PEEK2(d) (*(d) << 8 | (d)[1])
17 #define POKE2(d, v) { *(d) = (v) >> 8; (d)[1] = (v); }
18-#define clamp(v,a,b) { if(v < a) v = a; else if(v >= b) v = b; }
19-#define twos(v) (v & 0x8000 ? (int)v - 0x10000 : (int)v)
20
21 #define OPC(opc, A, B) {\
22 case 0x00|opc: {const int _2=0,_r=0;A B;} break;\
23@@ -164,7 +166,7 @@ system_load(const char *rom_path)
24 static unsigned int
25 system_boot(char *rom_path, const unsigned int has_args)
26 {
27- ram = (Uint8 *)calloc(BANKS * 0x10000, sizeof(Uint8));
28+ ram = (Uint8 *)calloc(BANKS_CAP, sizeof(Uint8));
29 system_boot_path = rom_path;
30 dev[0x17] = has_args;
31 return ram && system_load(rom_path);
+1,
-1
1@@ -151,7 +151,7 @@ system_load(char *rom_path)
2 static unsigned int
3 system_boot(char *rom_path, unsigned int has_args)
4 {
5- ram = (Uint8 *)calloc(BANKS * 0x10000, sizeof(Uint8));
6+ ram = (Uint8 *)calloc(BANKS_CAP, sizeof(Uint8));
7 system_boot_path = rom_path;
8 dev[0x17] = has_args;
9 return system_load(rom_path);