SYS.LoadFileYA,SYS.LoadFileA now Expand pathnames

This commit is contained in:
Rémy GIBERT 2016-01-09 23:40:19 +01:00
parent 2bc2428de2
commit 3a3ae6d302

View File

@ -106,16 +106,16 @@ S.FileSearch.hFull .BS 1
* Y,A = File Length * Y,A = File Length
* X = hMem of Loaded File * X = hMem of Loaded File
*-------------------------------------- *--------------------------------------
S.LoadFileA jsr S.MLIOpenA S.LoadFileA jsr S.GetMemPtrA
bcc S.LoadFile S.LoadFileYA jsr S.ExpandPStrYA
sta S.LoadFile.hExp
jsr S.GetMemPtrA
jsr S.MLIOpenYA
bcc .10
jmp .99
S.LoadFile.RTS rts .10 sta S.LoadFile.hRef save ref_num
stx S.LoadFile.hBuf save Prodos Buffer for freemem
S.LoadFileYA jsr S.MLIOpenYA
bcs S.LoadFile.RTS
S.LoadFile sta R.AL save ref_num
stx R.AH save Prodos Buffer for freemem
jsr S.MLIGetEOFA jsr S.MLIGetEOFA
bcs .98 bcs .98
@ -125,45 +125,58 @@ S.LoadFile sta R.AL save ref_num
lda #SYSMGR.ERRFTB lda #SYSMGR.ERRFTB
bra .98 bra .98
.1 >STYA R.BX save Length .1 >STYA S.LoadFile.Len save Length
>PUSHYA Push Length for S.GetMem >PUSHYA Push Length for S.GetMem
>PUSHBI 0 >PUSHBI 0
jsr S.GetMem jsr S.GetMem
bcs .98 bcs .98
>STYA R.CX phy save Ptr
stx R.DL save Segment hMem pha
>PUSHW R.BX Push Length for S.ReadFile stx S.LoadFile.hMem save Segment hMem
>PUSHW R.CX Push Dest PTR >PUSHW S.LoadFile.Len Push Length for S.MLIRead
>PUSHB R.AL Push ref_num pla restore Dest PTR
ply
>PUSHYA and push for S.MLIRead
>PUSHB S.LoadFile.hRef Push ref_num
jsr S.MLIRead jsr S.MLIRead
bcs .97 bcs .97
lda R.AL lda S.LoadFile.hRef
jsr S.MLICloseA jsr S.MLICloseA
lda R.AH lda S.LoadFile.hBuf
jsr S.FreeMemA Discard ProDOS IO Buffer jsr S.FreeMemA Discard ProDOS IO Buffer
>LDYA R.BX Return File Length... >LDYA S.LoadFile.Len Return File Length...
ldx R.DL ...and hMem to Caller ldx S.LoadFile.hMem ...and hMem to Caller
clc clc
rts rts
.97 pha .97 pha
lda R.DL lda S.LoadFile.hMem
jsr S.FreeMemA freemem because of failed load jsr S.FreeMemA freemem because of failed load
pla pla
.98 pha .98 pha
lda R.AL lda S.LoadFile.hRef
jsr S.MLICloseA jsr S.MLICloseA
lda R.AH lda S.LoadFile.hBuf
jsr S.FreeMemA ProDOS IO Buffer jsr S.FreeMemA ProDOS IO Buffer
pla pla
.99 sec .99 pha
lda S.LoadFile.hExp
jsr S.FreeMemA
pla
sec
rts rts
*-------------------------------------- *--------------------------------------
S.LoadFile.hRef .BS 1
S.LoadFile.hBuf .BS 1
S.LoadFile.hExp .BS 1
S.LoadFile.hMem .BS 1
S.LoadFile.Len .BS 2
*--------------------------------------
* S.ListDirInitA * S.ListDirInitA
* in : * in :
* A = PATH (PSTR) /DIR,/DIR/*.?s * A = PATH (PSTR) /DIR,/DIR/*.?s