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
|
|
|
|
*/--------------------------------------
|
2017-10-19 06:19:54 +00:00
|
|
|
|
* # LoadTxtFile.YA
|
|
|
|
|
* Load TXT a file in memory (with ending 0)
|
|
|
|
|
* ## In:
|
|
|
|
|
* Y,A = File Path
|
|
|
|
|
* ## Out:
|
|
|
|
|
* Y,A = File Length (without ending 0)
|
|
|
|
|
* X = hMem of Loaded File
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.LoadTxtFile.YA
|
|
|
|
|
pha
|
|
|
|
|
>PUSHWI 0 Aux type
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHBI 4 S.FI.T.TXT
|
2017-10-19 06:19:54 +00:00
|
|
|
|
>PUSHBI SYS.FOpen.R
|
|
|
|
|
pla
|
|
|
|
|
>PUSHYA
|
|
|
|
|
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
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In:
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* PUSHW = AUXTYPE (Handled by....
|
|
|
|
|
* PUSHB = TYPE ...
|
|
|
|
|
* PUSHB = MODE ...
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* PUSHW = PATH ...FOpen)
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out:
|
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
|
2017-10-19 06:19:54 +00:00
|
|
|
|
|
|
|
|
|
jsr K.FOpen
|
2017-10-09 15:30:48 +00:00
|
|
|
|
bcs .9
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta FIO.hFile
|
2016-09-20 16:00:51 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr FIO.GetSize
|
2017-10-09 15:30:48 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>LDYA FIO.FSize
|
2017-10-19 06:19:54 +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
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #K.E.FTB
|
2017-10-19 06:19:54 +00:00
|
|
|
|
bra .99
|
|
|
|
|
|
|
|
|
|
.1 jsr K.GetMem.YA
|
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
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHW FIO.Mem
|
|
|
|
|
>PUSHW FIO.FSize
|
|
|
|
|
>PUSHB 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
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.FreeMem.A
|
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
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.FClose.A
|
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.GetSize stz FIO.FPos
|
|
|
|
|
stz FIO.FPos+1
|
|
|
|
|
stz FIO.FPos+2
|
|
|
|
|
stz FIO.FPos+3
|
2017-10-09 15:30:48 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHWI FIO.FPos
|
2017-10-09 15:30:48 +00:00
|
|
|
|
>PUSHBI SYS.FSeek.END
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHB FIO.hFile
|
2017-10-09 15:30:48 +00:00
|
|
|
|
jsr K.FSeek
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHWI FIO.FPos
|
|
|
|
|
>PUSHB FIO.hFile
|
2017-10-09 15:30:48 +00:00
|
|
|
|
jsr K.FTell
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
lda FIO.FPos+2
|
|
|
|
|
ora FIO.FPos+3
|
2017-10-09 15:30:48 +00:00
|
|
|
|
bne .98 too big!
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>LDYA FIO.FPos
|
|
|
|
|
>STYA FIO.FSize
|
2017-10-09 15:30:48 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
stz FIO.FPos
|
|
|
|
|
stz FIO.FPos+1
|
2017-10-09 15:30:48 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHWI FIO.FPos
|
2017-10-09 15:30:48 +00:00
|
|
|
|
>PUSHBI SYS.FSeek.SET
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHB FIO.hFile
|
2017-10-09 15:30:48 +00:00
|
|
|
|
jmp K.FSeek
|
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
.98 lda #K.E.FTB
|
2017-10-09 15:30:48 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
FIO.bTXT .BS 1
|
|
|
|
|
FIO.hFile .BS 1
|
|
|
|
|
FIO.FPos .BS 4
|
|
|
|
|
FIO.Mem .BS 2
|
|
|
|
|
FIO.FSize .BS 2
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-04-03 21:13:46 +00:00
|
|
|
|
* # ChTyp
|
|
|
|
|
* ## In:
|
2017-04-04 13:07:58 +00:00
|
|
|
|
* PUSHB = TYPE
|
|
|
|
|
* PUSHW = PATH
|
2017-04-03 21:13:46 +00:00
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.ChTyp jsr PFT.CheckPathSTK
|
2017-10-04 15:12:03 +00:00
|
|
|
|
jsr STDIO.PullMLIPath
|
2017-04-03 21:13:46 +00:00
|
|
|
|
>PULLB .1+1
|
|
|
|
|
>MLICALL MLIGETFILEINFO
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.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
|
|
|
|
|
* ## In:
|
|
|
|
|
* PUSHW = UID
|
|
|
|
|
* PUSHW = PATH
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.ChMod
|
|
|
|
|
*/--------------------------------------
|
2017-04-03 21:13:46 +00:00
|
|
|
|
* # ChOwn
|
|
|
|
|
* ## In:
|
2017-04-04 13:07:58 +00:00
|
|
|
|
* PUSHW = UID
|
|
|
|
|
* PUSHW = PATH
|
2017-04-03 21:13:46 +00:00
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.ChOwn
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # ChGrp
|
|
|
|
|
* ## 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
|