Rearranged files and resurrected CPU test

This commit is contained in:
Will Angenent 2018-05-14 23:39:55 +01:00
parent 55e0b6b664
commit de7299a5ab
8 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,4 @@
package main
package cpu_test
import (
"flag"
@ -8,9 +8,10 @@ import (
"mos6502go/mmu"
"mos6502go/system"
"mos6502go/utils"
"testing"
)
func main() {
func TestCPU(t *testing.T) {
showInstructions := flag.Bool("show-instructions", false, "Show instructions code while running")
skipTest0 := flag.Bool("skip-functional-test", false, "Skip functional test")
skipTest1 := flag.Bool("skip-interrupt-test", false, "Skip interrupt test")

View File

@ -1,4 +1,4 @@
package main_test
package main
import (
"fmt"
@ -33,11 +33,8 @@ func TestDOS33Boot(t *testing.T) {
t0 := time.Now()
cpu.Run(showInstructions, &breakAddress, disableFirmwareWait, system.CpuFrequency*1000)
// audio.ForwardToFrameCycle()
elapsed := float64(time.Since(t0) / time.Millisecond)
fmt.Printf("CPU Cycles: %d\n", system.FrameCycles)
// fmt.Printf("Sound samples: %d\n", len(system.AudioChannel))
fmt.Printf("Time elapsed: %0.2f ms\n", elapsed)
fmt.Printf("Speed: %0.2f cycles/ms\n", float64(system.FrameCycles)/elapsed)
}