From 50110b3525d2168e4320664337d3010a7f97bee4 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Wed, 10 Dec 2014 12:02:47 +0000 Subject: [PATCH] ... --- cpu.h | 4 ++-- i8080.cpp | 4 ++-- i8080.h | 2 +- r6502.cpp | 10 +++++----- r6502.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cpu.h b/cpu.h index 40f52b7..44b03b8 100644 --- a/cpu.h +++ b/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; }; diff --git a/i8080.cpp b/i8080.cpp index 42d7d14..6eb4c46 100644 --- a/i8080.cpp +++ b/i8080.cpp @@ -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; diff --git a/i8080.h b/i8080.h index 5ab4be9..63de916 100644 --- a/i8080.h +++ b/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(); diff --git a/r6502.cpp b/r6502.cpp index 5e31d84..e2aae93 100644 --- a/r6502.cpp +++ b/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); diff --git a/r6502.h b/r6502.h index 722f59e..19dfd0e 100644 --- a/r6502.h +++ b/r6502.h @@ -13,7 +13,7 @@ public: void checkpoint(Stream &); void restore(Stream &); - r6502 (Memory &, jmp_buf *, CPU::statfn); + r6502 (Memory &, jmp_buf &, CPU::statfn); private: /* registers */ Memory::address PC;