turbo-mode which is not that turbo

This commit is contained in:
folkert van heusden 2023-03-22 21:37:15 +01:00
parent 97ba6fd41b
commit 47c8bade13
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -141,6 +141,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
int32_t trace_start_addr = -1; int32_t trace_start_addr = -1;
bool tracing = tracing_in; bool tracing = tracing_in;
int n_single_step = 1; int n_single_step = 1;
bool turbo = false;
cpu *const c = b->getCpu(); 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") { else if (cmd == "startnet") {
start_network(cnsl); start_network(cnsl);
continue;
}
else if (cmd == "turbo") {
turbo = !turbo;
cnsl->put_string_lf(format("Turbo set to %s", turbo ? "ON" : "OFF"));
continue; continue;
} }
#endif #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("single/s - run 1 instruction (implicit 'disassemble' command)");
cnsl->put_string_lf("sbp/cbp/lbp - set/clear/list breakpoint(s)"); cnsl->put_string_lf("sbp/cbp/lbp - set/clear/list breakpoint(s)");
cnsl->put_string_lf("trace/t - toggle tracing"); 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("strace - start tracing from address - invoke without address to disable");
cnsl->put_string_lf("mmudump - dump MMU settings (PARs/PDRs)"); cnsl->put_string_lf("mmudump - dump MMU settings (PARs/PDRs)");
cnsl->put_string_lf("setpc - set PC to value"); cnsl->put_string_lf("setpc - set PC to value");
@ -404,6 +413,13 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
*cnsl->get_running_flag() = true; *cnsl->get_running_flag() = true;
if (turbo) {
while(*stop_event == EVENT_NONE) {
c->step_a();
c->step_b();
}
}
else {
while(*stop_event == EVENT_NONE) { while(*stop_event == EVENT_NONE) {
if (!single_step) if (!single_step)
DOLOG(debug, false, "---"); DOLOG(debug, false, "---");
@ -426,6 +442,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
if (single_step && --n_single_step == 0) if (single_step && --n_single_step == 0)
break; break;
} }
}
*cnsl->get_running_flag() = false; *cnsl->get_running_flag() = false;