Defined the location of stacks in shadow memory

This commit is contained in:
neauoire 2022-01-06 17:29:34 -08:00
parent 4c6821189e
commit a82f7d79f8
3 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,8 @@ typedef signed short Sint16;
typedef unsigned int Uint32; typedef unsigned int Uint32;
#define PAGE_PROGRAM 0x0100 #define PAGE_PROGRAM 0x0100
#define PAGE_WST 0xfe00
#define PAGE_RST 0xff00
/* clang-format off */ /* clang-format off */

View File

@ -143,7 +143,7 @@ main(int argc, char **argv)
shadow = (Uint8 *)calloc(0xffff, sizeof(Uint8)); shadow = (Uint8 *)calloc(0xffff, sizeof(Uint8));
memory = (Uint8 *)calloc(0xffff, sizeof(Uint8)); memory = (Uint8 *)calloc(0xffff, sizeof(Uint8));
if(!uxn_boot(&u, (Stack *)(shadow + 0x200), (Stack *)(shadow + 0x400), memory)) if(!uxn_boot(&u, (Stack *)(shadow + PAGE_WST), (Stack *)(shadow + PAGE_RST), memory))
return error("Boot", "Failed"); return error("Boot", "Failed");
/* system */ devsystem = uxn_port(&u, 0x0, system_dei, system_deo); /* system */ devsystem = uxn_port(&u, 0x0, system_dei, system_deo);

View File

@ -280,7 +280,7 @@ start(Uxn *u, char *rom)
if(!uxn_boot(&hypervisor, (Stack *)(shadow + 0xfc00), (Stack *)(shadow + 0xfd00), shadow)) if(!uxn_boot(&hypervisor, (Stack *)(shadow + 0xfc00), (Stack *)(shadow + 0xfd00), shadow))
return error("Boot", "Failed to start uxn."); return error("Boot", "Failed to start uxn.");
if(!uxn_boot(u, (Stack *)(shadow + 0xfe00), (Stack *)(shadow + 0xff00), memory)) if(!uxn_boot(u, (Stack *)(shadow + PAGE_WST), (Stack *)(shadow + PAGE_RST), memory))
return error("Boot", "Failed to start uxn."); return error("Boot", "Failed to start uxn.");
if(!load(&hypervisor, "hypervisor.rom")) if(!load(&hypervisor, "hypervisor.rom"))
error("Hypervisor", "No debugger found."); error("Hypervisor", "No debugger found.");