2019-01-26 17:57:03 +00:00
|
|
|
package main
|
|
|
|
|
2019-02-09 23:15:14 +00:00
|
|
|
import "fmt"
|
|
|
|
|
2019-01-26 17:57:03 +00:00
|
|
|
func main() {
|
2019-02-09 23:15:14 +00:00
|
|
|
var s state
|
|
|
|
s.memory.loadBinary("6502_65C02_functional_tests/bin_files/6502_functional_test.bin")
|
2019-01-26 17:57:03 +00:00
|
|
|
|
2019-02-09 23:15:14 +00:00
|
|
|
s.registers.setPC(0x0400)
|
|
|
|
for true {
|
2019-02-12 23:03:43 +00:00
|
|
|
testCase := s.memory.peek(0x0200)
|
2019-02-10 22:47:54 +00:00
|
|
|
if testCase >= 240 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
log := testCase > 43
|
|
|
|
if log {
|
|
|
|
fmt.Printf("[ %d ] ", testCase)
|
|
|
|
}
|
|
|
|
pc := s.registers.getPC()
|
|
|
|
executeInstruction(&s, log)
|
|
|
|
if pc == s.registers.getPC() {
|
|
|
|
//s.memory.printPage(0x00)
|
|
|
|
//s.memory.printPage(0x01)
|
|
|
|
panic("No change in PC")
|
2019-02-09 23:15:14 +00:00
|
|
|
}
|
|
|
|
}
|
2019-02-10 22:47:54 +00:00
|
|
|
|
|
|
|
fmt.Printf("Test completed\n")
|
2019-01-26 17:57:03 +00:00
|
|
|
}
|