diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 34ce90551..020da0edc 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -846,6 +846,7 @@ 4BDDBA991EF3451200347E61 /* Z80MachineCycleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BDDBA981EF3451200347E61 /* Z80MachineCycleTests.swift */; }; 4BE0A3EE237BB170002AB46F /* ST.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE0A3EC237BB170002AB46F /* ST.cpp */; }; 4BE0A3EF237BB170002AB46F /* ST.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE0A3EC237BB170002AB46F /* ST.cpp */; }; + 4BE211DE253E4E4800435408 /* 65C02_no_Rockwell_test.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4BE211DD253E4E4800435408 /* 65C02_no_Rockwell_test.bin */; }; 4BE34438238389E10058E78F /* AtariSTVideoTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE34437238389E10058E78F /* AtariSTVideoTests.mm */; }; 4BE76CF922641ED400ACD6FA /* QLTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE76CF822641ED300ACD6FA /* QLTests.mm */; }; 4BE90FFD22D5864800FB464D /* MacintoshVideoTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE90FFC22D5864800FB464D /* MacintoshVideoTests.mm */; }; @@ -1768,6 +1769,7 @@ 4BDDBA981EF3451200347E61 /* Z80MachineCycleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Z80MachineCycleTests.swift; sourceTree = ""; }; 4BE0A3EC237BB170002AB46F /* ST.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ST.cpp; sourceTree = ""; }; 4BE0A3ED237BB170002AB46F /* ST.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ST.hpp; sourceTree = ""; }; + 4BE211DD253E4E4800435408 /* 65C02_no_Rockwell_test.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; name = 65C02_no_Rockwell_test.bin; path = "Klaus Dormann/65C02_no_Rockwell_test.bin"; sourceTree = ""; }; 4BE3231220532443006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = ""; }; 4BE32313205327D7006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = ""; }; 4BE32314205328FF006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = ""; }; @@ -1994,6 +1996,7 @@ 4B44EBF81DC9898E00A7820C /* BCDTEST_beeb */, 4B98A1CD1FFADEC400ADF63B /* MSX ROMs */, 4B018B88211930DE002A3937 /* 65C02_extended_opcodes_test.bin */, + 4BE211DD253E4E4800435408 /* 65C02_no_Rockwell_test.bin */, 4B44EBF61DC9883B00A7820C /* 6502_functional_test.bin */, 4B44EBF41DC987AE00A7820C /* AllSuiteA.bin */, 4B9F11CB22729B3500701480 /* OPCLOGR2.BIN */, @@ -4230,6 +4233,7 @@ 4BB299961B587D8400A49093 /* nmi in Resources */, 4BB299241B587D8400A49093 /* cia1ta in Resources */, 4BB2990E1B587D8400A49093 /* asoix in Resources */, + 4BE211DE253E4E4800435408 /* 65C02_no_Rockwell_test.bin in Resources */, 4BB299F51B587D8400A49093 /* trap9 in Resources */, 4BB299C81B587D8400A49093 /* sbcb(eb) in Resources */, 4BB299CF1B587D8400A49093 /* sedn in Resources */, diff --git a/OSBindings/Mac/Clock SignalTests/Klaus Dormann/65C02_no_Rockwell_test.bin b/OSBindings/Mac/Clock SignalTests/Klaus Dormann/65C02_no_Rockwell_test.bin new file mode 100644 index 000000000..c60b95b8a Binary files /dev/null and b/OSBindings/Mac/Clock SignalTests/Klaus Dormann/65C02_no_Rockwell_test.bin differ diff --git a/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift b/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift index 68c4c1642..0467e280f 100644 --- a/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift +++ b/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift @@ -118,6 +118,24 @@ class KlausDormannTests: XCTestCase { XCTAssert(error == nil, "Failed with error \(error!)") } + private func runTest65C02NoRockwell(processor: CSTestMachine6502Processor) { + func errorForTrapAddress(_ address: UInt16) -> String? { + switch address { + case 0x11e0: return nil // success! + + case 0x1474: return "BRK didn't clear the decimal flag" + case 0x0e3d: return "TRB set flags incorrectly" + + case 0: return "Didn't find tests" + default: return "Unknown error at \(String(format:"%04x", address))" + } + } + + let destination = runTest(resource: "65C02_no_Rockwell_test", processor: processor) + let error = errorForTrapAddress(destination) + XCTAssert(error == nil, "Failed with error \(error!)") + } + /// Runs Klaus Dormann's 6502 tests. func test6502() { @@ -134,6 +152,11 @@ class KlausDormannTests: XCTestCase { runTest6502(processor: .processor65816) } + /// Runs Klaus Dormann's standard 6502 tests on a 65816. + func test65816AsNonRockwell65C02() { + runTest65C02NoRockwell(processor: .processor65816) + } + /// Runs Klaus Dormann's 65C02 tests. func test65C02() { runTest65C02(processor: .processor65C02) diff --git a/Processors/65816/Implementation/65816Implementation.hpp b/Processors/65816/Implementation/65816Implementation.hpp index 39180736c..c8750a6e0 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -444,6 +444,7 @@ template void Processor