1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-12 00:30:31 +00:00

Merge pull request #843 from TomHarte/MoreDormann

Introduces a build of Dormann's 65C02 tests that is 65816 compatible.
This commit is contained in:
Thomas Harte 2020-10-19 21:13:46 -04:00 committed by GitHub
commit 3aa47f9c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 5572 additions and 5 deletions

View File

@ -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 = "<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>"; };
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>"; };
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>"; };
@ -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 */,

File diff suppressed because it is too large Load Diff

View File

@ -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)

View File

@ -216,13 +216,14 @@ class WolfgangLorenzTests: XCTestCase, CSTestMachineTrapHandler {
func testBIT65816() {
runTest("bit", suffixes: ["z", "a"], processor: .processor65816)
}
func testFlow65816() {
testFlow(processor: .processor65816)
}
/*
The flow tests don't apply; the 65816 [and 65C02] reset the decimal flag upon a BRK, but the 6502 that Lorenz
tests doesn't do so.
*/
func testBranch65816() {
testBranch(processor: .processor65816)
}
/* The NOP tests also don't apply; the 65816 has only one, well-defined NOP (well, not counting COP or WDM). */
/* The NOP tests also don't apply; the 65816 has only one, well-defined NOP. */
// MARK: - Collections

View File

@ -444,6 +444,7 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
}
registers_.flags.inverse_interrupt = 0;
registers_.flags.decimal = 0;
} continue;
//

View File

@ -775,7 +775,7 @@ ProcessorStorage::ProcessorStorage() {
/* 0x11 ORA (d), y */ op(direct_indirect_indexed, ORA);
/* 0x12 ORA (d) */ op(direct_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);
/* 0x16 ASL d, x */ op(direct_x_rmw, ASL);
/* 0x17 ORA [d], y */ op(direct_indirect_indexed_long, ORA);