diff --git a/cpu.cpp b/cpu.cpp index 8471fe7..d32b6ea 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -2251,7 +2251,7 @@ std::map > cpu::disassemble(const uint16_t return out; } -void cpu::step_a() +void cpu::step() { it_is_a_trap = false; @@ -2262,10 +2262,7 @@ void cpu::step_a() if (!b->isMMR1Locked()) b->clearMMR1(); } -} -void cpu::step_b() -{ instruction_count++; try { diff --git a/cpu.h b/cpu.h index 697661a..bca20dc 100644 --- a/cpu.h +++ b/cpu.h @@ -115,8 +115,7 @@ public: void reset(); - void step_a(); - void step_b(); + void step(); void pushStack(const uint16_t v); uint16_t popStack(); diff --git a/debugger.cpp b/debugger.cpp index 7fb1be9..617c277 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -1030,10 +1030,8 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto bool reset_cpu = true; if (turbo) { - while(*stop_event == EVENT_NONE) { - c->step_a(); - c->step_b(); - } + while(*stop_event == EVENT_NONE) + c->step(); } else { reset_cpu = false; @@ -1042,8 +1040,6 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto if (!single_step) DOLOG(debug, false, "---"); - c->step_a(); - if (trace_start_addr != -1 && c->getPC() == trace_start_addr) tracing = true; @@ -1055,7 +1051,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto break; } - c->step_b(); + c->step(); if (single_step && --n_single_step == 0) break; @@ -1088,12 +1084,10 @@ void run_bic(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop *cnsl->get_running_flag() = true; while(*stop_event == EVENT_NONE) { - c->step_a(); - if (tracing) disassemble(c, nullptr, c->getPC(), false); - c->step_b(); + c->step(); } *cnsl->get_running_flag() = false; diff --git a/main.cpp b/main.cpp index 674b4d9..93ce0a4 100644 --- a/main.cpp +++ b/main.cpp @@ -125,10 +125,9 @@ int run_cpu_validation(const std::string & filename) b->setMMR0(json_integer_value(a_mmr0)); } - c->step_a(); disassemble(c, nullptr, start_pc, false); auto disas_data = c->disassemble(start_pc); - c->step_b(); + c->step(); uint16_t new_pc = c->getPC(); @@ -572,10 +571,8 @@ int main(int argc, char *argv[]) for(;;) { *running = true; - while(event == EVENT_NONE) { - c->step_a(); - c->step_b(); - } + while(event == EVENT_NONE) + c->step(); *running = false;