commit | dbbd540c423f68503077af391df2ac721e38e31c | [log] [tgz] |
---|---|---|
author | swissChili <swisschili@fastmail.com> | Fri Aug 07 15:07:39 2020 -0700 |
committer | swissChili <swisschili@fastmail.com> | Fri Aug 07 15:07:39 2020 -0700 |
tree | c5ff6bc2f5d862ba75f53106571404525091beaa | |
parent | da4803e3a8782aef3a768be73271e5739a981d80 [diff] [blame] |
Added basic GUI, debugger and register view
diff --git a/cpu.c b/cpu.c index 5a7c391..cd2b253 100644 --- a/cpu.c +++ b/cpu.c
@@ -13,6 +13,13 @@ #define warn(m, ...) \ printf("\033[33m" m "\033[0m\n", ##__VA_ARGS__); +void reset(cpu_t *cpu) +{ + cpu->regs[SP] = 0xFD; // stack at is 0x100 + SP + cpu->pc = 0; // arbitrary program counter start + cpu->running = true; +} + cpu_t new_cpu() { cpu_t cpu = { 0 };