mirror of
https://github.com/jscrane/r65emu.git
synced 2025-01-10 03:29:30 +00:00
...
This commit is contained in:
parent
fab9afb6b9
commit
50110b3525
4
cpu.h
4
cpu.h
@ -20,9 +20,9 @@ public:
|
||||
void debug() { _debug = !_debug; }
|
||||
|
||||
protected:
|
||||
CPU (Memory &mem, jmp_buf *e, statfn s): _mem(mem), _err(e), _status(s){}
|
||||
CPU (Memory &mem, jmp_buf &e, statfn s): _mem(mem), _err(e), _status(s), _debug(false) {}
|
||||
Memory &_mem;
|
||||
jmp_buf *_err;
|
||||
jmp_buf &_err;
|
||||
statfn _status;
|
||||
bool _debug;
|
||||
};
|
||||
|
@ -95,7 +95,7 @@ void i8080::daa() {
|
||||
|
||||
void i8080::hlt() {
|
||||
_status("CPU halted at %04x\r%s", (PC-1), status());
|
||||
longjmp(*_err, 1);
|
||||
longjmp(_err, 1);
|
||||
}
|
||||
|
||||
int i8080::parity_table[] = {
|
||||
@ -117,7 +117,7 @@ int i8080::parity_table[] = {
|
||||
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
|
||||
};
|
||||
|
||||
i8080::i8080(Memory &m, jmp_buf *jb, CPU::statfn s, Ports &d): CPU(m, jb, s)
|
||||
i8080::i8080(Memory &m, jmp_buf &jb, CPU::statfn s, Ports &d): CPU(m, jb, s)
|
||||
{
|
||||
_ports = &d;
|
||||
|
||||
|
2
i8080.h
2
i8080.h
@ -13,7 +13,7 @@ public:
|
||||
virtual byte in(byte p, i8080 *cpu) =0;
|
||||
};
|
||||
|
||||
i8080(Memory &, jmp_buf *, CPU::statfn, Ports &);
|
||||
i8080(Memory &, jmp_buf &, CPU::statfn, Ports &);
|
||||
|
||||
void run(unsigned);
|
||||
void reset();
|
||||
|
10
r6502.cpp
10
r6502.cpp
@ -184,12 +184,12 @@ void r6502::sbcd (byte d) {
|
||||
// V not tested for: http://www.6502.org/tutorials/decimal_mode.html
|
||||
}
|
||||
|
||||
void r6502::ill () {
|
||||
_status ("Illegal instruction at %04x!\r\n%s", (PC-1), status());
|
||||
longjmp (*_err, 1);
|
||||
void r6502::ill() {
|
||||
_status("Illegal instruction at %04x!\r\n%s", (PC-1), status());
|
||||
longjmp(_err, 1);
|
||||
}
|
||||
|
||||
void r6502::reset ()
|
||||
void r6502::reset()
|
||||
{
|
||||
_debug = false;
|
||||
P.value = 0;
|
||||
@ -200,7 +200,7 @@ void r6502::reset ()
|
||||
PC = vector(resvec);
|
||||
}
|
||||
|
||||
r6502::r6502 (Memory &m, jmp_buf *e, CPU::statfn s): CPU (m,e,s) {
|
||||
r6502::r6502 (Memory &m, jmp_buf &e, CPU::statfn s): CPU (m,e,s) {
|
||||
|
||||
for (int i=0; i < 256; i++) {
|
||||
_fromBCD[i] = ((i >> 4) & 0x0f)*10 + (i & 0x0f);
|
||||
|
Loading…
x
Reference in New Issue
Block a user