From 37ccb9d3b6b039b73636541ce4e5c1ce5d730423 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 25 Jul 2017 23:00:39 -0400 Subject: [PATCH] Fixed 6502 timing tests. --- OSBindings/Mac/Clock SignalTests/6502TimingTests.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/6502TimingTests.swift b/OSBindings/Mac/Clock SignalTests/6502TimingTests.swift index 2874dc7ca..98031b971 100644 --- a/OSBindings/Mac/Clock SignalTests/6502TimingTests.swift +++ b/OSBindings/Mac/Clock SignalTests/6502TimingTests.swift @@ -82,7 +82,8 @@ class MOS6502TimingTests: XCTestCase, CSTestMachineTrapHandler { 0x20, 0x04, 0x02, // [6] JSR $0204 0x00, 0x60, // [6] RTS - ] + ] + machine.addTrapAddress(0x0203) self.runTest(code, expectedRunLength: 12) } @@ -171,6 +172,7 @@ class MOS6502TimingTests: XCTestCase, CSTestMachineTrapHandler { 0x87, 0x09, // [3] SAX $09 0x60, // [6] RTS ] + machine.addTrapAddress(0x0203) self.runTest(code, expectedRunLength: 66) } @@ -220,7 +222,7 @@ class MOS6502TimingTests: XCTestCase, CSTestMachineTrapHandler { func testMachine(_ testMachine: CSTestMachine, didTrapAtAddress address: UInt16) { if self.endTime == 0 { - self.endTime = machine.timestamp - 9 + self.endTime = machine.timestamp - 1 } } }