From de7299a5ab6759e7c403f2ba454d07d18a45e7f7 Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Mon, 14 May 2018 23:39:55 +0100 Subject: [PATCH] Rearranged files and resurrected CPU test --- cmd/test-apple-iie-boot.go => appleiie.go | 0 .../6502_functional_test.a65 | 0 .../6502_functional_test.bin.gz | Bin .../6502_interrupt_test.a65 | 0 .../6502_interrupt_test.bin.gz | Bin .../6502_interrupt_test.lst | 0 cmd/test-cpu.go => cpu/cpu_test.go | 5 +++-- dos33_boot_test.go | 5 +---- 8 files changed, 4 insertions(+), 6 deletions(-) rename cmd/test-apple-iie-boot.go => appleiie.go (100%) rename 6502_functional_test.a65 => cpu/6502_functional_test.a65 (100%) rename 6502_functional_test.bin.gz => cpu/6502_functional_test.bin.gz (100%) rename 6502_interrupt_test.a65 => cpu/6502_interrupt_test.a65 (100%) rename 6502_interrupt_test.bin.gz => cpu/6502_interrupt_test.bin.gz (100%) rename 6502_interrupt_test.lst => cpu/6502_interrupt_test.lst (100%) rename cmd/test-cpu.go => cpu/cpu_test.go (96%) diff --git a/cmd/test-apple-iie-boot.go b/appleiie.go similarity index 100% rename from cmd/test-apple-iie-boot.go rename to appleiie.go diff --git a/6502_functional_test.a65 b/cpu/6502_functional_test.a65 similarity index 100% rename from 6502_functional_test.a65 rename to cpu/6502_functional_test.a65 diff --git a/6502_functional_test.bin.gz b/cpu/6502_functional_test.bin.gz similarity index 100% rename from 6502_functional_test.bin.gz rename to cpu/6502_functional_test.bin.gz diff --git a/6502_interrupt_test.a65 b/cpu/6502_interrupt_test.a65 similarity index 100% rename from 6502_interrupt_test.a65 rename to cpu/6502_interrupt_test.a65 diff --git a/6502_interrupt_test.bin.gz b/cpu/6502_interrupt_test.bin.gz similarity index 100% rename from 6502_interrupt_test.bin.gz rename to cpu/6502_interrupt_test.bin.gz diff --git a/6502_interrupt_test.lst b/cpu/6502_interrupt_test.lst similarity index 100% rename from 6502_interrupt_test.lst rename to cpu/6502_interrupt_test.lst diff --git a/cmd/test-cpu.go b/cpu/cpu_test.go similarity index 96% rename from cmd/test-cpu.go rename to cpu/cpu_test.go index 50ef73f..1d6a454 100644 --- a/cmd/test-cpu.go +++ b/cpu/cpu_test.go @@ -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") diff --git a/dos33_boot_test.go b/dos33_boot_test.go index 7b95844..b52106c 100644 --- a/dos33_boot_test.go +++ b/dos33_boot_test.go @@ -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) }