From a4fd247e5c099c479c103c6ea31cb34f250771fa Mon Sep 17 00:00:00 2001 From: edmccard Date: Wed, 4 Apr 2012 15:50:11 -0400 Subject: [PATCH] PC increment fixes --- src/d6502/cmos.d | 2 +- src/d6502/nmosundoc.d | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d6502/cmos.d b/src/d6502/cmos.d index b6cd16a..0972594 100644 --- a/src/d6502/cmos.d +++ b/src/d6502/cmos.d @@ -225,7 +225,7 @@ class Cmos(bool strict, bool cumulative) : Cpu!(strict, cumulative) void opcode5C() { readByteOperand(); - peek(programCounter); + peek(programCounter++); peek(0xFF00 | operand1); peek(0xFFFF); peek(0xFFFF); diff --git a/src/d6502/nmosundoc.d b/src/d6502/nmosundoc.d index 3cff407..9c78d3a 100644 --- a/src/d6502/nmosundoc.d +++ b/src/d6502/nmosundoc.d @@ -263,7 +263,7 @@ class NmosUndoc(bool strict, bool cumulative) : NmosBase!(strict, cumulative) override void opcode8B() { // unstable - readVal = operand1 = readFinal(programCounter); + readVal = operand1 = readFinal(programCounter++); version(Atari8Bit) { @@ -350,7 +350,7 @@ class NmosUndoc(bool strict, bool cumulative) : NmosBase!(strict, cumulative) /* SBX #$$ */ override void opcodeCB() { - readVal = operand1 = readFinal(programCounter); + readVal = operand1 = readFinal(programCounter++); xIndex &= accumulator; flag.zero_ = flag.negative_ = compare(xIndex, readVal); } @@ -358,7 +358,7 @@ class NmosUndoc(bool strict, bool cumulative) : NmosBase!(strict, cumulative) /* SBC #$$ */ override void opcodeEB() { - readVal = operand1 = readFinal(programCounter); + readVal = operand1 = readFinal(programCounter++); if (flag.decimal) dec_subWithCarry(readVal); else hex_subWithCarry(readVal); }