mirror of
https://github.com/a2stuff/prodos-path.git
synced 2024-06-08 18:29:30 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b63dabb7cd | ||
|
0c01446574 | ||
|
af1c8f1865 | ||
|
3360d44dd7 | ||
|
4bdb0808a2 | ||
|
8cb8f98793 | ||
|
e21c518a06 |
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
|
@ -13,8 +13,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- uses: a2stuff/build-install-ca65-action@v1
|
- uses: a2stuff/build-install-ca65-action@v2
|
||||||
- uses: a2stuff/build-install-cadius-action@v1
|
- uses: a2stuff/build-install-cadius-action@v1
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
|
@ -25,7 +25,7 @@ jobs:
|
||||||
|
|
||||||
- name: deploy new version
|
- name: deploy new version
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: ncipollo/release-action@v1.8.6
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
artifacts: "out/prodos-path.po"
|
artifacts: "out/prodos-path.po"
|
||||||
|
|
|
@ -36,6 +36,9 @@ Example:
|
||||||
Notes:
|
Notes:
|
||||||
* `PATH` can be invoked as lower case (e.g. `path /hd/cmd`)
|
* `PATH` can be invoked as lower case (e.g. `path /hd/cmd`)
|
||||||
* Commands can be invoked as lower case (e.g. `hello`)
|
* 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:
|
Sample commands included:
|
||||||
* `HELLO` - shows a short message, for testing purposes
|
* `HELLO` - shows a short message, for testing purposes
|
||||||
|
@ -55,6 +58,7 @@ Sample commands included:
|
||||||
* `S` and `D` arguments can be used to specify slot and drive.
|
* `S` and `D` arguments can be used to specify slot and drive.
|
||||||
* `BELL` - emits the standard Apple II beep
|
* `BELL` - emits the standard Apple II beep
|
||||||
* `BUZZ` - emits the ProDOS "nice little tone"
|
* `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
|
## Instructions For Developers
|
||||||
|
|
12
copy.cmd.s
12
copy.cmd.s
|
@ -197,6 +197,18 @@ read: lda FN1REF
|
||||||
|
|
||||||
|
|
||||||
finish: jsr CloseFiles
|
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
|
clc
|
||||||
rts
|
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
|
||||||
|
|
||||||
|
;;; --------------------------------------------------
|
52
path.s
52
path.s
|
@ -171,16 +171,15 @@ nxtchr: jsr ToUpperASCII
|
||||||
lda #>execute
|
lda #>execute
|
||||||
sta XTRNADDR+1
|
sta XTRNADDR+1
|
||||||
|
|
||||||
;; Mark command as external (zero).
|
|
||||||
lda #0
|
|
||||||
sta XCNUM
|
|
||||||
|
|
||||||
;; Set accepted parameter flags (optional name)
|
;; Set accepted parameter flags (optional name)
|
||||||
lda #PBitsFlags::FNOPT | PBitsFlags::FN1
|
lda #PBitsFlags::FNOPT | PBitsFlags::FN1
|
||||||
sta PBITS
|
sta PBITS
|
||||||
lda #0
|
lda #0
|
||||||
sta PBITS+1
|
sta PBITS+1
|
||||||
|
|
||||||
|
;; Mark command as external (zero).
|
||||||
|
sta XCNUM ; A=0 from above
|
||||||
|
|
||||||
clc ; Success (so far)
|
clc ; Success (so far)
|
||||||
rts ; Return to BASIC.SYSTEM
|
rts ; Return to BASIC.SYSTEM
|
||||||
|
|
||||||
|
@ -331,7 +330,7 @@ notok: dey
|
||||||
|
|
||||||
;; Indicate end of command string for BI's parser (if command uses it)
|
;; Indicate end of command string for BI's parser (if command uses it)
|
||||||
dex
|
dex
|
||||||
stx XLEN
|
stx xlen ; assigned to `XLEN` later
|
||||||
|
|
||||||
;; Check to see if path exists.
|
;; Check to see if path exists.
|
||||||
lda #$A ; param length
|
lda #$A ; param length
|
||||||
|
@ -346,14 +345,11 @@ notok: dey
|
||||||
bne compose ; wrong type - try next path directory
|
bne compose ; wrong type - try next path directory
|
||||||
|
|
||||||
;; Tell BASIC.SYSTEM it was handled.
|
;; Tell BASIC.SYSTEM it was handled.
|
||||||
lda #0
|
ldx #xtrnaddr_len - 1
|
||||||
sta XCNUM
|
: lda xtrnaddr,x
|
||||||
sta PBITS
|
sta XTRNADDR,x
|
||||||
sta PBITS+1
|
dex
|
||||||
lda #<XRETURN
|
bpl :-
|
||||||
sta XTRNADDR
|
|
||||||
lda #>XRETURN
|
|
||||||
sta XTRNADDR+1
|
|
||||||
|
|
||||||
;; MLI/BI trashes part of INBUF (clock driver?), so stash it in upper half.
|
;; MLI/BI trashes part of INBUF (clock driver?), so stash it in upper half.
|
||||||
ldx #$7F
|
ldx #$7F
|
||||||
|
@ -375,14 +371,12 @@ notok: dey
|
||||||
sta RWREFNUM
|
sta RWREFNUM
|
||||||
sta CFREFNUM
|
sta CFREFNUM
|
||||||
|
|
||||||
lda #<cmd_load_addr
|
;; Assign `RWDATA` and `RWCOUNT`
|
||||||
sta RWDATA
|
ldx #rwdata_len - 1
|
||||||
lda #>cmd_load_addr
|
: lda rwdata,x
|
||||||
sta RWDATA+1
|
sta RWDATA,x
|
||||||
lda #<max_cmd_size
|
dex
|
||||||
sta RWCOUNT
|
bpl :-
|
||||||
lda #>max_cmd_size
|
|
||||||
sta RWCOUNT+1
|
|
||||||
|
|
||||||
lda #READ
|
lda #READ
|
||||||
jsr GOSYSTEM
|
jsr GOSYSTEM
|
||||||
|
@ -408,6 +402,22 @@ notok: dey
|
||||||
fail_load:
|
fail_load:
|
||||||
rts
|
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:
|
execute:
|
||||||
|
|
|
@ -33,6 +33,13 @@ FT_DIR = $0F
|
||||||
FT_CMD = $F0
|
FT_CMD = $F0
|
||||||
FT_BAS = $FC
|
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
|
;;; 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