add getter for stack, adjusted disply of vector for page direct with x/y

This commit is contained in:
nick-less 2018-12-17 14:32:04 +01:00
parent f18794b159
commit 3c36e71c04
3 changed files with 9 additions and 2 deletions

View File

@ -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);

View File

@ -59,6 +59,10 @@ Address Cpu65816::getProgramAddress() {
return mProgramAddress;
}
Stack *Cpu65816::getStack() {
return &mStack;
}
/**
* Resets the cpu to its initial state.

View File

@ -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: