Fixed issue with boot

This commit is contained in:
neauoire 2021-02-09 09:05:01 -08:00
parent 220c3676e5
commit 1dbe552f77
2 changed files with 5 additions and 9 deletions

10
cli.c
View File

@ -72,28 +72,24 @@ echof(Uxn *c)
getflag(&c->status, FLAG_COND) != 0); getflag(&c->status, FLAG_COND) != 0);
} }
Uxn u;
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
Uxn u;
if(argc < 2) if(argc < 2)
return error("Input", "Missing"); return error("Input", "Missing");
if(!bootuxn(&u)) if(!bootuxn(&u))
return error("Boot", "Failed"); return error("Boot", "Failed");
if(!loaduxn(&u, argv[1])) if(!loaduxn(&u, argv[1]))
return error("Load", "Failed"); return error("Load", "Failed");
portuxn(&u, 0xfff0, 0xfff1, console_onread, console_onwrite); portuxn(&u, 0xfff0, 0xfff1, console_onread, console_onwrite);
printf("VRESET\n");
evaluxn(&u, u.vreset); evaluxn(&u, u.vreset);
printf("VFRAME\n");
evaluxn(&u, u.vframe); evaluxn(&u, u.vframe);
/*
echos(&u.wst, 0x40, "stack"); echos(&u.wst, 0x40, "stack");
echom(&u.ram, 0x40, "ram"); echom(&u.ram, 0x40, "ram");
echof(&u); echof(&u);
*/
return 0; return 0;
} }

2
uxn.c
View File

@ -170,7 +170,7 @@ int
bootuxn(Uxn *u) bootuxn(Uxn *u)
{ {
size_t i; size_t i;
char *cptr = (char *)u; char *cptr = (char *)&u;
for(i = 0; i < sizeof u; i++) for(i = 0; i < sizeof u; i++)
cptr[i] = 0; cptr[i] = 0;
return 1; return 1;