mirror of
https://github.com/jscrane/r65emu.git
synced 2024-12-21 12:29:51 +00:00
enable dynamic debugging
This commit is contained in:
parent
867760ffd0
commit
3337dd8646
3
cpu.h
3
cpu.h
@ -20,10 +20,13 @@ public:
|
||||
virtual void checkpoint(Stream &s) = 0;
|
||||
virtual void restore(Stream &s) = 0;
|
||||
|
||||
void debug() { _debug = !_debug; }
|
||||
|
||||
protected:
|
||||
CPU (Memory *m, jmp_buf *e, statfn s): _memory(m), _err(e), _status(s){}
|
||||
Memory *_memory;
|
||||
jmp_buf *_err;
|
||||
statfn _status;
|
||||
bool _debug;
|
||||
};
|
||||
#endif
|
||||
|
@ -10,6 +10,7 @@ Memory::address r6502::run (unsigned clocks) {
|
||||
{
|
||||
byte op = (*_memory)[PC];
|
||||
#ifdef CPU_DEBUG
|
||||
if (_debug)
|
||||
_status ("%04x: %02x [%02x %02x %02x, %02x]\r", PC, op, A, X, Y, flags());
|
||||
#endif
|
||||
PC++;
|
||||
@ -180,6 +181,7 @@ void r6502::ill () {
|
||||
|
||||
void r6502::reset ()
|
||||
{
|
||||
_debug = false;
|
||||
P.value = 0;
|
||||
P.bits._ = 1;
|
||||
P.bits.B = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user