From b96351411159121a726070d90201542841ab15fc Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Sat, 23 Jan 2016 21:15:44 +0000 Subject: [PATCH] cleanup --- Makefile | 3 ++- apple1.ino | 18 ++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) 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); }