diff --git a/emulator.c b/emulator.c index 61b07bf..355e19c 100644 --- a/emulator.c +++ b/emulator.c @@ -53,12 +53,14 @@ int main(int argc, char *argv[]) { Uxn cpu; + if(argc < 2) return error(&cpu, "No input.", 0); if(!load(&cpu, argv[1])) return error(&cpu, "Load error", 0); if(!boot(&cpu)) return error(&cpu, "Boot error", 0); + /* print result */ echos(&cpu.wst, 0x40, "stack"); echom(&cpu.ram, 0x40, "ram"); diff --git a/uxn.c b/uxn.c index 97f231d..4b0e52e 100644 --- a/uxn.c +++ b/uxn.c @@ -13,8 +13,6 @@ WITH REGARD TO THIS SOFTWARE. #include "uxn.h" -Uxn cpu; - #pragma mark - Operations /* clang-format off */