step_a/step_b -> step, that way the mmr1 is retained in the debuglogging

This commit is contained in:
folkert van heusden 2024-04-13 16:20:02 +02:00
parent 16e78b9417
commit dc357fbe09
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
4 changed files with 9 additions and 22 deletions

View file

@ -2251,7 +2251,7 @@ std::map<std::string, std::vector<std::string> > cpu::disassemble(const uint16_t
return out; return out;
} }
void cpu::step_a() void cpu::step()
{ {
it_is_a_trap = false; it_is_a_trap = false;
@ -2262,10 +2262,7 @@ void cpu::step_a()
if (!b->isMMR1Locked()) if (!b->isMMR1Locked())
b->clearMMR1(); b->clearMMR1();
} }
}
void cpu::step_b()
{
instruction_count++; instruction_count++;
try { try {

3
cpu.h
View file

@ -115,8 +115,7 @@ public:
void reset(); void reset();
void step_a(); void step();
void step_b();
void pushStack(const uint16_t v); void pushStack(const uint16_t v);
uint16_t popStack(); uint16_t popStack();

View file

@ -1030,10 +1030,8 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
bool reset_cpu = true; bool reset_cpu = true;
if (turbo) { if (turbo) {
while(*stop_event == EVENT_NONE) { while(*stop_event == EVENT_NONE)
c->step_a(); c->step();
c->step_b();
}
} }
else { else {
reset_cpu = false; reset_cpu = false;
@ -1042,8 +1040,6 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
if (!single_step) if (!single_step)
DOLOG(debug, false, "---"); DOLOG(debug, false, "---");
c->step_a();
if (trace_start_addr != -1 && c->getPC() == trace_start_addr) if (trace_start_addr != -1 && c->getPC() == trace_start_addr)
tracing = true; tracing = true;
@ -1055,7 +1051,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
break; break;
} }
c->step_b(); c->step();
if (single_step && --n_single_step == 0) if (single_step && --n_single_step == 0)
break; 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; *cnsl->get_running_flag() = true;
while(*stop_event == EVENT_NONE) { while(*stop_event == EVENT_NONE) {
c->step_a();
if (tracing) if (tracing)
disassemble(c, nullptr, c->getPC(), false); disassemble(c, nullptr, c->getPC(), false);
c->step_b(); c->step();
} }
*cnsl->get_running_flag() = false; *cnsl->get_running_flag() = false;

View file

@ -125,10 +125,9 @@ int run_cpu_validation(const std::string & filename)
b->setMMR0(json_integer_value(a_mmr0)); b->setMMR0(json_integer_value(a_mmr0));
} }
c->step_a();
disassemble(c, nullptr, start_pc, false); disassemble(c, nullptr, start_pc, false);
auto disas_data = c->disassemble(start_pc); auto disas_data = c->disassemble(start_pc);
c->step_b(); c->step();
uint16_t new_pc = c->getPC(); uint16_t new_pc = c->getPC();
@ -572,10 +571,8 @@ int main(int argc, char *argv[])
for(;;) { for(;;) {
*running = true; *running = true;
while(event == EVENT_NONE) { while(event == EVENT_NONE)
c->step_a(); c->step();
c->step_b();
}
*running = false; *running = false;