diff --git a/ref/uxn b/ref/uxn deleted file mode 100755 index 6bdafe8..0000000 Binary files a/ref/uxn and /dev/null differ diff --git a/ref/uxn.c b/ref/uxn.c index 94de1d5..813ce74 100644 --- a/ref/uxn.c +++ b/ref/uxn.c @@ -17,7 +17,7 @@ typedef struct { } Stack; typedef struct Uxn { - Uint8 *ram, dev[0x100]; + Uint8 ram[0x10000], dev[0x100]; Stack wst, rst; } Uxn; @@ -33,16 +33,6 @@ system_load(Uxn *u, char *filename) return 1; } -int -system_init(Uxn *u, Uint8 *ram, char *rom) -{ - u->ram = ram; - if(!system_load(u, rom)) - if(!system_load(u, "boot.rom")) - return 0; - return 1; -} - int console_input(Uxn *u, char c, int type) { @@ -175,7 +165,7 @@ main(int argc, char **argv) fprintf(stdout, "usage: %s file.rom [args..]\n", argv[0]); return 0; } - if(!system_init(&u, (Uint8 *)calloc(0x10000, sizeof(Uint8)), argv[i++])) { + if(!system_load(&u, argv[i++])) { fprintf(stderr, "Failed to initialize %s\n", argv[1]); return 0; } @@ -192,6 +182,5 @@ main(int argc, char **argv) console_input(&u, (Uint8)c, 0x1); } } - free(u.ram); return u.dev[0x0f] & 0x7f; }