mirror of
https://github.com/ariejan/i6502.git
synced 2025-04-20 06:38:05 +00:00
Add Klaus Dormann's 65C02 extended opcodes test rom.
This commit is contained in:
parent
f934c5cdf6
commit
a174259751
26
cpu_test.go
26
cpu_test.go
@ -3258,3 +3258,29 @@ func TestKlausDormann6502(t *testing.T) {
|
||||
prevPC = cpu.PC
|
||||
}
|
||||
}
|
||||
|
||||
// Run this last, as the full suite takes ±10 seconds to run at
|
||||
// maximum speed
|
||||
func TestKlausDormann65C02ExtendedOpcodes(t *testing.T) {
|
||||
fmt.Println("Running Klaus Dormann' 65C02 extended opcodes tests. This may take some time...")
|
||||
cpu, _, _ := NewRamMachine()
|
||||
cpu.LoadProgram(loadProgram("test/65C02_extended_opcodes_test.bin"), 0x0000)
|
||||
cpu.PC = 0x0400
|
||||
prevPC := uint16(0x0400)
|
||||
|
||||
for {
|
||||
cpu.Step()
|
||||
|
||||
if cpu.PC == prevPC {
|
||||
if cpu.PC != 0x3399 {
|
||||
str := "Looping PC detected at PC 0x%04X. We've hit a failing Klaus Dormann test."
|
||||
panic(fmt.Sprintf(str, cpu.PC))
|
||||
} else {
|
||||
fmt.Println("Klaus Dormann's 6502 functional tests passed.")
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
prevPC = cpu.PC
|
||||
}
|
||||
}
|
||||
|
BIN
test/65C02_extended_opcodes_test.bin
Normal file
BIN
test/65C02_extended_opcodes_test.bin
Normal file
Binary file not shown.
11308
test/65C02_extended_opcodes_test.lst
Normal file
11308
test/65C02_extended_opcodes_test.lst
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user