1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Exploit test's 65C02 abilities.

This commit is contained in:
Thomas Harte 2023-08-29 17:04:52 -04:00
parent 598a889c6d
commit c160482b0a

View File

@ -11,10 +11,10 @@ import XCTest
class BCDTest: XCTestCase, CSTestMachineTrapHandler {
func testBCD() {
func testBCD(processor: CSTestMachine6502Processor) {
if let filename = Bundle(for: type(of: self)).path(forResource: "BCDTEST_beeb", ofType: nil) {
if let bcdTest = try? Data(contentsOf: URL(fileURLWithPath: filename)) {
let machine = CSTestMachine6502(processor: .processor6502)
let machine = CSTestMachine6502(processor: processor)
machine.trapHandler = self
machine.setData(bcdTest, atAddress: 0x2900)
@ -40,6 +40,14 @@ class BCDTest: XCTestCase, CSTestMachineTrapHandler {
}
}
func test6502BCD() {
testBCD(processor: .processor6502)
}
func test65C02BCD() {
testBCD(processor: .processor65C02)
}
private var output: String = ""
func testMachine(_ testMachine: CSTestMachine, didTrapAtAddress address: UInt16) {
let machine6502 = testMachine as! CSTestMachine6502