uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 679aec047a5ef0e30c05b07402043c50fcee3852
parent 68d706be25a2b8cba779c00b5523b21c95a7c5d5
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Sun,  1 Jan 2023 12:21:30 -0800

Device memory is not a member of ram

Diffstat:
Msrc/uxn.c | 3+++
Msrc/uxn.h | 2+-
Msrc/uxncli.c | 2+-
Msrc/uxnemu.c | 2+-
4 files changed, 6 insertions(+), 3 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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.");