mirror of
https://github.com/a2stuff/prodos-path.git
synced 2025-01-13 18:29:55 +00:00
Allow prefixes which as BASIC tokens
This commit is contained in:
parent
3e918d3e5e
commit
b81f7b3ecb
6
Makefile
6
Makefile
@ -5,9 +5,9 @@ LDFLAGS = --config apple2-asm.cfg
|
|||||||
OUTDIR = out
|
OUTDIR = out
|
||||||
|
|
||||||
TARGETS = $(OUTDIR)/path.BIN \
|
TARGETS = $(OUTDIR)/path.BIN \
|
||||||
$(OUTDIR)/bell.CMD $(OUTDIR)/hello.CMD $(OUTDIR)/echo.CMD $(OUTDIR)/vols.CMD
|
$(OUTDIR)/bell.CMD $(OUTDIR)/hello.CMD $(OUTDIR)/echo.CMD $(OUTDIR)/online.CMD
|
||||||
|
|
||||||
.PHONY: clean all
|
.PHONY: clean all package
|
||||||
all: $(OUTDIR) $(TARGETS)
|
all: $(OUTDIR) $(TARGETS)
|
||||||
|
|
||||||
$(OUTDIR):
|
$(OUTDIR):
|
||||||
@ -20,6 +20,8 @@ clean:
|
|||||||
rm -f $(OUTDIR)/*.list
|
rm -f $(OUTDIR)/*.list
|
||||||
rm -f $(TARGETS)
|
rm -f $(TARGETS)
|
||||||
|
|
||||||
|
package:
|
||||||
|
./package.sh
|
||||||
|
|
||||||
$(OUTDIR)/%.o: %.s $(HEADERS)
|
$(OUTDIR)/%.o: %.s $(HEADERS)
|
||||||
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
||||||
|
19
README.md
19
README.md
@ -2,11 +2,8 @@
|
|||||||
|
|
||||||
[![Build Status](https://travis-ci.org/a2stuff/prodos-path.svg?branch=master)](https://travis-ci.org/a2stuff/prodos-path)
|
[![Build Status](https://travis-ci.org/a2stuff/prodos-path.svg?branch=master)](https://travis-ci.org/a2stuff/prodos-path)
|
||||||
|
|
||||||
|
|
||||||
💾 Disk images can be found on the [Releases](https://github.com/a2stuff/prodos-path/releases) page 💾
|
💾 Disk images can be found on the [Releases](https://github.com/a2stuff/prodos-path/releases) page 💾
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Build with [ca65](https://cc65.github.io/doc/ca65.html)
|
Build with [ca65](https://cc65.github.io/doc/ca65.html)
|
||||||
|
|
||||||
Installation:
|
Installation:
|
||||||
@ -33,19 +30,21 @@ Example:
|
|||||||
/hd/cmds
|
/hd/cmds
|
||||||
] BELL - will invoke /hd/cmds/BELL if present
|
] BELL - will invoke /hd/cmds/BELL if present
|
||||||
] HELLO - will invoke /hd/cmds/HELLO if present
|
] HELLO - will invoke /hd/cmds/HELLO if present
|
||||||
] VOLS - will invoke /hd/cmds/VOLS if present
|
] ONLINE - will invoke /hd/cmds/ONLINE if present
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
* Allocates a permanent buffer to store the code and path (2 pages)
|
|
||||||
* Can be invoked as lower case (e.g. `path ...`)
|
|
||||||
* Applesoft BASIC commands are unaffected (but can't be CMD names)
|
|
||||||
* Search order when a command is typed:
|
* Search order when a command is typed:
|
||||||
* ProDOS BASIC.SYSTEM intrinsics (`CAT`, `PREFIX`, etc)
|
* ProDOS BASIC.SYSTEM intrinsics (`CAT`, `PREFIX`, etc)
|
||||||
* AppleSoft keywords (`LIST`, `PRINT`, etc)
|
* BASIC keywords (`LIST`, `PRINT`, etc)
|
||||||
* CMD files in paths, in listed order
|
* CMD files in paths, in listed order
|
||||||
|
* Allocates a permanent buffer to store the code and path (2 pages)
|
||||||
|
* `PATH` can be invoked as lower case (e.g. `path /DISK/CMDS`)
|
||||||
|
* Commands can be invoked as lower case (e.g. `hello`)
|
||||||
|
* Applesoft BASIC commands are unaffected (but can't be CMD names)
|
||||||
|
* Commands with BASIC keywords as _prefixes_ are allowed as long as the command continues with an alphabetic character. For example, `ONLINE` is allowed despite conflicting with the valid BASIC statement `ONLINE GOTO10` which is short for `ON LINE GOTO 10`.
|
||||||
|
|
||||||
Sample commands:
|
Sample commands included:
|
||||||
* `BELL` - beeps the speaker
|
* `BELL` - beeps the speaker
|
||||||
* `HELLO` - shows a short message
|
* `HELLO` - shows a short message
|
||||||
* `VOLS` - lists online volumes (volume name, slot and drive)
|
* `ONLINE` - lists online volumes (volume name, slot and drive)
|
||||||
|
@ -21,7 +21,7 @@ add_file "out/path.BIN" "path#062000"
|
|||||||
add_file "out/bell.CMD" "bell#F04000"
|
add_file "out/bell.CMD" "bell#F04000"
|
||||||
add_file "out/echo.CMD" "echo#F04000"
|
add_file "out/echo.CMD" "echo#F04000"
|
||||||
add_file "out/hello.CMD" "hello#F04000"
|
add_file "out/hello.CMD" "hello#F04000"
|
||||||
add_file "out/vols.CMD" "vols#F04000"
|
add_file "out/online.CMD" "online#F04000"
|
||||||
|
|
||||||
rm -r "$PACKDIR"
|
rm -r "$PACKDIR"
|
||||||
|
|
||||||
|
24
path.s
24
path.s
@ -245,7 +245,18 @@ next_char:
|
|||||||
sbc (tptr),Y
|
sbc (tptr),Y
|
||||||
beq mloop
|
beq mloop
|
||||||
cmp #$80 ; If only difference was the high bit
|
cmp #$80 ; If only difference was the high bit
|
||||||
beq not_ours ; then it's end-of-token -- and a match!
|
bne next_token ; then it's end-of-token -- and a match!
|
||||||
|
|
||||||
|
;; Only if next command char is not alpha.
|
||||||
|
;; This allows 'ON' as a prefix (e.g. 'ONLINE'),
|
||||||
|
;; without preventing 'RUN100' from being typed.
|
||||||
|
|
||||||
|
inx
|
||||||
|
jsr to_upper_ascii
|
||||||
|
cmp #'A'
|
||||||
|
bcc not_ours
|
||||||
|
cmp #'Z'+1
|
||||||
|
bcs not_ours
|
||||||
|
|
||||||
;; Otherwise, advance to next token
|
;; Otherwise, advance to next token
|
||||||
next_token:
|
next_token:
|
||||||
@ -262,6 +273,7 @@ sloop: lda (tptr),y ; Scan table looking for a high bit set
|
|||||||
beq maybe_invoke
|
beq maybe_invoke
|
||||||
|
|
||||||
not_ours:
|
not_ours:
|
||||||
|
fail_invoke:
|
||||||
sec ; Signal failure...
|
sec ; Signal failure...
|
||||||
next_command := *+1
|
next_command := *+1
|
||||||
jmp $ffff ; Execute next command in chain
|
jmp $ffff ; Execute next command in chain
|
||||||
@ -269,11 +281,6 @@ not_ours:
|
|||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
fail_invoke:
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
maybe_invoke:
|
maybe_invoke:
|
||||||
|
|
||||||
ppos := $D6 ; position into path_buffer
|
ppos := $D6 ; position into path_buffer
|
||||||
@ -409,9 +416,8 @@ notok: dey
|
|||||||
|
|
||||||
fail_load:
|
fail_load:
|
||||||
jsr FREEBUFR
|
jsr FREEBUFR
|
||||||
lda #8 ; I/O ERROR - TODO: is this used???
|
reloc_point *+2
|
||||||
sec
|
jmp fail_invoke
|
||||||
rts
|
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user