diff --git a/Makefile b/Makefile index 2b57830..0e6e9ab 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ PROCESSOR_FAMILY := lm4f BOARD := lplm4f120h5qr # watch the CPU execute -LOCAL_CPPFLAGS := -DCPU_DEBUG +#LOCAL_CPPFLAGS := -DCPU_DEBUG +CXXFLAGS := -fno-operator-names include energia.mk diff --git a/apple1.ino b/apple1.ino index 27227e5..e3eb8a8 100644 --- a/apple1.ino +++ b/apple1.ino @@ -23,19 +23,7 @@ prom m(monitor, sizeof(monitor)); ram pages[RAM_SIZE / 1024]; io io; -void status(const char *fmt, ...) { - char tmp[256]; - va_list args; - va_start(args, fmt); - vsnprintf(tmp, sizeof(tmp), fmt, args); - io.clear(); - io.error(tmp); - va_end(args); -} - -jmp_buf ex; -r6502 cpu(memory, ex, status); -bool halted = false; +r6502 cpu(memory); const char *filename; void reset() { @@ -46,8 +34,6 @@ void reset() { io.tape.start(PROGRAMS); else io.status("No SD Card"); - - halted = (setjmp(ex) != 0); } void setup() { @@ -105,6 +91,6 @@ void loop() { io.up(key); break; } - } else if (!halted) + } else if (!cpu.halted()) cpu.run(CPU_INSTRUCTIONS); }