mirror of
https://github.com/a2stuff/prodos-path.git
synced 2024-06-03 00:29:34 +00:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b63dabb7cd | ||
|
0c01446574 | ||
|
af1c8f1865 | ||
|
3360d44dd7 | ||
|
4bdb0808a2 | ||
|
8cb8f98793 | ||
|
e21c518a06 | ||
|
2c8d464108 | ||
|
e3f59575ed | ||
|
6157963cc8 | ||
|
ecf7459fb3 | ||
|
7587db2f48 | ||
|
68f21a528b | ||
|
8a96373d9d | ||
|
96b87c2180 |
31
.github/workflows/main.yml
vendored
Normal file
31
.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
tags: ['*']
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: a2stuff/build-install-ca65-action@v2
|
||||||
|
- uses: a2stuff/build-install-cadius-action@v1
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
env:
|
||||||
|
TERM: xterm-256color
|
||||||
|
run: >
|
||||||
|
make && make package
|
||||||
|
|
||||||
|
- name: deploy new version
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
artifacts: "out/prodos-path.po"
|
11
.travis.yml
11
.travis.yml
|
@ -1,11 +0,0 @@
|
||||||
sudo: enabled
|
|
||||||
os: linux
|
|
||||||
language: c
|
|
||||||
|
|
||||||
install:
|
|
||||||
- git clone https://github.com/cc65/cc65 /tmp/cc65 &&
|
|
||||||
sudo make -C /tmp/cc65 ca65 ld65 avail &&
|
|
||||||
ca65 --version
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make
|
|
4
COMMANDS
4
COMMANDS
|
@ -7,5 +7,9 @@ copy
|
||||||
date
|
date
|
||||||
echo
|
echo
|
||||||
hello
|
hello
|
||||||
|
mem
|
||||||
online
|
online
|
||||||
type
|
type
|
||||||
|
touch
|
||||||
|
hide
|
||||||
|
unhide
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# CMD executable PATH for ProDOS's BASIC.SYSTEM
|
# CMD executable PATH for ProDOS's BASIC.SYSTEM
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/a2stuff/prodos-path.svg?branch=master)](https://travis-ci.org/a2stuff/prodos-path)
|
[![build](https://github.com/a2stuff/prodos-path/actions/workflows/main.yml/badge.svg)](https://github.com/a2stuff/prodos-path/actions/workflows/main.yml)
|
||||||
|
|
||||||
💾 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 💾
|
||||||
|
|
||||||
|
@ -36,14 +36,19 @@ 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
|
||||||
* `ECHO` - echoes back anything following the command
|
* `ECHO` - echoes back anything following the command
|
||||||
* `CD` - like `PREFIX` but accepts `..`, e.g. `cd ../dir`
|
* `CD` - like `PREFIX` but accepts `..`, e.g. `cd ../dir`
|
||||||
* `ONLINE` - lists online volumes (volume name, slot and drive)
|
* `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`
|
* `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`
|
* `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`
|
||||||
* `DATE` - prints the current ProDOS date and time
|
* `DATE` - prints the current ProDOS date and time
|
||||||
* `CHTYPE` - change the type/auxtype of a file, e.g. `chtype file,T$F1,A$1234`
|
* `CHTYPE` - change the type/auxtype of a file, e.g. `chtype file,T$F1,A$1234`
|
||||||
* `T` (type) and `A` (auxtype) are optional. If neither is specified, current types are shown.
|
* `T` (type) and `A` (auxtype) are optional. If neither is specified, current types are shown.
|
||||||
|
@ -53,6 +58,8 @@ 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
|
||||||
|
|
||||||
|
|
1
cd.cmd.s
1
cd.cmd.s
|
@ -27,7 +27,6 @@
|
||||||
;; Point BI's parser at the command execution routine.
|
;; Point BI's parser at the command execution routine.
|
||||||
lda #<execute
|
lda #<execute
|
||||||
sta XTRNADDR
|
sta XTRNADDR
|
||||||
page_num2 := *+1 ; address needing updating
|
|
||||||
lda #>execute
|
lda #>execute
|
||||||
sta XTRNADDR+1
|
sta XTRNADDR+1
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
;; Point BI's parser at the command execution routine.
|
;; Point BI's parser at the command execution routine.
|
||||||
lda #<execute
|
lda #<execute
|
||||||
sta XTRNADDR
|
sta XTRNADDR
|
||||||
page_num2 := *+1 ; address needing updating
|
|
||||||
lda #>execute
|
lda #>execute
|
||||||
sta XTRNADDR+1
|
sta XTRNADDR+1
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
;; Point BI's parser at the command execution routine.
|
;; Point BI's parser at the command execution routine.
|
||||||
lda #<execute
|
lda #<execute
|
||||||
sta XTRNADDR
|
sta XTRNADDR
|
||||||
page_num2 := *+1 ; address needing updating
|
|
||||||
lda #>execute
|
lda #>execute
|
||||||
sta XTRNADDR+1
|
sta XTRNADDR+1
|
||||||
|
|
||||||
|
|
13
copy.cmd.s
13
copy.cmd.s
|
@ -21,7 +21,6 @@
|
||||||
;; Point BI's parser at the command execution routine.
|
;; Point BI's parser at the command execution routine.
|
||||||
lda #<execute
|
lda #<execute
|
||||||
sta XTRNADDR
|
sta XTRNADDR
|
||||||
page_num2 := *+1 ; address needing updating
|
|
||||||
lda #>execute
|
lda #>execute
|
||||||
sta XTRNADDR+1
|
sta XTRNADDR+1
|
||||||
|
|
||||||
|
@ -198,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
|
||||||
|
|
||||||
|
;;; --------------------------------------------------
|
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
|
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
|
||||||
|
|
||||||
|
@ -238,6 +237,7 @@ next_char:
|
||||||
;; without preventing 'RUN100' from being typed.
|
;; without preventing 'RUN100' from being typed.
|
||||||
|
|
||||||
inx
|
inx
|
||||||
|
reloc_point *+2
|
||||||
jsr ToUpperASCII
|
jsr ToUpperASCII
|
||||||
cmp #'A'
|
cmp #'A'
|
||||||
bcc not_ours
|
bcc not_ours
|
||||||
|
@ -330,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
|
||||||
|
@ -345,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
|
||||||
|
@ -374,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
|
||||||
|
@ -407,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
|
||||||
|
|
||||||
|
|
63
touch.cmd.s
Normal file
63
touch.cmd.s
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
;;; ============================================================
|
||||||
|
;;;
|
||||||
|
;;; TOUCH - Apply current ProDOS date/time stamp to file
|
||||||
|
;;;
|
||||||
|
;;; Usage: TOUCH filename[,S#][,D#]
|
||||||
|
;;;
|
||||||
|
;;; * filename can be relative or absolute path
|
||||||
|
;;;
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
.include "apple2.inc"
|
||||||
|
.include "more_apple2.inc"
|
||||||
|
.include "prodos.inc"
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
.org $4000
|
||||||
|
|
||||||
|
;; 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
|
||||||
|
|
||||||
|
;; Apply time/date stamp
|
||||||
|
ldx #3
|
||||||
|
: lda DATE,x
|
||||||
|
sta FIMDATE,x
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
;; Set new file info
|
||||||
|
lda #$7
|
||||||
|
sta SSGINFO
|
||||||
|
lda #SET_FILE_INFO
|
||||||
|
jmp GOSYSTEM
|
|
@ -21,7 +21,6 @@
|
||||||
;; Point BI's parser at the command execution routine.
|
;; Point BI's parser at the command execution routine.
|
||||||
lda #<execute
|
lda #<execute
|
||||||
sta XTRNADDR
|
sta XTRNADDR
|
||||||
page_num2 := *+1 ; address needing updating
|
|
||||||
lda #>execute
|
lda #>execute
|
||||||
sta XTRNADDR+1
|
sta XTRNADDR+1
|
||||||
|
|
||||||
|
|
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