From 1ea1b10ab0c630e799604b40afe0cc19b96224f7 Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Wed, 16 May 2018 10:39:53 +0100 Subject: [PATCH] Ensure DOS actually boots in boot test --- dos33_boot_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dos33_boot_test.go b/dos33_boot_test.go index a4294d7..920419f 100644 --- a/dos33_boot_test.go +++ b/dos33_boot_test.go @@ -28,11 +28,18 @@ func TestDOS33Boot(t *testing.T) { system.FrameCycles = 0 system.LastAudioCycles = 0 showInstructions := false - var breakAddress uint16 - exitAtBreak := true disableFirmwareWait := false + + // Break at the BASIC interpreter to ensure DOS has started + breakAddress := uint16(0xa503) + exitAtBreak := false + t0 := time.Now() - cpu.Run(showInstructions, &breakAddress, exitAtBreak, disableFirmwareWait, system.CpuFrequency*1000) + cpu.Run(showInstructions, &breakAddress, exitAtBreak, disableFirmwareWait, system.CpuFrequency*7) + + if cpu.State.PC != 0xa503 { + t.Fatal("Did not reach BASIC entrypoint") + } elapsed := float64(time.Since(t0) / time.Millisecond) fmt.Printf("CPU Cycles: %d\n", system.FrameCycles)