2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2018-06-21 15:12:10 +00:00
|
|
|
|
* # LoadTxtFile
|
2017-10-19 06:19:54 +00:00
|
|
|
|
* Load TXT a file in memory (with ending 0)
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* **In:**
|
2017-10-19 06:19:54 +00:00
|
|
|
|
* Y,A = File Path
|
2018-10-11 15:23:06 +00:00
|
|
|
|
* ## RETURN VALUE
|
2017-10-19 06:19:54 +00:00
|
|
|
|
* Y,A = File Length (without ending 0)
|
|
|
|
|
* X = hMem of Loaded File
|
|
|
|
|
*\--------------------------------------
|
2018-06-21 15:12:10 +00:00
|
|
|
|
K.LoadTxtFile pha
|
2017-10-19 06:19:54 +00:00
|
|
|
|
>PUSHWI 0 Aux type
|
2018-10-02 15:52:30 +00:00
|
|
|
|
>PUSHBI S.FI.T.TXT
|
|
|
|
|
>PUSHBI O.RDONLY
|
2017-10-19 06:19:54 +00:00
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
.HS 90 BCC
|
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # LoadFile
|
2017-10-19 06:19:54 +00:00
|
|
|
|
* Load a file in memory
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* **In:**
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* PUSHW = AUXTYPE (Handled by....
|
|
|
|
|
* PUSHB = TYPE ...
|
|
|
|
|
* PUSHB = MODE ...
|
2018-07-25 15:26:14 +00:00
|
|
|
|
* LDYA = PATH ...FOpen)
|
2018-10-11 15:23:06 +00:00
|
|
|
|
* ## RETURN VALUE
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* Y,A = File Length
|
|
|
|
|
* X = hMem of Loaded File
|
|
|
|
|
*\--------------------------------------
|
2017-10-19 06:19:54 +00:00
|
|
|
|
K.LoadFile clc
|
2017-10-27 14:56:46 +00:00
|
|
|
|
ror FIO.bTXT
|
2018-08-08 15:13:37 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
jsr K.FOpen
|
2018-08-08 15:13:37 +00:00
|
|
|
|
bcc .12
|
|
|
|
|
rts
|
2018-11-07 06:59:37 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
.12 sta FIO.hFile
|
2018-11-07 06:59:37 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
pha
|
|
|
|
|
>PUSHWI K.S.Stat
|
|
|
|
|
pla
|
2018-11-07 06:59:37 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
jsr K.FStat
|
|
|
|
|
bcs .11
|
|
|
|
|
|
|
|
|
|
lda K.S.Stat+S.STAT.SIZE+3
|
|
|
|
|
ora K.S.Stat+S.STAT.SIZE+2
|
|
|
|
|
bne .10
|
|
|
|
|
|
|
|
|
|
>LDYA K.S.Stat+S.STAT.SIZE
|
2018-11-07 06:59:37 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
bit FIO.bTXT Add 1 to buffer size for ending 0
|
2017-10-19 06:19:54 +00:00
|
|
|
|
bpl .1
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
inc
|
|
|
|
|
bne .1
|
2018-08-08 15:13:37 +00:00
|
|
|
|
|
2018-10-21 20:54:07 +00:00
|
|
|
|
.10 lda #E.FTB
|
2018-08-08 15:13:37 +00:00
|
|
|
|
.11 bra .99
|
2017-10-19 06:19:54 +00:00
|
|
|
|
|
2018-06-21 15:12:10 +00:00
|
|
|
|
.1 jsr K.GetMem
|
2017-10-09 15:30:48 +00:00
|
|
|
|
bcs .99
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>STYA FIO.Mem
|
2017-09-29 06:36:27 +00:00
|
|
|
|
stx .8+1
|
2017-10-09 15:30:48 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
>PUSHW K.S.Stat+S.STAT.SIZE
|
2018-07-25 15:26:14 +00:00
|
|
|
|
>PUSHW FIO.Mem
|
2018-07-24 16:00:24 +00:00
|
|
|
|
lda FIO.hFile
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr K.FRead
|
2017-10-19 06:19:54 +00:00
|
|
|
|
bcs .98
|
2017-06-21 15:46:43 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
sty .6+1
|
|
|
|
|
sta .7+1 Save Bytes read
|
2016-09-20 16:00:51 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
jsr .99 close file
|
2016-09-21 15:20:37 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
bit FIO.bTXT
|
2017-10-19 06:19:54 +00:00
|
|
|
|
bpl .6
|
|
|
|
|
|
|
|
|
|
clc set ending 0
|
|
|
|
|
lda .6+1
|
2017-10-27 14:56:46 +00:00
|
|
|
|
adc FIO.Mem
|
2017-10-19 06:19:54 +00:00
|
|
|
|
sta .5+1
|
|
|
|
|
lda .7+1
|
2017-10-27 14:56:46 +00:00
|
|
|
|
adc FIO.Mem+1
|
2017-10-19 06:19:54 +00:00
|
|
|
|
sta .5+2
|
|
|
|
|
|
|
|
|
|
.5 stz $ffff Self Modified
|
|
|
|
|
|
|
|
|
|
.6 ldy #$ff Self Modified
|
|
|
|
|
.7 lda #$ff Self Modified
|
2017-09-29 06:36:27 +00:00
|
|
|
|
.8 ldx #$ff Self Modified
|
2016-09-20 16:00:51 +00:00
|
|
|
|
clc
|
2016-09-21 15:20:37 +00:00
|
|
|
|
.9 rts
|
2017-06-21 15:46:43 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
.98 pha
|
2017-09-29 06:36:27 +00:00
|
|
|
|
lda .8+1
|
2018-06-22 06:24:35 +00:00
|
|
|
|
jsr K.FreeMem
|
2016-09-30 15:04:55 +00:00
|
|
|
|
pla
|
2016-09-21 15:20:37 +00:00
|
|
|
|
|
2016-09-20 16:00:51 +00:00
|
|
|
|
.99 pha
|
2017-10-27 14:56:46 +00:00
|
|
|
|
lda FIO.hFile
|
2018-06-22 06:24:35 +00:00
|
|
|
|
jsr K.FClose
|
2016-09-20 16:00:51 +00:00
|
|
|
|
pla
|
|
|
|
|
sec
|
2016-09-21 15:20:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
FIO.bTXT .BS 1
|
|
|
|
|
FIO.hFile .BS 1
|
|
|
|
|
FIO.Mem .BS 2
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-04-03 21:13:46 +00:00
|
|
|
|
* # ChTyp
|
2018-09-05 15:22:46 +00:00
|
|
|
|
* Change The type of a ProDOS File
|
|
|
|
|
* ## C
|
|
|
|
|
* `int chtyp(const char *filepath, const char filetype);`
|
|
|
|
|
* ## ASM
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* **In:**
|
2018-09-05 15:22:46 +00:00
|
|
|
|
* `>PUSHBI filetype`
|
|
|
|
|
* `>LDYA filepath`
|
|
|
|
|
* `>SYSCALL chtyp`
|
2018-10-11 15:23:06 +00:00
|
|
|
|
* ## RETURN VALUE
|
2017-04-03 21:13:46 +00:00
|
|
|
|
*\--------------------------------------
|
2018-09-05 15:22:46 +00:00
|
|
|
|
K.ChTyp jsr PFT.CheckPathYA
|
|
|
|
|
jsr STDIO.SetMLIPathYA
|
2017-04-03 21:13:46 +00:00
|
|
|
|
>PULLB .1+1
|
|
|
|
|
>MLICALL MLIGETFILEINFO
|
|
|
|
|
bcs .9
|
2018-11-07 06:59:37 +00:00
|
|
|
|
|
2017-04-03 21:13:46 +00:00
|
|
|
|
.1 lda #$ff
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta K.MLI.PARAMS+S.FI.T
|
2017-04-04 13:07:58 +00:00
|
|
|
|
>MLICALL MLISETFILEINFO
|
2017-04-03 21:13:46 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # ChMod
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* **In:**
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* PUSHW = UID
|
|
|
|
|
* PUSHW = PATH
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.ChMod
|
|
|
|
|
*/--------------------------------------
|
2017-04-03 21:13:46 +00:00
|
|
|
|
* # ChOwn
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* **In:**
|
2018-09-05 15:22:46 +00:00
|
|
|
|
* PUSHW = mod
|
2017-04-04 13:07:58 +00:00
|
|
|
|
* PUSHW = PATH
|
2017-04-03 21:13:46 +00:00
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.ChOwn
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # ChGrp
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* **In:**
|
2017-04-04 13:07:58 +00:00
|
|
|
|
* PUSHW = GID
|
|
|
|
|
* PUSHW = PATH
|
2017-04-03 21:13:46 +00:00
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.ChGrp
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2016-01-09 22:40:19 +00:00
|
|
|
|
*--------------------------------------
|
2015-03-14 21:48:35 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.FIO
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ASM
|