diff --git a/cpm/cpm.go b/cpm/cpm.go index 6af6924..06c11bd 100644 --- a/cpm/cpm.go +++ b/cpm/cpm.go @@ -88,12 +88,12 @@ type FileCache struct { // CPM is the object that holds our emulator state. type CPM struct { - // ioErr holds any error received by the IO handler. + // biosErr holds any error created by a BIOS handler. // - // We need this because the CPU handler we use for IO operations + // We need this because the handlers we use for BIOS operations // cannot return an error - due to the interface used in the z80 // emulator. - ioErr error + biosErr error // files is the cache we use for File handles. files map[uint16]FileCache @@ -659,9 +659,9 @@ func (cpm *CPM) Execute(args []string) error { // If we ended up here because the I/O handler received // an error, and then HALTed the emulator we'll process it // here. - if cpm.ioErr != nil { - err = cpm.ioErr - cpm.ioErr = nil + if cpm.biosErr != nil { + err = cpm.biosErr + cpm.biosErr = nil } // Reboot? diff --git a/cpm/cpm_bios.go b/cpm/cpm_bios.go index ee4dba2..29f5c1b 100644 --- a/cpm/cpm_bios.go +++ b/cpm/cpm_bios.go @@ -126,7 +126,7 @@ func (cpm *CPM) BiosHandler(val uint8) { slog.String("syscallHex", fmt.Sprintf("0x%02X", val))) // record the error - cpm.ioErr = ErrUnimplemented + cpm.biosErr = ErrUnimplemented // halt processing. cpm.CPU.HALT = true @@ -158,7 +158,7 @@ func (cpm *CPM) BiosHandler(val uint8) { // If there was an error then record it for later notice. if err != nil { // record the error - cpm.ioErr = err + cpm.biosErr = err // halt processing. cpm.CPU.HALT = true }