diff --git a/src/Addressing.cpp b/src/Addressing.cpp index a65ce54..c788e37 100644 --- a/src/Addressing.cpp +++ b/src/Addressing.cpp @@ -183,6 +183,9 @@ Address Cpu65816::getAddressOfOpCodeData(OpCode &opCode) { break; case AddressingMode::DirectPageIndirectIndexedWithY: { + + Log::vrb(LOG_TAG).str("DirectPageIndirectIndexedWithY").hex( mSystemBus.readByte(mProgramAddress.newWithOffset(1))).show(); + Address firstStageAddress(0x00, mD + mSystemBus.readByte(mProgramAddress.newWithOffset(1))); uint16_t secondStageOffset = mSystemBus.readTwoBytes(firstStageAddress); Address thirdStageAddress(mDB, secondStageOffset); diff --git a/src/Cpu65816.cpp b/src/Cpu65816.cpp index 8dea231..1972ab4 100644 --- a/src/Cpu65816.cpp +++ b/src/Cpu65816.cpp @@ -59,6 +59,10 @@ Address Cpu65816::getProgramAddress() { return mProgramAddress; } +Stack *Cpu65816::getStack() { + return &mStack; +} + /** * Resets the cpu to its initial state. diff --git a/src/Cpu65816Debugger.cpp b/src/Cpu65816Debugger.cpp index 9872d73..cadb5f3 100644 --- a/src/Cpu65816Debugger.cpp +++ b/src/Cpu65816Debugger.cpp @@ -157,11 +157,11 @@ void Cpu65816Debugger::logOpCode(OpCode &opCode) const { log.str(" [Direct Page Indirect Long]"); break; case AddressingMode::DirectPageIndexedIndirectWithX: - log.str("(").hex(mCpu.mSystemBus.readByte(mCpu.getAddressOfOpCodeData(opCode)), 2).str(", X)").sp(); + log.str("(").hex(mCpu.mSystemBus.readByte(mCpu.mProgramAddress.newWithOffset(1)), 2).str(", X)").sp(); log.str(" [Direct Page Indexed Indirect, X]"); break; case AddressingMode::DirectPageIndirectIndexedWithY: - log.str("(").hex(mCpu.mSystemBus.readByte(mCpu.getAddressOfOpCodeData(opCode)), 2).str("), Y").sp(); + log.str("(").hex(mCpu.mSystemBus.readByte(mCpu.mProgramAddress.newWithOffset(1)), 2).str("), Y").sp(); log.str(" [Direct Page Indirect Indexed, Y]"); break; case AddressingMode::DirectPageIndirectLongIndexedWithY: