Device memory is not a member of ram

This commit is contained in:
Devine Lu Linvega 2023-01-01 12:21:30 -08:00
parent 68d706be25
commit 679aec047a
4 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

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