mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-28 22:30:30 +00:00
Imports a custom-built copy of Klaus Dormann's 65C02 test, with only 65816-compatible parts.
Thereby fixes another couple of 65816 issues — BRK(, etc) not clearing the decimal flag, and `TRB d` being mismapped.
This commit is contained in:
parent
14718b93a4
commit
b3ab9fff9b
@ -846,6 +846,7 @@
|
|||||||
4BDDBA991EF3451200347E61 /* Z80MachineCycleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BDDBA981EF3451200347E61 /* Z80MachineCycleTests.swift */; };
|
4BDDBA991EF3451200347E61 /* Z80MachineCycleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BDDBA981EF3451200347E61 /* Z80MachineCycleTests.swift */; };
|
||||||
4BE0A3EE237BB170002AB46F /* ST.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE0A3EC237BB170002AB46F /* ST.cpp */; };
|
4BE0A3EE237BB170002AB46F /* ST.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE0A3EC237BB170002AB46F /* ST.cpp */; };
|
||||||
4BE0A3EF237BB170002AB46F /* 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 */; };
|
4BE34438238389E10058E78F /* AtariSTVideoTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE34437238389E10058E78F /* AtariSTVideoTests.mm */; };
|
||||||
4BE76CF922641ED400ACD6FA /* QLTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE76CF822641ED300ACD6FA /* QLTests.mm */; };
|
4BE76CF922641ED400ACD6FA /* QLTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE76CF822641ED300ACD6FA /* QLTests.mm */; };
|
||||||
4BE90FFD22D5864800FB464D /* MacintoshVideoTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BE90FFC22D5864800FB464D /* MacintoshVideoTests.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 = "<group>"; };
|
4BDDBA981EF3451200347E61 /* Z80MachineCycleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Z80MachineCycleTests.swift; sourceTree = "<group>"; };
|
||||||
4BE0A3EC237BB170002AB46F /* ST.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ST.cpp; sourceTree = "<group>"; };
|
4BE0A3EC237BB170002AB46F /* ST.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ST.cpp; sourceTree = "<group>"; };
|
||||||
4BE0A3ED237BB170002AB46F /* ST.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ST.hpp; sourceTree = "<group>"; };
|
4BE0A3ED237BB170002AB46F /* ST.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ST.hpp; sourceTree = "<group>"; };
|
||||||
|
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 = "<group>"; };
|
||||||
4BE3231220532443006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = "<group>"; };
|
4BE3231220532443006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = "<group>"; };
|
||||||
4BE32313205327D7006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = "<group>"; };
|
4BE32313205327D7006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = "<group>"; };
|
||||||
4BE32314205328FF006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = "<group>"; };
|
4BE32314205328FF006EF799 /* Target.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = "<group>"; };
|
||||||
@ -1994,6 +1996,7 @@
|
|||||||
4B44EBF81DC9898E00A7820C /* BCDTEST_beeb */,
|
4B44EBF81DC9898E00A7820C /* BCDTEST_beeb */,
|
||||||
4B98A1CD1FFADEC400ADF63B /* MSX ROMs */,
|
4B98A1CD1FFADEC400ADF63B /* MSX ROMs */,
|
||||||
4B018B88211930DE002A3937 /* 65C02_extended_opcodes_test.bin */,
|
4B018B88211930DE002A3937 /* 65C02_extended_opcodes_test.bin */,
|
||||||
|
4BE211DD253E4E4800435408 /* 65C02_no_Rockwell_test.bin */,
|
||||||
4B44EBF61DC9883B00A7820C /* 6502_functional_test.bin */,
|
4B44EBF61DC9883B00A7820C /* 6502_functional_test.bin */,
|
||||||
4B44EBF41DC987AE00A7820C /* AllSuiteA.bin */,
|
4B44EBF41DC987AE00A7820C /* AllSuiteA.bin */,
|
||||||
4B9F11CB22729B3500701480 /* OPCLOGR2.BIN */,
|
4B9F11CB22729B3500701480 /* OPCLOGR2.BIN */,
|
||||||
@ -4230,6 +4233,7 @@
|
|||||||
4BB299961B587D8400A49093 /* nmi in Resources */,
|
4BB299961B587D8400A49093 /* nmi in Resources */,
|
||||||
4BB299241B587D8400A49093 /* cia1ta in Resources */,
|
4BB299241B587D8400A49093 /* cia1ta in Resources */,
|
||||||
4BB2990E1B587D8400A49093 /* asoix in Resources */,
|
4BB2990E1B587D8400A49093 /* asoix in Resources */,
|
||||||
|
4BE211DE253E4E4800435408 /* 65C02_no_Rockwell_test.bin in Resources */,
|
||||||
4BB299F51B587D8400A49093 /* trap9 in Resources */,
|
4BB299F51B587D8400A49093 /* trap9 in Resources */,
|
||||||
4BB299C81B587D8400A49093 /* sbcb(eb) in Resources */,
|
4BB299C81B587D8400A49093 /* sbcb(eb) in Resources */,
|
||||||
4BB299CF1B587D8400A49093 /* sedn in Resources */,
|
4BB299CF1B587D8400A49093 /* sedn in Resources */,
|
||||||
|
Binary file not shown.
@ -118,6 +118,24 @@ class KlausDormannTests: XCTestCase {
|
|||||||
XCTAssert(error == nil, "Failed with error \(error!)")
|
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.
|
/// Runs Klaus Dormann's 6502 tests.
|
||||||
func test6502() {
|
func test6502() {
|
||||||
@ -134,6 +152,11 @@ class KlausDormannTests: XCTestCase {
|
|||||||
runTest6502(processor: .processor65816)
|
runTest6502(processor: .processor65816)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Runs Klaus Dormann's standard 6502 tests on a 65816.
|
||||||
|
func test65816AsNonRockwell65C02() {
|
||||||
|
runTest65C02NoRockwell(processor: .processor65816)
|
||||||
|
}
|
||||||
|
|
||||||
/// Runs Klaus Dormann's 65C02 tests.
|
/// Runs Klaus Dormann's 65C02 tests.
|
||||||
func test65C02() {
|
func test65C02() {
|
||||||
runTest65C02(processor: .processor65C02)
|
runTest65C02(processor: .processor65C02)
|
||||||
|
@ -444,6 +444,7 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
|
|||||||
}
|
}
|
||||||
|
|
||||||
registers_.flags.inverse_interrupt = 0;
|
registers_.flags.inverse_interrupt = 0;
|
||||||
|
registers_.flags.decimal = 0;
|
||||||
} continue;
|
} continue;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -775,7 +775,7 @@ ProcessorStorage::ProcessorStorage() {
|
|||||||
/* 0x11 ORA (d), y */ op(direct_indirect_indexed, ORA);
|
/* 0x11 ORA (d), y */ op(direct_indirect_indexed, ORA);
|
||||||
/* 0x12 ORA (d) */ op(direct_indirect, ORA);
|
/* 0x12 ORA (d) */ op(direct_indirect, ORA);
|
||||||
/* 0x13 ORA (d, s), y */ op(stack_relative_indexed_indirect, ORA);
|
/* 0x13 ORA (d, s), y */ op(stack_relative_indexed_indirect, ORA);
|
||||||
/* 0x14 TRB d */ op(absolute_rmw, TRB);
|
/* 0x14 TRB d */ op(direct_rmw, TRB);
|
||||||
/* 0x15 ORA d, x */ op(direct_x, ORA);
|
/* 0x15 ORA d, x */ op(direct_x, ORA);
|
||||||
/* 0x16 ASL d, x */ op(direct_x_rmw, ASL);
|
/* 0x16 ASL d, x */ op(direct_x_rmw, ASL);
|
||||||
/* 0x17 ORA [d], y */ op(direct_indirect_indexed_long, ORA);
|
/* 0x17 ORA [d], y */ op(direct_indirect_indexed_long, ORA);
|
||||||
|
Loading…
Reference in New Issue
Block a user