Skip to content

Commit

Permalink
REname ioErr to biosErr for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
skx committed May 18, 2024
1 parent e35e2f6 commit b108e08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cpm/cpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions cpm/cpm_bios.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit b108e08

Please sign in to comment.