diff --git a/src/uxn.c b/src/uxn.c index 0843579..78d0fbf 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -125,6 +125,9 @@ uxn_boot(Uxn *u, Uint8 *ram, Dei *dei, Deo *deo) for(i = 0; i < sizeof(*u); i++) cptr[i] = 0x00; u->ram = ram; + u->dev = (Uint8 *)(ram + 0x10200); + u->dei = dei; + u->deo = deo; return 1; } diff --git a/src/uxn.h b/src/uxn.h index ab9d7bd..d12ca54 100644 --- a/src/uxn.h +++ b/src/uxn.h @@ -46,7 +46,7 @@ typedef struct Device { } Device; typedef struct Uxn { - Uint8 *ram; + Uint8 *ram, *dev; Stack wst, rst; Device devold[16]; Uint8 (*dei)(struct Uxn *u, Uint8 addr); diff --git a/src/uxncli.c b/src/uxncli.c index 5cd2889..ab65530 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -94,7 +94,7 @@ uxn_interrupt(void) static int start(Uxn *u) { - if(!uxn_boot(u, (Uint8 *)calloc(0x10000, sizeof(Uint8)), emu_dei, emu_deo)) + if(!uxn_boot(u, (Uint8 *)calloc(0x10300, sizeof(Uint8)), emu_dei, emu_deo)) return error("Boot", "Failed"); /* system */ uxn_port(u, 0x0, system_dei, system_deo); /* console */ uxn_port(u, 0x1, nil_dei, console_deo); diff --git a/src/uxnemu.c b/src/uxnemu.c index 7834879..a94dd64 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -264,7 +264,7 @@ static int start(Uxn *u, char *rom) { free(u->ram); - if(!uxn_boot(u, calloc(0x10000, 1), emu_dei, emu_deo)) + if(!uxn_boot(u, calloc(0x10300, 1), emu_dei, emu_deo)) return error("Boot", "Failed to start uxn."); if(!load(u, rom)) return error("Boot", "Failed to load rom.");