mirror of
https://github.com/a2stuff/prodos-path.git
synced 2024-09-28 14:55:02 +00:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b63dabb7cd | ||
|
0c01446574 | ||
|
af1c8f1865 | ||
|
3360d44dd7 | ||
|
4bdb0808a2 | ||
|
8cb8f98793 | ||
|
e21c518a06 | ||
|
2c8d464108 | ||
|
e3f59575ed | ||
|
6157963cc8 |
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
@ -13,19 +13,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: build and install cc65 components
|
||||
run: >
|
||||
git clone https://github.com/cc65/cc65 /tmp/cc65 &&
|
||||
sudo make -C /tmp/cc65 ca65 ld65 avail &&
|
||||
ca65 --version
|
||||
|
||||
- name: build and install cadius
|
||||
run: >
|
||||
git clone https://github.com/mach-kernel/cadius /tmp/cadius &&
|
||||
make -C /tmp/cadius &&
|
||||
sudo make -C /tmp/cadius install
|
||||
- uses: actions/checkout@v4
|
||||
- uses: a2stuff/build-install-ca65-action@v2
|
||||
- uses: a2stuff/build-install-cadius-action@v1
|
||||
|
||||
- name: build
|
||||
env:
|
||||
@ -35,7 +25,7 @@ jobs:
|
||||
|
||||
- name: deploy new version
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: ncipollo/release-action@v1.8.6
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
artifacts: "out/prodos-path.po"
|
||||
|
@ -36,12 +36,16 @@ Example:
|
||||
Notes:
|
||||
* `PATH` can be invoked as lower case (e.g. `path /hd/cmd`)
|
||||
* Commands can be invoked as lower case (e.g. `hello`)
|
||||
* A relative `PATH` (e.g. `path bin`) only works if an explicit prefix is set.
|
||||
* Note that if no prefix has been set, or if you run `prefix /`, BASIC.SYSTEM will use the last accessed slot and drive and the `PREFIX` command will report that volume as a prefix even though it is empty.
|
||||
|
||||
|
||||
Sample commands included:
|
||||
* `HELLO` - shows a short message, for testing purposes
|
||||
* `ECHO` - echoes back anything following the command
|
||||
* `CD` - like `PREFIX` but accepts `..`, e.g. `cd ../dir`
|
||||
* `ONLINE` - lists online volumes (volume name, slot and drive)
|
||||
* `MEM` - show memory stats for the BASIC environment
|
||||
* `COPY` - copy a single file, e.g. `copy /path/to/file,dstfile`
|
||||
* `TYPE` - show file contents (TXT, BAS, or BIN/other), e.g. `type filename`
|
||||
* `TOUCH` - apply current ProDOS date/time to a file's modification time, e.g. `touch filename`
|
||||
@ -54,6 +58,7 @@ Sample commands included:
|
||||
* `S` and `D` arguments can be used to specify slot and drive.
|
||||
* `BELL` - emits the standard Apple II beep
|
||||
* `BUZZ` - emits the ProDOS "nice little tone"
|
||||
* `HIDE` / `UNHIDE` - sets / clears the "invisible" bit on a file, used in GS/OS Finder
|
||||
|
||||
|
||||
## Instructions For Developers
|
||||
|
12
copy.cmd.s
12
copy.cmd.s
@ -197,6 +197,18 @@ read: lda FN1REF
|
||||
|
||||
|
||||
finish: jsr CloseFiles
|
||||
|
||||
;; Apply FN1 info to FN2 to preserve modification date
|
||||
ldx #$D - 3
|
||||
: lda FN1INFO+3,x
|
||||
sta SSGINFO+3,x
|
||||
dex
|
||||
bpl :-
|
||||
lda #$7
|
||||
sta SSGINFO
|
||||
lda #SET_FILE_INFO
|
||||
jsr GOSYSTEM
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
|
68
hide.cmd.s
Normal file
68
hide.cmd.s
Normal file
@ -0,0 +1,68 @@
|
||||
;;; ============================================================
|
||||
;;;
|
||||
;;; HIDE - Mark a file as invisible
|
||||
;;;
|
||||
;;; Usage: HIDE filename[,S#][,D#]
|
||||
;;;
|
||||
;;; * filename can be relative or absolute path
|
||||
;;;
|
||||
;;; ============================================================
|
||||
|
||||
.include "apple2.inc"
|
||||
.include "more_apple2.inc"
|
||||
.include "prodos.inc"
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
.org $4000
|
||||
|
||||
;; NOTE: Assumes XLEN is set by PATH
|
||||
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
;; Mark command as external (zero).
|
||||
lda #0
|
||||
sta XCNUM
|
||||
|
||||
;; Set accepted parameter flags
|
||||
|
||||
;; Filename
|
||||
lda #PBitsFlags::FN1
|
||||
sta PBITS
|
||||
|
||||
;; Slot & Drive handling
|
||||
lda #PBitsFlags::SD
|
||||
sta PBITS+1
|
||||
|
||||
clc ; Success (so far)
|
||||
rts1: rts ; Return to BASIC.SYSTEM
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
execute:
|
||||
;; Get the existing file info
|
||||
lda #$A
|
||||
sta SSGINFO
|
||||
lda #GET_FILE_INFO
|
||||
jsr GOSYSTEM
|
||||
bcs rts1
|
||||
|
||||
;;; --------------------------------------------------
|
||||
|
||||
;; Clear invisible bit
|
||||
lda FIACESS
|
||||
ora #ACCESS_I
|
||||
sta FIACESS
|
||||
|
||||
;; Set new file info
|
||||
lda #$7
|
||||
sta SSGINFO
|
||||
|
||||
lda #SET_FILE_INFO
|
||||
jmp GOSYSTEM
|
||||
|
||||
;;; --------------------------------------------------
|
76
mem.cmd.s
Normal file
76
mem.cmd.s
Normal file
@ -0,0 +1,76 @@
|
||||
;;; ============================================================
|
||||
;;;
|
||||
;;; MEM - Print memory stats
|
||||
;;;
|
||||
;;; Usage: MEM
|
||||
;;;
|
||||
;;; Inspiration from A2osX
|
||||
;;;
|
||||
;;; ============================================================
|
||||
|
||||
.include "apple2.inc"
|
||||
.include "more_apple2.inc"
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
.org $4000
|
||||
|
||||
jsr CROUT
|
||||
jsr CROUT
|
||||
|
||||
.macro SHOW suffix
|
||||
lda #<.ident(.concat("str_", .string(suffix)))
|
||||
ldx #>.ident(.concat("str_", .string(suffix)))
|
||||
ldy #.ident(.concat("addr_", .string(suffix)))
|
||||
jsr Print
|
||||
.endmacro
|
||||
|
||||
SHOW pgm_start
|
||||
SHOW lomem
|
||||
SHOW array_start
|
||||
SHOW array_end
|
||||
SHOW string_start
|
||||
SHOW himem
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
addr_pgm_start := $67
|
||||
str_pgm_start: .byte "Program start: $", 0
|
||||
addr_lomem := $69
|
||||
str_lomem: .byte "LOMEM: $", 0
|
||||
addr_array_start := $6B
|
||||
str_array_start: .byte "Array start: $", 0
|
||||
addr_array_end := $6D
|
||||
str_array_end: .byte "Array end: $", 0
|
||||
addr_string_start := $6F
|
||||
str_string_start: .byte "String start: $", 0
|
||||
addr_himem := $73
|
||||
str_himem: .byte "HIMEM: $", 0
|
||||
|
||||
.proc Print
|
||||
sta msg_addr
|
||||
stx msg_addr+1
|
||||
iny ; MSB first
|
||||
sty zp_addr
|
||||
|
||||
ldx #0
|
||||
msg_addr := *+1
|
||||
loop: lda $1234,x ; self-modified
|
||||
beq :+
|
||||
ora #$80
|
||||
jsr COUT
|
||||
inx
|
||||
bne loop ; always
|
||||
:
|
||||
jsr getb
|
||||
jsr PRBYTE
|
||||
jsr getb
|
||||
jsr PRBYTE
|
||||
jmp CROUT
|
||||
|
||||
zp_addr := *+1
|
||||
getb: lda $12 ; self-modified
|
||||
dec zp_addr
|
||||
rts
|
||||
.endproc
|
53
path.s
53
path.s
@ -171,16 +171,15 @@ nxtchr: jsr ToUpperASCII
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
;; Mark command as external (zero).
|
||||
lda #0
|
||||
sta XCNUM
|
||||
|
||||
;; Set accepted parameter flags (optional name)
|
||||
lda #PBitsFlags::FNOPT | PBitsFlags::FN1
|
||||
sta PBITS
|
||||
lda #0
|
||||
sta PBITS+1
|
||||
|
||||
;; Mark command as external (zero).
|
||||
sta XCNUM ; A=0 from above
|
||||
|
||||
clc ; Success (so far)
|
||||
rts ; Return to BASIC.SYSTEM
|
||||
|
||||
@ -238,6 +237,7 @@ next_char:
|
||||
;; without preventing 'RUN100' from being typed.
|
||||
|
||||
inx
|
||||
reloc_point *+2
|
||||
jsr ToUpperASCII
|
||||
cmp #'A'
|
||||
bcc not_ours
|
||||
@ -330,7 +330,7 @@ notok: dey
|
||||
|
||||
;; Indicate end of command string for BI's parser (if command uses it)
|
||||
dex
|
||||
stx XLEN
|
||||
stx xlen ; assigned to `XLEN` later
|
||||
|
||||
;; Check to see if path exists.
|
||||
lda #$A ; param length
|
||||
@ -345,14 +345,11 @@ notok: dey
|
||||
bne compose ; wrong type - try next path directory
|
||||
|
||||
;; Tell BASIC.SYSTEM it was handled.
|
||||
lda #0
|
||||
sta XCNUM
|
||||
sta PBITS
|
||||
sta PBITS+1
|
||||
lda #<XRETURN
|
||||
sta XTRNADDR
|
||||
lda #>XRETURN
|
||||
sta XTRNADDR+1
|
||||
ldx #xtrnaddr_len - 1
|
||||
: lda xtrnaddr,x
|
||||
sta XTRNADDR,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
;; MLI/BI trashes part of INBUF (clock driver?), so stash it in upper half.
|
||||
ldx #$7F
|
||||
@ -374,14 +371,12 @@ notok: dey
|
||||
sta RWREFNUM
|
||||
sta CFREFNUM
|
||||
|
||||
lda #<cmd_load_addr
|
||||
sta RWDATA
|
||||
lda #>cmd_load_addr
|
||||
sta RWDATA+1
|
||||
lda #<max_cmd_size
|
||||
sta RWCOUNT
|
||||
lda #>max_cmd_size
|
||||
sta RWCOUNT+1
|
||||
;; Assign `RWDATA` and `RWCOUNT`
|
||||
ldx #rwdata_len - 1
|
||||
: lda rwdata,x
|
||||
sta RWDATA,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
lda #READ
|
||||
jsr GOSYSTEM
|
||||
@ -407,6 +402,22 @@ notok: dey
|
||||
fail_load:
|
||||
rts
|
||||
|
||||
|
||||
;;; Assigned to `XTRNADDR`, `XLEN`, `XCNUM`, and `PBITS`
|
||||
xtrnaddr:
|
||||
.addr XRETURN ; assigned to `XTRNADDR`
|
||||
xlen: .byte 0 ; assigned to `XLEN`
|
||||
.byte 0 ; assigned to `XCNUM`
|
||||
.word 0 ; assigned to `PBITS`
|
||||
xtrnaddr_len = * - xtrnaddr
|
||||
|
||||
|
||||
;;; Assigned to `RWDATA` and `RWCOUNT`
|
||||
rwdata:
|
||||
.addr cmd_load_addr ; assigned to `RWDATA`
|
||||
.word max_cmd_size ; assigned to `RWCOUNT`
|
||||
rwdata_len = * - rwdata
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
execute:
|
||||
|
@ -33,6 +33,13 @@ FT_DIR = $0F
|
||||
FT_CMD = $F0
|
||||
FT_BAS = $FC
|
||||
|
||||
ACCESS_D = %10000000 ; Access: Destroy-Enable
|
||||
ACCESS_RN = %01000000 ; Access: Rename-Enable
|
||||
ACCESS_B = %00100000 ; Access: Backup
|
||||
ACCESS_I = %00000100 ; Access: Invisible
|
||||
ACCESS_W = %00000010 ; Access: Write-Enable
|
||||
ACCESS_R = %00000001 ; Access: Read-Enable
|
||||
|
||||
;;; ============================================================
|
||||
;;; BASIC.SYSTEM Global Page
|
||||
|
||||
|
68
unhide.cmd.s
Normal file
68
unhide.cmd.s
Normal file
@ -0,0 +1,68 @@
|
||||
;;; ============================================================
|
||||
;;;
|
||||
;;; UNHIDE - Mark a file as not invisible
|
||||
;;;
|
||||
;;; Usage: UNHIDE filename[,S#][,D#]
|
||||
;;;
|
||||
;;; * filename can be relative or absolute path
|
||||
;;;
|
||||
;;; ============================================================
|
||||
|
||||
.include "apple2.inc"
|
||||
.include "more_apple2.inc"
|
||||
.include "prodos.inc"
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
.org $4000
|
||||
|
||||
;; NOTE: Assumes XLEN is set by PATH
|
||||
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
;; Mark command as external (zero).
|
||||
lda #0
|
||||
sta XCNUM
|
||||
|
||||
;; Set accepted parameter flags
|
||||
|
||||
;; Filename
|
||||
lda #PBitsFlags::FN1
|
||||
sta PBITS
|
||||
|
||||
;; Slot & Drive handling
|
||||
lda #PBitsFlags::SD
|
||||
sta PBITS+1
|
||||
|
||||
clc ; Success (so far)
|
||||
rts1: rts ; Return to BASIC.SYSTEM
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
execute:
|
||||
;; Get the existing file info
|
||||
lda #$A
|
||||
sta SSGINFO
|
||||
lda #GET_FILE_INFO
|
||||
jsr GOSYSTEM
|
||||
bcs rts1
|
||||
|
||||
;;; --------------------------------------------------
|
||||
|
||||
;; Set invisible bit
|
||||
lda FIACESS
|
||||
and #<(~ACCESS_I)
|
||||
sta FIACESS
|
||||
|
||||
;; Set new file info
|
||||
lda #$7
|
||||
sta SSGINFO
|
||||
|
||||
lda #SET_FILE_INFO
|
||||
jmp GOSYSTEM
|
||||
|
||||
;;; --------------------------------------------------
|
Loading…
Reference in New Issue
Block a user