mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-14 06:29:58 +00:00
Correct problem in page boundary condition for M6502.
This commit is contained in:
parent
84a2d0f952
commit
e4fbeebfa7
@ -188,6 +188,7 @@ namespace EightBit {
|
||||
|
||||
void sta_AbsoluteX() noexcept;
|
||||
void sta_AbsoluteY() noexcept;
|
||||
void sta_IndirectIndexedY() noexcept;
|
||||
|
||||
uint8_t x = 0; // index register X
|
||||
uint8_t y = 0; // index register Y
|
||||
|
@ -266,7 +266,7 @@ int EightBit::MOS6502::execute() noexcept {
|
||||
case 0x8f: memoryWrite(Address_Absolute(), A() & X()); break; // *SAX (absolute)
|
||||
|
||||
case 0x90: branch(!carry()); break; // BCC (relative)
|
||||
case 0x91: memoryRead(Address_IndirectIndexedY().first); memoryWrite(A()); break; // STA (indirect indexed Y)
|
||||
case 0x91: sta_IndirectIndexedY(); break; // STA (indirect indexed Y)
|
||||
case 0x92: break;
|
||||
case 0x93: break;
|
||||
case 0x94: memoryWrite(Address_ZeroPageX(), Y()); break; // STY (zero page, X)
|
||||
@ -757,3 +757,9 @@ void EightBit::MOS6502::sta_AbsoluteY() noexcept {
|
||||
getBytePaged(page, address.low);
|
||||
memoryWrite(address, A());
|
||||
}
|
||||
|
||||
void EightBit::MOS6502::sta_IndirectIndexedY() noexcept {
|
||||
const auto [address, page] = Address_IndirectIndexedY();
|
||||
getBytePaged(page, address.low); // Possible fixup for page boundary crossing
|
||||
memoryWrite(address, A());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user