This commit is contained in:
Stephen Crane 2016-01-23 21:15:44 +00:00
parent 728e1e4058
commit b963514111
2 changed files with 4 additions and 17 deletions

View File

@ -1,6 +1,7 @@
PROCESSOR_FAMILY := lm4f PROCESSOR_FAMILY := lm4f
BOARD := lplm4f120h5qr BOARD := lplm4f120h5qr
# watch the CPU execute # watch the CPU execute
LOCAL_CPPFLAGS := -DCPU_DEBUG #LOCAL_CPPFLAGS := -DCPU_DEBUG
CXXFLAGS := -fno-operator-names
include energia.mk include energia.mk

View File

@ -23,19 +23,7 @@ prom m(monitor, sizeof(monitor));
ram pages[RAM_SIZE / 1024]; ram pages[RAM_SIZE / 1024];
io io; io io;
void status(const char *fmt, ...) { r6502 cpu(memory);
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;
const char *filename; const char *filename;
void reset() { void reset() {
@ -46,8 +34,6 @@ void reset() {
io.tape.start(PROGRAMS); io.tape.start(PROGRAMS);
else else
io.status("No SD Card"); io.status("No SD Card");
halted = (setjmp(ex) != 0);
} }
void setup() { void setup() {
@ -105,6 +91,6 @@ void loop() {
io.up(key); io.up(key);
break; break;
} }
} else if (!halted) } else if (!cpu.halted())
cpu.run(CPU_INSTRUCTIONS); cpu.run(CPU_INSTRUCTIONS);
} }