diff --git a/src/meta/debug.h b/src/meta/debug.h index a1937ebc..663c4881 100644 --- a/src/meta/debug.h +++ b/src/meta/debug.h @@ -32,6 +32,7 @@ typedef enum { FINISHING, UNTILING, TYPING, + LOADING, GOING } stepping_type_t; diff --git a/src/meta/debug.l b/src/meta/debug.l index 6178f183..8d80373a 100644 --- a/src/meta/debug.l +++ b/src/meta/debug.l @@ -819,21 +819,29 @@ ADDRS [0-9a-fA-F]+ } LOG("Typing..."); + int ch = -1; while (fgets(buf, DEBUG_BUFSZ, fp)) { LOG(buf); stepping_struct_t s = { - .step_type = TYPING, + .step_type = LOADING, .step_text = buf }; - int ch = debugger_go(s); + ch = debugger_go(s); if (ch != -1) { break; } } - fclose(fp); + + if (ch == -1) { + stepping_struct_t s = { + .step_type = GOING, + }; + debugger_go(s); + } + return LOAD; } diff --git a/src/meta/debugger.c b/src/meta/debugger.c index d8012419..0c0898a6 100644 --- a/src/meta/debugger.c +++ b/src/meta/debugger.c @@ -1155,8 +1155,7 @@ static int begin_cpu_stepping() { break; } #endif - - if (idx > textlen) { + if ( (stepping_struct.step_type != TYPING) && (idx > textlen) ) { break; // finished typing } if (stepping_timeout && (stepping_struct.timeout < time(NULL))) { @@ -1246,6 +1245,7 @@ bool c_debugger_should_break() { case GOING: case TYPING: + case LOADING: break; } } @@ -1262,8 +1262,8 @@ int debugger_go(stepping_struct_t s) { int ch = begin_cpu_stepping(); #if !defined(TESTING) - clear_debugger_screen(); - if (stepping_struct.step_type != TYPING) { + if (stepping_struct.step_type != LOADING) { + clear_debugger_screen(); disasm(cpu65_current.pc, 1, 0, -1); int branch = will_branch(); if (branch != BRANCH_NA) {