1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-11-19 11:31:16 +00:00
r65emu/cpu.h
2014-11-19 19:35:16 +00:00

31 lines
634 B
C++

#ifndef __CPU_H__
#define __CPU_H__
#ifndef _SETJMP_H
#include <setjmp.h>
#endif
class CPU: public Checkpointable {
public:
virtual Memory::address run(unsigned instructions) =0;
virtual void reset () =0;
virtual Memory::address step() =0;
virtual void raise (int level) =0;
virtual char *status () =0;
typedef void (*statfn) (const char *, ...);
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