Skip to content

Commit

Permalink
Better OSCLI parsing, *DRIVE, OSFILE01,2,3,4,6 ad 7
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Sep 9, 2021
1 parent 24b85ec commit 55a219f
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 119 deletions.
4 changes: 2 additions & 2 deletions acornMemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
_ "embed"
"fmt"
"io/ioutil"
"os"
)

type acornMemory struct {
Expand Down Expand Up @@ -104,7 +104,7 @@ func (m *acornMemory) loadFirmware() {
}

func (m *acornMemory) loadRom(filename string, slot uint8) {
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err != nil {
panic(err)
}
Expand Down
6 changes: 3 additions & 3 deletions files.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ func (env *environment) openFile(filename string, mode uint8) uint8 {
switch mode {
case 0x40: // Open file for input only
//env.file[i], err = os.Open(filename)
env.file[i], err = os.OpenFile(filename, os.O_RDONLY|os.O_CREATE, 0644)
env.file[i], err = os.OpenFile(filename, os.O_RDONLY /*|os.O_CREATE*/, 0644)
case 0x80: // Open file for output only
env.file[i], err = os.Create(filename)
case 0xc0: // Open file foe update
case 0xc0: // Open file for update
env.file[i], err = os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0644)
default:
env.raiseError(errorTodo, fmt.Sprintf("Unknown open mode for OSFIND 0x%02x", mode))
i = -1
}
if err != nil {
env.raiseError(errorTodo, err.Error())
//env.raiseError(errorTodo, err.Error())
i = -1
}

Expand Down
Loading

0 comments on commit 55a219f

Please sign in to comment.