turbo-mode which is not that turbo
This commit is contained in:
parent
97ba6fd41b
commit
47c8bade13
1 changed files with 35 additions and 18 deletions
53
debugger.cpp
53
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;
|
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,27 +413,35 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
||||||
|
|
||||||
*cnsl->get_running_flag() = true;
|
*cnsl->get_running_flag() = true;
|
||||||
|
|
||||||
while(*stop_event == EVENT_NONE) {
|
if (turbo) {
|
||||||
if (!single_step)
|
while(*stop_event == EVENT_NONE) {
|
||||||
DOLOG(debug, false, "---");
|
c->step_a();
|
||||||
|
c->step_b();
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
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)
|
if (trace_start_addr != -1 && c->getPC() == trace_start_addr)
|
||||||
break;
|
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;
|
*cnsl->get_running_flag() = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue