Skip to content

Commit

Permalink
*/ as alias of *RUN
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Aug 25, 2021
1 parent a892e41 commit bd98d90
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ References:
- Some of the MOS entrypoints and VDU control codes are defined.
- Does some of the mode 7 text coloring using ANSI escape codes on the terminal. Try `VDU 65,129,66,130,67,132,68,135,69,13,10` on BBC BASIC.
- OSCLI comands suported:
- *|
- */
- *FX
- *BASIC
- *HELP
Expand Down
12 changes: 12 additions & 0 deletions osByte.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ func execOSBYTE(env *environment) {
*/
// We do nothing

case 0x72:
option = "Specify video memory to use on next MODE change"
/*
On entry:
X=0 force use of shadow memory on future MODE changes
X=1 only use shadow memory if MODE number is > 127
X=255 never use shadow memory even if MODE > 127 (Solidisk ROM/RAM Extension)
On exit:
X=previous setting
*/
newX = 1

case 0x76:
option = "Reflect keyboard status in keyboard LEDs"
/*
Expand Down
35 changes: 18 additions & 17 deletions osCLI.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,29 @@ func execOSCLI(env *environment) {
pos++
}
if line[pos] == '|' || line[pos] == '\r' { // Ignore "*|" or standalone "*"
env.log(fmt.Sprintf("OSCLI('%s', CMD=empty)", lineNotTerminated))
return
}
if line[pos] == '/' { // Send "*/[...]" to filling system
env.log("*/[...] not implemented")
return
}

// Extract command
command := ""
for ; !strings.ContainsAny(string(line[pos]), " .0123456789\r"); pos++ {
command += string(line[pos])
}
command = strings.ToUpper(command) // Commands are case insensitive
if line[pos] == '.' {
// Expand . shortcut
for _, candidate := range cliCommands {
if strings.HasPrefix(candidate, command) {
command = candidate // Full command found
break
if line[pos] == '/' { // Send "*/[...]" to filling system
command = "RUN"
pos++
} else {
// Extract command
for ; !strings.ContainsAny(string(line[pos]), " .0123456789\r"); pos++ {
command += string(line[pos])
}
command = strings.ToUpper(command) // Commands are case insensitive
if line[pos] == '.' {
// Expand . shortcut
for _, candidate := range cliCommands {
if strings.HasPrefix(candidate, command) {
command = candidate // Full command found
break
}
}
pos++
}
pos++
}
for line[pos] == ' ' { // Remove spaces after command
pos++
Expand Down

0 comments on commit bd98d90

Please sign in to comment.