diff --git a/OSBindings/Mac/Clock SignalTests/Jeek816Tests.swift b/OSBindings/Mac/Clock SignalTests/Jeek816Tests.swift index 204f59c7a..31dbe7d17 100644 --- a/OSBindings/Mac/Clock SignalTests/Jeek816Tests.swift +++ b/OSBindings/Mac/Clock SignalTests/Jeek816Tests.swift @@ -28,7 +28,8 @@ class Jeek816Tests: XCTestCase { NSException(name: NSExceptionName(rawValue: "Failed Test"), reason: "Couldn't load file \(name)", userInfo: nil).raise() } - while machine.value(for: .lastOperationAddress) != 0x0874 { + // $874 is the failure stopping point and $85d is success. + while machine.value(for: .lastOperationAddress) != 0x0874 && machine.value(for: .lastOperationAddress) != 0x085d { machine.runForNumber(ofCycles: 1000) } diff --git a/Processors/65816/Implementation/65816Implementation.hpp b/Processors/65816/Implementation/65816Implementation.hpp index f2e19b42d..fae4e64e6 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -249,7 +249,7 @@ template void Processor::run_for(const Cycles case OperationConstructAbsoluteXRead: case OperationConstructAbsoluteX: - data_address_ = ((instruction_buffer_.value + x()) & 0xffff) + data_bank_; + data_address_ = instruction_buffer_.value + x() + data_bank_; incorrect_data_address_ = (data_address_ & 0xff) | (instruction_buffer_.value & 0xff00) + data_bank_; // If the incorrect address isn't actually incorrect, skip its usage. @@ -261,7 +261,7 @@ template void Processor::run_for(const Cycles case OperationConstructAbsoluteYRead: case OperationConstructAbsoluteY: - data_address_ = ((instruction_buffer_.value + y()) & 0xffff) + data_bank_; + data_address_ = instruction_buffer_.value + y() + data_bank_; incorrect_data_address_ = (data_address_ & 0xff) + (instruction_buffer_.value & 0xff00) + data_bank_; // If the incorrect address isn't actually incorrect, skip its usage.