From 47c8bade13305c6d25ceab0b5758e200f195f4d0 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Wed, 22 Mar 2023 21:37:15 +0100 Subject: [PATCH] turbo-mode which is not that turbo --- debugger.cpp | 53 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/debugger.cpp b/debugger.cpp index 9b02f40..40e081a 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -141,6 +141,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto int32_t trace_start_addr = -1; bool tracing = tracing_in; int n_single_step = 1; + bool turbo = false; cpu *const c = b->getCpu(); @@ -362,6 +363,13 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto else if (cmd == "startnet") { start_network(cnsl); + continue; + } + else if (cmd == "turbo") { + turbo = !turbo; + + cnsl->put_string_lf(format("Turbo set to %s", turbo ? "ON" : "OFF")); + continue; } #endif @@ -382,6 +390,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto cnsl->put_string_lf("single/s - run 1 instruction (implicit 'disassemble' command)"); cnsl->put_string_lf("sbp/cbp/lbp - set/clear/list breakpoint(s)"); cnsl->put_string_lf("trace/t - toggle tracing"); + cnsl->put_string_lf("turbo - toggle turbo mode (cannot be interrupted)"); cnsl->put_string_lf("strace - start tracing from address - invoke without address to disable"); cnsl->put_string_lf("mmudump - dump MMU settings (PARs/PDRs)"); cnsl->put_string_lf("setpc - set PC to value"); @@ -404,27 +413,35 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto *cnsl->get_running_flag() = true; - while(*stop_event == EVENT_NONE) { - if (!single_step) - DOLOG(debug, false, "---"); - - c->step_a(); - - if (trace_start_addr != -1 && c->getPC() == trace_start_addr) - tracing = true; - - if (tracing || single_step) - disassemble(c, single_step ? cnsl : nullptr, c->getPC(), false); - - if (c->check_breakpoint() && !single_step) { - cnsl->put_string_lf("Breakpoint"); - break; + if (turbo) { + while(*stop_event == EVENT_NONE) { + c->step_a(); + c->step_b(); } + } + else { + while(*stop_event == EVENT_NONE) { + if (!single_step) + DOLOG(debug, false, "---"); - c->step_b(); + c->step_a(); - if (single_step && --n_single_step == 0) - break; + if (trace_start_addr != -1 && c->getPC() == trace_start_addr) + tracing = true; + + if (tracing || single_step) + disassemble(c, single_step ? cnsl : nullptr, c->getPC(), false); + + if (c->check_breakpoint() && !single_step) { + cnsl->put_string_lf("Breakpoint"); + break; + } + + c->step_b(); + + if (single_step && --n_single_step == 0) + break; + } } *cnsl->get_running_flag() = false;