PC increment fixes

This commit is contained in:
edmccard 2012-04-04 15:50:11 -04:00
parent 1b9312ac97
commit a4fd247e5c
2 changed files with 4 additions and 4 deletions

View File

@ -225,7 +225,7 @@ class Cmos(bool strict, bool cumulative) : Cpu!(strict, cumulative)
void opcode5C() void opcode5C()
{ {
readByteOperand(); readByteOperand();
peek(programCounter); peek(programCounter++);
peek(0xFF00 | operand1); peek(0xFF00 | operand1);
peek(0xFFFF); peek(0xFFFF);
peek(0xFFFF); peek(0xFFFF);

View File

@ -263,7 +263,7 @@ class NmosUndoc(bool strict, bool cumulative) : NmosBase!(strict, cumulative)
override void opcode8B() override void opcode8B()
{ {
// unstable // unstable
readVal = operand1 = readFinal(programCounter); readVal = operand1 = readFinal(programCounter++);
version(Atari8Bit) version(Atari8Bit)
{ {
@ -350,7 +350,7 @@ class NmosUndoc(bool strict, bool cumulative) : NmosBase!(strict, cumulative)
/* SBX #$$ */ /* SBX #$$ */
override void opcodeCB() override void opcodeCB()
{ {
readVal = operand1 = readFinal(programCounter); readVal = operand1 = readFinal(programCounter++);
xIndex &= accumulator; xIndex &= accumulator;
flag.zero_ = flag.negative_ = compare(xIndex, readVal); flag.zero_ = flag.negative_ = compare(xIndex, readVal);
} }
@ -358,7 +358,7 @@ class NmosUndoc(bool strict, bool cumulative) : NmosBase!(strict, cumulative)
/* SBC #$$ */ /* SBC #$$ */
override void opcodeEB() override void opcodeEB()
{ {
readVal = operand1 = readFinal(programCounter); readVal = operand1 = readFinal(programCounter++);
if (flag.decimal) dec_subWithCarry(readVal); if (flag.decimal) dec_subWithCarry(readVal);
else hex_subWithCarry(readVal); else hex_subWithCarry(readVal);
} }