From 7ad0ad8024875705fa1c1378b2d5f8d40641253a Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sun, 25 Feb 2018 16:12:15 -0600 Subject: [PATCH] Unbreak current PC in resume; use addr2 in writestate (Addr1 never worked, so ws was essentially non-functional in practice, but it passes its tests when you assume execute() does the right thing!) --- src/vm_debug.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/vm_debug.c b/src/vm_debug.c index 339c9ed..ab1f0a6 100644 --- a/src/vm_debug.c +++ b/src/vm_debug.c @@ -257,6 +257,12 @@ DEBUG_CMD(help) DEBUG_CMD(resume) { + mos6502 *cpu = (mos6502 *)vm_di_get(VM_CPU); + + // If we paused because of a breakpoint, then we need to clear it + // before we can really keep moving. + vm_debug_unbreak(cpu->PC); + vm_reflect_pause(NULL); } @@ -296,11 +302,11 @@ DEBUG_CMD(writestate) mos6502 *cpu = (mos6502 *)vm_di_get(VM_CPU); switch (tolower(*args->target)) { - case 'a': cpu->A = args->addr1; break; - case 'p': cpu->P = args->addr1; break; - case 's': cpu->S = args->addr1; break; - case 'x': cpu->X = args->addr1; break; - case 'y': cpu->Y = args->addr1; break; + case 'a': cpu->A = args->addr2; break; + case 'p': cpu->P = args->addr2; break; + case 's': cpu->S = args->addr2; break; + case 'x': cpu->X = args->addr2; break; + case 'y': cpu->Y = args->addr2; break; } }