1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Corrects (zero) behaviour.

This commit is contained in:
Thomas Harte 2018-08-10 21:12:55 -04:00
parent 95164b79c9
commit 8b50ab2593
3 changed files with 8 additions and 4 deletions

View File

@ -429,6 +429,9 @@ if(number_of_cycles <= Cycles(0)) break;
operand_ += x_;
read_mem(address_.bytes.low, operand_);
break;
case CycleFetchAddressLowFromOperand:
read_mem(address_.bytes.low, operand_);
break;
case CycleIncrementOperandFetchAddressHigh:
operand_++;
read_mem(address_.bytes.high, operand_);

View File

@ -22,14 +22,14 @@ using namespace CPU::MOS6502;
#define Zero OperationLoadAddressZeroPage
#define ZeroX CycleLoadAddessZeroX
#define ZeroY CycleLoadAddessZeroY
#define ZeroIndirect OperationLoadAddressZeroPage, CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh
#define ZeroIndirect OperationLoadAddressZeroPage, CycleFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh
#define IndexedIndirect CycleIncrementPCFetchAddressLowFromOperand, CycleAddXToOperandFetchAddressLow, CycleIncrementOperandFetchAddressHigh
#define IndirectIndexedr CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh, CycleAddYToAddressLow, OperationCorrectAddressHigh
#define IndirectIndexed CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh, CycleAddYToAddressLowRead, OperationCorrectAddressHigh
#define Read(...) CycleFetchOperandFromAddress, __VA_ARGS__
#define Write(...) __VA_ARGS__, CycleWriteOperandToAddress
#define ReadModifyWrite(...) CycleFetchOperandFromAddress, CycleWriteOperandToAddress, __VA_ARGS__, CycleWriteOperandToAddress
#define ReadModifyWrite(...) CycleFetchOperandFromAddress, (personality == P6502) ? CycleWriteOperandToAddress : CycleFetchOperandFromAddress, __VA_ARGS__, CycleWriteOperandToAddress
#define AbsoluteRead(op) Program(Absolute, Read(op))
#define AbsoluteXRead(op) Program(AbsoluteXr, Read(op))
@ -282,9 +282,9 @@ ProcessorStorage::ProcessorStorage(Personality personality) {
Install(0x32, ZeroIndirectRead(OperationAND));
Install(0x52, ZeroIndirectRead(OperationEOR));
Install(0x72, ZeroIndirectRead(OperationADC));
Install(0x92, ZeroIndirectRead(OperationSTA));
Install(0x92, ZeroIndirectWrite(OperationSTA));
Install(0xb2, ZeroIndirectRead(OperationLDA));
Install(0xd2, ZeroIndirectWrite(OperationCMP));
Install(0xd2, ZeroIndirectRead(OperationCMP));
Install(0xd2, ZeroIndirectRead(OperationSBC));
}
#undef Install

View File

@ -45,6 +45,7 @@ class ProcessorStorage {
OperationMoveToNextProgram, OperationIncrementPC,
CycleFetchOperandFromAddress, CycleWriteOperandToAddress, OperationCopyOperandFromA, OperationCopyOperandToA,
CycleIncrementPCFetchAddressLowFromOperand, CycleAddXToOperandFetchAddressLow, CycleIncrementOperandFetchAddressHigh, OperationDecrementOperand,
CycleFetchAddressLowFromOperand,
OperationIncrementOperand, OperationORA, OperationAND, OperationEOR,
OperationINS, OperationADC, OperationSBC, OperationLDA,
OperationLDX, OperationLDY, OperationLAX, OperationSTA,