From caf0f3b0287bc6197eb5ddd8db4626762daccec2 Mon Sep 17 00:00:00 2001 From: Daniel Loffgren Date: Sat, 26 Sep 2015 23:30:03 +0000 Subject: [PATCH] Automatically load debugger script named apple1.dbg if it exists git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@63 64f78de7-aa59-e511-a0e8-0002a5492df0 --- apple1/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apple1/main.c b/apple1/main.c index 157bcc4..c42f1ce 100644 --- a/apple1/main.c +++ b/apple1/main.c @@ -88,6 +88,15 @@ int main(int argc, const char * argv[]) v6502_loadFileAtAddress(cpu->memory, "apple1.rom", RESET_VECTOR); //v6502_map(cpu->memory, start, ROM_SIZE, romMirrorCallback, NULL, NULL); + // Load debugger script + int verbose = 0; + FILE *file = fopen("apple1.dbg", "r"); + if (file) { + printf("Loading debugger script...\n"); + v6502_runDebuggerScript(cpu, file, breakpoint_list, table, run, &verbose); + fclose(file); + } + // Attach PIA printf("Initializing PIA...\n"); pia = pia_create(cpu->memory); @@ -98,7 +107,6 @@ int main(int argc, const char * argv[]) printf("Running...\n"); run(cpu); - int verbose = 0; int commandLen; HistEvent ev; History *hist = history_init();