diff --git a/cpm/cpm.go b/cpm/cpm.go index 109f539..6af6924 100644 --- a/cpm/cpm.go +++ b/cpm/cpm.go @@ -370,6 +370,26 @@ func New(logger *slog.Logger, prn string) *CPM { Handler: BiosSysCallPrintChar, Fake: true, } + b[15] = CPMHandler{ + Desc: "LISTST", + Handler: BiosSysCallPrinterStatus, + Fake: true, + } + b[17] = CPMHandler{ + Desc: "CONOST", + Handler: BiosSysCallScreenOutputStatus, + Fake: true, + } + b[18] = CPMHandler{ + Desc: "AUXIST", + Handler: BiosSysCallAuxInputStatus, + Fake: true, + } + b[19] = CPMHandler{ + Desc: "AUXOST", + Handler: BiosSysCallAuxOutputStatus, + Fake: true, + } // Create the emulator object and return it tmp := &CPM{ diff --git a/cpm/cpm_bios.go b/cpm/cpm_bios.go index b5e533f..ee4dba2 100644 --- a/cpm/cpm_bios.go +++ b/cpm/cpm_bios.go @@ -70,6 +70,46 @@ func BiosSysCallPrintChar(cpm *CPM) error { return err } +// BiosSysCallPrinterStatus returns status of current printer device. +// +// This is fake, and always returns "ready". +func BiosSysCallPrinterStatus(cpm *CPM) error { + + // Ready + cpm.CPU.States.AF.Hi = 0xFF + return nil +} + +// BiosSysCallScreenOutputStatus returns status of current screen output device. +// +// This is fake, and always returns "ready". +func BiosSysCallScreenOutputStatus(cpm *CPM) error { + + // Ready + cpm.CPU.States.AF.Hi = 0xFF + return nil +} + +// BiosSysCallAuxInputStatus returns status of current auxiliary input device. +// +// This is fake, and always returns "ready". +func BiosSysCallAuxInputStatus(cpm *CPM) error { + + // Ready + cpm.CPU.States.AF.Hi = 0xFF + return nil +} + +// BiosSysCallAuxOutputStatus returns status of current auxiliary output device. +// +// This is fake, and always returns "ready". +func BiosSysCallAuxOutputStatus(cpm *CPM) error { + + // Ready + cpm.CPU.States.AF.Hi = 0xFF + return nil +} + // BiosHandler is involved when a BIOS syscall needs to be executed, // which is handled via a small trampoline. // diff --git a/main.go b/main.go index 6197a47..59b8e50 100644 --- a/main.go +++ b/main.go @@ -66,7 +66,7 @@ func main() { // Now show them. fmt.Printf("BDOS\n") - for id := range ids { + for _, id := range ids { ent := c.BDOSSyscalls[uint8(id)] fake := "" if ent.Fake { @@ -84,7 +84,7 @@ func main() { // Now show them. fmt.Printf("BIOS\n") - for id := range ids { + for _, id := range ids { ent := c.BIOSSyscalls[uint8(id)] fake := "" if ent.Fake {