mirror of
https://github.com/a2stuff/prodos-path.git
synced 2024-09-27 07:54:52 +00:00
Added VOLS command
This commit is contained in:
parent
42e92fb6f2
commit
3e918d3e5e
2
Makefile
2
Makefile
@ -5,7 +5,7 @@ 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)/bell.CMD $(OUTDIR)/hello.CMD $(OUTDIR)/echo.CMD $(OUTDIR)/vols.CMD
|
||||||
|
|
||||||
.PHONY: clean all
|
.PHONY: clean all
|
||||||
all: $(OUTDIR) $(TARGETS)
|
all: $(OUTDIR) $(TARGETS)
|
||||||
|
@ -33,6 +33,7 @@ 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
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
@ -43,3 +44,8 @@ Notes:
|
|||||||
* ProDOS BASIC.SYSTEM intrinsics (`CAT`, `PREFIX`, etc)
|
* ProDOS BASIC.SYSTEM intrinsics (`CAT`, `PREFIX`, etc)
|
||||||
* AppleSoft keywords (`LIST`, `PRINT`, etc)
|
* AppleSoft keywords (`LIST`, `PRINT`, etc)
|
||||||
* CMD files in paths, in listed order
|
* CMD files in paths, in listed order
|
||||||
|
|
||||||
|
Sample commands:
|
||||||
|
* `BELL` - beeps the speaker
|
||||||
|
* `HELLO` - shows a short message
|
||||||
|
* `VOLS` - lists online volumes (volume name, slot and drive)
|
||||||
|
@ -21,6 +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"
|
||||||
|
|
||||||
rm -r "$PACKDIR"
|
rm -r "$PACKDIR"
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
MLI := $BF00
|
MLI := $BF00
|
||||||
|
|
||||||
GET_FILE_INFO = $C4
|
GET_FILE_INFO = $C4
|
||||||
|
ON_LINE = $C5
|
||||||
OPEN = $C8
|
OPEN = $C8
|
||||||
READ = $CA
|
READ = $CA
|
||||||
CLOSE = $CC
|
CLOSE = $CC
|
||||||
|
99
vols.cmd.s
Normal file
99
vols.cmd.s
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
|
||||||
|
.include "apple2.inc"
|
||||||
|
.include "prodos.inc"
|
||||||
|
|
||||||
|
CROUT := $FD8E ; Issue a carriage return.
|
||||||
|
COUT := $FDED ; Output a character.
|
||||||
|
|
||||||
|
.org $4000
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
ptr := $06
|
||||||
|
|
||||||
|
jsr CROUT
|
||||||
|
|
||||||
|
MLI_CALL ON_LINE, params
|
||||||
|
bcs exit
|
||||||
|
|
||||||
|
lda #<buf
|
||||||
|
sta ptr
|
||||||
|
lda #>buf
|
||||||
|
sta ptr+1
|
||||||
|
|
||||||
|
loop: ldy #0
|
||||||
|
lda (ptr),y
|
||||||
|
beq exit ; Done!
|
||||||
|
|
||||||
|
;; Crack drive/slot/name_len
|
||||||
|
and #%00001111
|
||||||
|
beq next ; Error; TODO: if next byte is $57 show Duplicate Volume
|
||||||
|
sta len
|
||||||
|
lda (ptr),y
|
||||||
|
and #%11110000
|
||||||
|
sta ds
|
||||||
|
|
||||||
|
;; Print name
|
||||||
|
lda #'/'|$80 ; Leading slash
|
||||||
|
jsr COUT
|
||||||
|
: iny
|
||||||
|
lda (ptr),y ; Name characters
|
||||||
|
ora #$80
|
||||||
|
jsr COUT
|
||||||
|
cpy len
|
||||||
|
bne :-
|
||||||
|
|
||||||
|
;; Space
|
||||||
|
lda #20
|
||||||
|
sta CH ; TODO: COUT spaces, instead of HTAB?
|
||||||
|
|
||||||
|
;; Slot
|
||||||
|
lda #'S'|$80
|
||||||
|
jsr COUT
|
||||||
|
lda ds
|
||||||
|
and #%01110000
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
ora #'0'|$80
|
||||||
|
jsr COUT
|
||||||
|
|
||||||
|
;; Drive
|
||||||
|
lda #','|$80
|
||||||
|
jsr COUT
|
||||||
|
lda #'D'|$80
|
||||||
|
jsr COUT
|
||||||
|
lda #'1'|$80
|
||||||
|
bit ds
|
||||||
|
bpl :+
|
||||||
|
lda #'2'|$80
|
||||||
|
: jsr COUT
|
||||||
|
jsr CROUT
|
||||||
|
|
||||||
|
next: dec count
|
||||||
|
beq exit
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda ptr
|
||||||
|
adc #16
|
||||||
|
sta ptr
|
||||||
|
lda ptr+1
|
||||||
|
adc #0
|
||||||
|
sta ptr+1
|
||||||
|
jmp loop
|
||||||
|
|
||||||
|
exit: rts
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
.proc params
|
||||||
|
param_count: .byte 2
|
||||||
|
unit_num: .byte 0
|
||||||
|
data_buffer: .addr buf
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
count: .byte 16
|
||||||
|
buf: .res 256
|
||||||
|
len: .byte 0 ; name length
|
||||||
|
ds: .byte 0 ; drive / slot
|
Loading…
Reference in New Issue
Block a user