mirror of
https://github.com/jscrane/r65emu.git
synced 2024-06-01 07:41:57 +00:00
add step for debugging
This commit is contained in:
parent
43c7aece2f
commit
93403d5a8e
3
cpu.h
3
cpu.h
|
@ -7,8 +7,9 @@
|
|||
|
||||
class CPU: public Checkpointable {
|
||||
public:
|
||||
virtual Memory::address run(unsigned instructions) =0;
|
||||
virtual void reset () =0;
|
||||
virtual Memory::address run (unsigned instructions) =0;
|
||||
virtual Memory::address step() =0;
|
||||
virtual void raise (int level) =0;
|
||||
virtual char *status () =0;
|
||||
|
||||
|
|
15
r6502.cpp
15
r6502.cpp
|
@ -5,9 +5,7 @@
|
|||
#include "cpu.h"
|
||||
#include "r6502.h"
|
||||
|
||||
Memory::address r6502::run (unsigned clocks) {
|
||||
while (clocks--)
|
||||
{
|
||||
Memory::address r6502::step() {
|
||||
byte op = (*_memory)[PC];
|
||||
#ifdef CPU_DEBUG
|
||||
if (_debug)
|
||||
|
@ -15,7 +13,16 @@ Memory::address r6502::run (unsigned clocks) {
|
|||
#endif
|
||||
PC++;
|
||||
(this->*_ops[op])();
|
||||
}
|
||||
return PC;
|
||||
}
|
||||
|
||||
Memory::address r6502::run(unsigned clocks) {
|
||||
#ifdef CPU_DEBUG
|
||||
if (_debug)
|
||||
return step();
|
||||
#endif
|
||||
while (clocks--)
|
||||
step();
|
||||
return PC;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user