2015-03-14 21:48:35 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2015-03-14 21:48:35 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # GetFullPath.YA
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2017-08-28 15:35:10 +00:00
|
|
|
|
* Y,A = Filename (C-String)
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-11-01 14:37:28 +00:00
|
|
|
|
* CC : success
|
2017-08-28 15:35:10 +00:00
|
|
|
|
* Y,A = FullPath (C-String)
|
2016-11-01 14:37:28 +00:00
|
|
|
|
* X = hMem of FullPath
|
|
|
|
|
* CS : A = Error Code
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*\--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.GetFullPath.YA
|
2017-08-28 15:35:10 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-09-08 14:49:23 +00:00
|
|
|
|
ldx #0
|
2017-08-28 15:35:10 +00:00
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
beq .8
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
cmp #'/' full path starting with '/'?
|
2017-08-28 15:35:10 +00:00
|
|
|
|
beq .2 yes, do not append to current prefix
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMemPtr.A
|
2017-08-28 15:35:10 +00:00
|
|
|
|
>STYA ZPPtr2
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-08-28 15:35:10 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr2),y
|
|
|
|
|
beq .2
|
|
|
|
|
sta K.Buf256,x
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.2 ldy #0
|
|
|
|
|
|
|
|
|
|
.3 lda (ZPPtr1),y
|
|
|
|
|
beq .8
|
|
|
|
|
sta K.Buf256,x
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
.8 stz K.Buf256,x
|
2017-08-24 12:46:48 +00:00
|
|
|
|
>LDYAI K.Buf256
|
2017-09-08 14:49:23 +00:00
|
|
|
|
jsr K.NewStr.YA
|
2016-10-06 15:50:20 +00:00
|
|
|
|
rts
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # LoadFile
|
|
|
|
|
* ## 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-09-12 15:24:36 +00:00
|
|
|
|
K.LoadFile lda (pStack) read PTR.LO on top of stack
|
2017-06-21 15:46:43 +00:00
|
|
|
|
pha
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y read PTR.HI on top of stack
|
|
|
|
|
pha
|
|
|
|
|
>PUSHWI K.S.STAT
|
|
|
|
|
pla
|
|
|
|
|
ply
|
|
|
|
|
>PUSHYA
|
|
|
|
|
jsr K.Stat
|
|
|
|
|
bcs .10
|
2016-09-20 16:00:51 +00:00
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
lda K.S.STAT+S.STAT.SIZE+3
|
|
|
|
|
ora K.S.STAT+S.STAT.SIZE+2
|
|
|
|
|
bne .11
|
|
|
|
|
|
2017-07-01 13:44:40 +00:00
|
|
|
|
>LDYA K.S.STAT+S.STAT.SIZE push len
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem.YA
|
2017-06-21 15:46:43 +00:00
|
|
|
|
bcs .10
|
2016-09-21 15:20:37 +00:00
|
|
|
|
>STYA K.LoadFile.Mem
|
2017-06-21 15:46:43 +00:00
|
|
|
|
stx K.LoadFile.hMem
|
2016-09-20 16:00:51 +00:00
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
jsr K.FOpen
|
|
|
|
|
bcs .9
|
|
|
|
|
sta K.LoadFile.hFile
|
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
>PUSHW K.LoadFile.Mem
|
2017-06-21 15:46:43 +00:00
|
|
|
|
>PUSHW K.S.STAT+S.STAT.SIZE
|
2016-09-21 15:20:37 +00:00
|
|
|
|
>PUSHB K.LoadFile.hFile
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr K.FRead
|
2016-09-30 15:04:55 +00:00
|
|
|
|
bcs .97
|
2017-06-21 15:46:43 +00:00
|
|
|
|
|
|
|
|
|
phy
|
|
|
|
|
pha Save Bytes read
|
2016-09-20 16:00:51 +00:00
|
|
|
|
|
|
|
|
|
jsr .99
|
2016-09-21 15:20:37 +00:00
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
pla
|
|
|
|
|
ply
|
2016-09-21 15:20:37 +00:00
|
|
|
|
ldx K.LoadFile.hMem
|
2016-09-20 16:00:51 +00:00
|
|
|
|
clc
|
2016-09-21 15:20:37 +00:00
|
|
|
|
.9 rts
|
2016-09-30 15:04:55 +00:00
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.11 lda #SYSMGR.ERRFTB
|
|
|
|
|
.10 pha
|
|
|
|
|
>POP 6
|
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-09-30 15:04:55 +00:00
|
|
|
|
.97 pha
|
|
|
|
|
lda K.LoadFile.hMem
|
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
|
2016-09-21 15:20:37 +00:00
|
|
|
|
lda K.LoadFile.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-06-21 15:46:43 +00:00
|
|
|
|
K.LoadFile.hFile .BS 1
|
|
|
|
|
K.LoadFile.hMem .BS 1
|
|
|
|
|
K.LoadFile.Mem .BS 2
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # SaveFile
|
|
|
|
|
* ## In:
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* PUSHW = SrcPtr
|
2017-04-12 15:46:03 +00:00
|
|
|
|
* PUSHW = SrcLen
|
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)
|
2016-10-26 20:51:06 +00:00
|
|
|
|
*\--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
K.SaveFile jsr K.FOpen
|
2016-09-20 16:00:51 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
sta .90+1
|
2016-09-20 16:00:51 +00:00
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
>PUSHA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr K.FWrite
|
2016-09-20 16:00:51 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr .99
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.99 pha
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.90 lda #$ff
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.FClose.A
|
2016-09-20 16:00:51 +00:00
|
|
|
|
pla
|
|
|
|
|
sec
|
2017-08-24 15:29:22 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.9 pha
|
|
|
|
|
>POP 4 Discard SrcPtr & SrcLen
|
|
|
|
|
pla
|
2016-10-21 15:03:41 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
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
|
|
|
|
|
>PULLW K.MLI.PARAMS+1
|
|
|
|
|
>PULLB .1+1
|
|
|
|
|
>MLICALL MLIGETFILEINFO
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.1 lda #$ff
|
|
|
|
|
sta K.MLI.PARAMS+S.FILEINFO.TYPE
|
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
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*/--------------------------------------
|
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
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # 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
|