mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-19 23:29:05 +00:00
Corrects (zero) behaviour.
This commit is contained in:
parent
95164b79c9
commit
8b50ab2593
@ -429,6 +429,9 @@ if(number_of_cycles <= Cycles(0)) break;
|
|||||||
operand_ += x_;
|
operand_ += x_;
|
||||||
read_mem(address_.bytes.low, operand_);
|
read_mem(address_.bytes.low, operand_);
|
||||||
break;
|
break;
|
||||||
|
case CycleFetchAddressLowFromOperand:
|
||||||
|
read_mem(address_.bytes.low, operand_);
|
||||||
|
break;
|
||||||
case CycleIncrementOperandFetchAddressHigh:
|
case CycleIncrementOperandFetchAddressHigh:
|
||||||
operand_++;
|
operand_++;
|
||||||
read_mem(address_.bytes.high, operand_);
|
read_mem(address_.bytes.high, operand_);
|
||||||
|
@ -22,14 +22,14 @@ using namespace CPU::MOS6502;
|
|||||||
#define Zero OperationLoadAddressZeroPage
|
#define Zero OperationLoadAddressZeroPage
|
||||||
#define ZeroX CycleLoadAddessZeroX
|
#define ZeroX CycleLoadAddessZeroX
|
||||||
#define ZeroY CycleLoadAddessZeroY
|
#define ZeroY CycleLoadAddessZeroY
|
||||||
#define ZeroIndirect OperationLoadAddressZeroPage, CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh
|
#define ZeroIndirect OperationLoadAddressZeroPage, CycleFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh
|
||||||
#define IndexedIndirect CycleIncrementPCFetchAddressLowFromOperand, CycleAddXToOperandFetchAddressLow, CycleIncrementOperandFetchAddressHigh
|
#define IndexedIndirect CycleIncrementPCFetchAddressLowFromOperand, CycleAddXToOperandFetchAddressLow, CycleIncrementOperandFetchAddressHigh
|
||||||
#define IndirectIndexedr CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh, CycleAddYToAddressLow, OperationCorrectAddressHigh
|
#define IndirectIndexedr CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh, CycleAddYToAddressLow, OperationCorrectAddressHigh
|
||||||
#define IndirectIndexed CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh, CycleAddYToAddressLowRead, OperationCorrectAddressHigh
|
#define IndirectIndexed CycleIncrementPCFetchAddressLowFromOperand, CycleIncrementOperandFetchAddressHigh, CycleAddYToAddressLowRead, OperationCorrectAddressHigh
|
||||||
|
|
||||||
#define Read(...) CycleFetchOperandFromAddress, __VA_ARGS__
|
#define Read(...) CycleFetchOperandFromAddress, __VA_ARGS__
|
||||||
#define Write(...) __VA_ARGS__, CycleWriteOperandToAddress
|
#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 AbsoluteRead(op) Program(Absolute, Read(op))
|
||||||
#define AbsoluteXRead(op) Program(AbsoluteXr, Read(op))
|
#define AbsoluteXRead(op) Program(AbsoluteXr, Read(op))
|
||||||
@ -282,9 +282,9 @@ ProcessorStorage::ProcessorStorage(Personality personality) {
|
|||||||
Install(0x32, ZeroIndirectRead(OperationAND));
|
Install(0x32, ZeroIndirectRead(OperationAND));
|
||||||
Install(0x52, ZeroIndirectRead(OperationEOR));
|
Install(0x52, ZeroIndirectRead(OperationEOR));
|
||||||
Install(0x72, ZeroIndirectRead(OperationADC));
|
Install(0x72, ZeroIndirectRead(OperationADC));
|
||||||
Install(0x92, ZeroIndirectRead(OperationSTA));
|
Install(0x92, ZeroIndirectWrite(OperationSTA));
|
||||||
Install(0xb2, ZeroIndirectRead(OperationLDA));
|
Install(0xb2, ZeroIndirectRead(OperationLDA));
|
||||||
Install(0xd2, ZeroIndirectWrite(OperationCMP));
|
Install(0xd2, ZeroIndirectRead(OperationCMP));
|
||||||
Install(0xd2, ZeroIndirectRead(OperationSBC));
|
Install(0xd2, ZeroIndirectRead(OperationSBC));
|
||||||
}
|
}
|
||||||
#undef Install
|
#undef Install
|
||||||
|
@ -45,6 +45,7 @@ class ProcessorStorage {
|
|||||||
OperationMoveToNextProgram, OperationIncrementPC,
|
OperationMoveToNextProgram, OperationIncrementPC,
|
||||||
CycleFetchOperandFromAddress, CycleWriteOperandToAddress, OperationCopyOperandFromA, OperationCopyOperandToA,
|
CycleFetchOperandFromAddress, CycleWriteOperandToAddress, OperationCopyOperandFromA, OperationCopyOperandToA,
|
||||||
CycleIncrementPCFetchAddressLowFromOperand, CycleAddXToOperandFetchAddressLow, CycleIncrementOperandFetchAddressHigh, OperationDecrementOperand,
|
CycleIncrementPCFetchAddressLowFromOperand, CycleAddXToOperandFetchAddressLow, CycleIncrementOperandFetchAddressHigh, OperationDecrementOperand,
|
||||||
|
CycleFetchAddressLowFromOperand,
|
||||||
OperationIncrementOperand, OperationORA, OperationAND, OperationEOR,
|
OperationIncrementOperand, OperationORA, OperationAND, OperationEOR,
|
||||||
OperationINS, OperationADC, OperationSBC, OperationLDA,
|
OperationINS, OperationADC, OperationSBC, OperationLDA,
|
||||||
OperationLDX, OperationLDY, OperationLAX, OperationSTA,
|
OperationLDX, OperationLDY, OperationLAX, OperationSTA,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user