Browse code

Defined the location of stacks in shadow memory

neauoire authored on 07/01/2022 01:29:34
Showing 3 changed files
... ...
@@ -16,6 +16,8 @@ typedef signed short Sint16;
16 16
 typedef unsigned int Uint32;
17 17
 
18 18
 #define PAGE_PROGRAM 0x0100
19
+#define PAGE_WST 0xfe00
20
+#define PAGE_RST 0xff00
19 21
 
20 22
 /* clang-format off */
21 23
 
... ...
@@ -143,7 +143,7 @@ main(int argc, char **argv)
143 143
 
144 144
 	shadow = (Uint8 *)calloc(0xffff, sizeof(Uint8));
145 145
 	memory = (Uint8 *)calloc(0xffff, sizeof(Uint8));
146
-	if(!uxn_boot(&u, (Stack *)(shadow + 0x200), (Stack *)(shadow + 0x400), memory))
146
+	if(!uxn_boot(&u, (Stack *)(shadow + PAGE_WST), (Stack *)(shadow + PAGE_RST), memory))
147 147
 		return error("Boot", "Failed");
148 148
 
149 149
 	/* system   */ devsystem = uxn_port(&u, 0x0, system_dei, system_deo);
... ...
@@ -280,7 +280,7 @@ start(Uxn *u, char *rom)
280 280
 
281 281
 	if(!uxn_boot(&hypervisor, (Stack *)(shadow + 0xfc00), (Stack *)(shadow + 0xfd00), shadow))
282 282
 		return error("Boot", "Failed to start uxn.");
283
-	if(!uxn_boot(u, (Stack *)(shadow + 0xfe00), (Stack *)(shadow + 0xff00), memory))
283
+	if(!uxn_boot(u, (Stack *)(shadow + PAGE_WST), (Stack *)(shadow + PAGE_RST), memory))
284 284
 		return error("Boot", "Failed to start uxn.");
285 285
 	if(!load(&hypervisor, "hypervisor.rom"))
286 286
 		error("Hypervisor", "No debugger found.");