1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-01 13:58:20 +00:00

Applies indirect page zero emulation mode addressing constraint to ix addressing.

Lorenz's LDA tests now pass in emulation mode.
This commit is contained in:
Thomas Harte 2020-10-09 23:22:48 -04:00
parent 92e72959c3
commit 290598429a
2 changed files with 9 additions and 1 deletions

View File

@ -256,6 +256,11 @@ class WolfgangLorenzTests: XCTestCase, CSTestMachineTrapHandler {
machine.setValue(0x0801, for: .programCounter) machine.setValue(0x0801, for: .programCounter)
machine.setValue(0xfd, for: .stackPointer) machine.setValue(0xfd, for: .stackPointer)
machine.setValue(0x04, for: .flags) machine.setValue(0x04, for: .flags)
// For consistency when debugging; otherwise immaterial.
machine.setValue(0x00, for: .A)
machine.setValue(0x00, for: .X)
machine.setValue(0x00, for: .Y)
} }
} }

View File

@ -249,7 +249,10 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
continue; continue;
case OperationConstructDirectIndexedIndirect: case OperationConstructDirectIndexedIndirect:
data_address_ = data_bank_ + (direct_ + x() + instruction_buffer_.value) & 0xffff; data_address_ = data_bank_ + (
((direct_ + x() + instruction_buffer_.value) & e_masks_[1]) +
(direct_ & e_masks_[0])
) & 0xffff;
if(!(direct_&0xff)) { if(!(direct_&0xff)) {
++next_op_; ++next_op_;
} }