From 3618cbb9c943323d4caaaa5329fd7af732cd5eee Mon Sep 17 00:00:00 2001 From: Ivan Izaguirre Date: Fri, 1 Nov 2019 18:48:39 +0100 Subject: [PATCH] Trace HD commands --- README.md | 4 +++- apple2Setup.go | 3 ++- apple2main.go | 9 +++++++-- cardHardDisk.go | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc21ccd..beed202 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ Only valid on SDL mode set base model. Models available 2plus, 2e, 2enh, base64a (default "2e") -mono emulate a green phosphor monitor instead of a NTSC color TV. Use F6 to toggle. - -panicss + -panicSS panic if a not implemented softswitch is used -profile generate profile trace to analyse with pprof @@ -143,6 +143,8 @@ Only valid on SDL mode slot for the ThunderClock Plus card. -1 for none (default 4) -traceCpu dump to the console the CPU execution. Use F11 to toggle. + -traceHD + dump to the console the hd commands -traceSS dump to the console the sofswitches calls diff --git a/apple2Setup.go b/apple2Setup.go index 328c857..8a87c6a 100644 --- a/apple2Setup.go +++ b/apple2Setup.go @@ -127,8 +127,9 @@ func (a *Apple2) AddDisk2(slot int, diskRomFile string, diskImage string) error } // AddHardDisk adds a ProDos hard dirve with a 2MG image -func (a *Apple2) AddHardDisk(slot int, hdImage string) error { +func (a *Apple2) AddHardDisk(slot int, hdImage string, trace bool) error { var c cardHardDisk + c.setTrace(trace) c.loadRom(buildHardDiskRom(slot)) a.insertCard(&c, slot) diff --git a/apple2main.go b/apple2main.go index 64e2ecf..21b68e0 100644 --- a/apple2main.go +++ b/apple2main.go @@ -64,7 +64,7 @@ func MainApple() *Apple2 { "set fast mode when the disks are spinning", ) panicSS := flag.Bool( - "panicss", + "panicSS", false, "panic if a not implemented softswitch is used", ) @@ -78,6 +78,11 @@ func MainApple() *Apple2 { false, "dump to the console the sofswitches calls", ) + traceHD := flag.Bool( + "traceHD", + false, + "dump to the console the hd commands", + ) dumpChars := flag.Bool( "dumpChars", false, @@ -196,7 +201,7 @@ func MainApple() *Apple2 { // If there is a hard disk image, but no slot assigned, use slot 7. *hardDiskSlot = 7 } - err := a.AddHardDisk(*hardDiskSlot, *hardDiskImage) + err := a.AddHardDisk(*hardDiskSlot, *hardDiskImage, *traceHD) if err != nil { panic(err) } diff --git a/cardHardDisk.go b/cardHardDisk.go index 9e7b76d..99a4472 100644 --- a/cardHardDisk.go +++ b/cardHardDisk.go @@ -159,3 +159,7 @@ func (c *cardHardDisk) writeBlock(block uint16, source uint16) uint8 { func (c *cardHardDisk) addDisk(disk *hardDisk) { c.disk = disk } + +func (c *cardHardDisk) setTrace(trace bool) { + c.trace = trace +}