diff --git a/src/rk65c02.c b/src/rk65c02.c index 4960e43..2a766a8 100644 --- a/src/rk65c02.c +++ b/src/rk65c02.c @@ -32,6 +32,7 @@ rk65c02_init(bus_t *b) e.bps_head = NULL; e.trace_head = NULL; + e.runtime_disassembly = false; return e; } @@ -103,8 +104,8 @@ rk65c02_exec(rk65c02emu_t *e) return; } - /* if disassembly-when-running enabled */ - disassemble(e->bus, e->regs.PC); + if (e->runtime_disassembly) + disassemble(e->bus, e->regs.PC); i = instruction_fetch(e->bus, e->regs.PC); id = instruction_decode(i.opcode); diff --git a/src/rk65c02.h b/src/rk65c02.h index d5b4479..53df0ec 100644 --- a/src/rk65c02.h +++ b/src/rk65c02.h @@ -69,7 +69,7 @@ struct rk65c02emu { bool irq; /* interrupt request line state, true is asserted */ breakpoint_t *bps_head; /* pointer to linked list with breakpoints */ - + bool runtime_disassembly; /* disassemble code when emulator is running */ bool trace; /* tracing mode enable/disable */ trace_t *trace_head; /* pointer to linked list with trace log */ };