LS / FILEENUM : 2 passes enabled & code cleanup......and i also SAVE BYTES....pffff!

This commit is contained in:
Rémy GIBERT 2021-06-10 16:00:05 +02:00
parent 1304a9a076
commit b044632bcd
2 changed files with 243 additions and 154 deletions

View File

@ -25,13 +25,23 @@ ZPPtr2 .BS 2
ZPFileName .BS 2 ZPFileName .BS 2
ZPFileStat .BS 2 ZPFileStat .BS 2
ZPPW .BS 2
bCRLF .BS 1
hLineBuf .BS 1
ZPLineBuf .BS 2 ZPLineBuf .BS 2
ZS.END ZPPWBuf .BS 2
.ED
ArgCount .BS 1
ColCount .BS 1
bPass2 .BS 1
bPause .BS 1
bAllmostAll .BS 1
bColumn .BS 1
bFullPath .BS 1
bLong .BS 1
bRecurse .BS 1
ZS.END .ED
*-------------------------------------- *--------------------------------------
* File Header (16 Bytes) * File Header (16 Bytes)
*-------------------------------------- *--------------------------------------
@ -79,7 +89,8 @@ CS.INIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN CS.RUN
.1 >INC.G ArgCount .1 inc ArgCount
lda ArgCount
>SYSCALL ArgV >SYSCALL ArgV
bcs .6 bcs .6
@ -95,6 +106,7 @@ CS.RUN
.2 cmp OptionList,x .2 cmp OptionList,x
beq .3 beq .3
dex dex
bpl .2 bpl .2
@ -104,12 +116,13 @@ CS.RUN
.3 ldy OptionVars,x .3 ldy OptionVars,x
lda #$80 lda #$80
sta (pData),y sta $0,y
bra .1 bra .1
.4 >LDYA ZPPtr1 .4 >LDYA ZPPtr1
jsr InitSrcDirYA jsr InitSrcDirYA
bcc .1 scan for any other args bcc .1 scan for any other args
.9 rts .9 rts
.6 >LDA.G index do we have a Source dir ? .6 >LDA.G index do we have a Source dir ?
@ -127,32 +140,23 @@ CS.RUN
>LDYAI S.PW >LDYAI S.PW
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
>STYA ZPPW
>STYA ZPPWBuf
txa txa
>STA.G hPW >STA.G hPWBuf
>LDYAI 256 >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
>STYA ZPLineBuf >STYA ZPLineBuf
stx hLineBuf txa
* ldy #S.PS.hStdOut >STA.G hLineBuf
* lda (pPS),y
* tax
* lda OF.Table.hFD-1,x
* >SYSCALL GetMemPtr
* >STYA ZPPtr1
* lda (ZPPtr1) S.FD.T
* beq CS.RUN.LOOP S.FD.T.REG
* cmp #S.FD.T.PIPE
* beq CS.RUN.LOOP
dec bCRLF
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP stz bPass2
.1 ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL FEOF >SYSCALL FEOF
bcs .99 I/O error bcs .99 I/O error
@ -162,20 +166,18 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
>SYSCALL GetChar >SYSCALL GetChar
cmp #$03 Ctrl-C cmp #$03 Ctrl-C
bne .1 Abort.... beq .99 Abort....
rts CS cmp #$13 Ctrl-S
.1 cmp #$13 Ctrl-S
bne .2 bne .2
>LDA.G bPause lda bPause
eor #$ff eor #$ff
sta (pData),y sta bPause
bne CS.RUN.LOOP bne .1
.2 >LDA.G bPause .2 bit bPause
bne CS.RUN.LOOP bmi .1
jsr GetEntry jsr GetEntry
bcs .9 bcs .9
@ -183,7 +185,7 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
jsr FilterMatch jsr FilterMatch
bcs .8 no match, skip.... bcs .8 no match, skip....
>LDA.G bAllmostAll bit bAllmostAll
bmi .4 bmi .4
lda (ZPFileName) lda (ZPFileName)
@ -202,11 +204,18 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
bcs .99 bcs .99
.8 jsr GetNextEntry .8 jsr GetNextEntry
bcc .1
bcc .92 bit bPass2
bmi .9
.9 ldy #bLong jsr ResetSrcDir
lda (pData),y bcs .99
dec bPass2
bra .1
.9 bit bLong
bmi .91 bmi .91
jsr CS.RUN.NewLine jsr CS.RUN.NewLine
@ -216,8 +225,13 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
bcs .98 bcs .98
jsr BasePath.. jsr BasePath..
jsr CS.RUN.ENTER.MSG
bcs .99
jsr GetNextEntry jsr GetNextEntry
.92 jmp CS.RUN.LOOP jmp CS.RUN.LOOP
.98 lda #0 .98 lda #0
sec sec
.99 rts .99 rts
@ -226,14 +240,16 @@ CS.RUN.PRINT.JMP
jmp (J.CS.RUN.PRINT,x) jmp (J.CS.RUN.PRINT,x)
*-------------------------------------- *--------------------------------------
CS.RUN.PRINT.REG CS.RUN.PRINT.REG
ldy #bLong bit bPass2
lda (pData),y bpl .8
bit bLong
bmi .1 bmi .1
>LDA.G bColumn bit bColumn
bmi .23 bmi .23
>LDA.G bFullPath bit bFullPath
bpl .22 bpl .22
jsr CS.RUN.PRINT.SRCPATH jsr CS.RUN.PRINT.SRCPATH
@ -247,11 +263,13 @@ CS.RUN.PRINT.REG
>PUSHBI 2 >PUSHBI 2
>SYSCALL PrintF >SYSCALL PrintF
bcs .9 bcs .9
jmp CS.RUN.UpdateColCnt jmp CS.RUN.UpdateColCnt
.8 clc
.9 rts
*-------------------------------------- *--------------------------------------
.1 .1 >PUSHW L.MSG.REGEXT
* >PUSHW ZPLineBuf
>PUSHW L.MSG.REGEXT
jsr Mod2CSTR (2) jsr Mod2CSTR (2)
@ -287,16 +305,18 @@ CS.RUN.PRINT.REG
bcs .9 bcs .9
jmp CS.RUN.NewLine.1 jmp CS.RUN.NewLine.1
.9 rts
*-------------------------------------- *--------------------------------------
CS.RUN.PRINT.DIR CS.RUN.PRINT.DIR
>LDA.G bLong bit bPass2
bmi .8
bit bLong
bmi .4 bmi .4
>LDA.G bColumn bit bColumn
bmi .23 bmi .23
>LDA.G bFullPath
bit bFullPath
bpl .22 bpl .22
jsr CS.RUN.PRINT.SRCPATH jsr CS.RUN.PRINT.SRCPATH
@ -304,13 +324,17 @@ CS.RUN.PRINT.DIR
.23 >LDYA ZPFileName .23 >LDYA ZPFileName
>SYSCALL PutS >SYSCALL PutS
bcs .9 bcs .9
>LDA.G bRecurse
bit bRecurse
bpl .8 bpl .8
lda (ZPFileName) lda (ZPFileName)
cmp #'.' cmp #'.'
beq .8 beq .8
>LDYA ZPFileName >LDYA ZPFileName
jmp EnterSubDirYA jmp EnterSubDirYA
.8 clc .8 clc
.9 rts .9 rts
@ -355,16 +379,20 @@ CS.RUN.PRINT.DIR
jsr CS.RUN.NewLine.1 jsr CS.RUN.NewLine.1
bcs .90 bcs .90
.5 >LDA.G bRecurse .5 bit bRecurse
bpl .80 bpl .80
lda (ZPFileName) lda (ZPFileName)
cmp #'.' cmp #'.'
beq .80 beq .80
jsr CS.RUN.NewLine jsr CS.RUN.NewLine
bcs .90 bcs .90
>LDYA ZPFileName >LDYA ZPFileName
jsr EnterSubDirYA jsr EnterSubDirYA
bcs .90 bcs .90
jmp CS.RUN.ENTER.MSG jmp CS.RUN.ENTER.MSG
.80 clc .80 clc
@ -375,12 +403,13 @@ CS.RUN.PRINT.CDEV
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.PRINT.BDEV CS.RUN.PRINT.BDEV
>LDA.G bLong bit bLong
bmi .20 bmi .20
>LDA.G bColumn bit bColumn
bmi .23 bmi .23
>LDA.G bFullPath
bit bFullPath
bpl .22 bpl .22
jsr CS.RUN.PRINT.SRCPATH jsr CS.RUN.PRINT.SRCPATH
@ -388,11 +417,14 @@ CS.RUN.PRINT.BDEV
.23 >LDYA ZPFileName .23 >LDYA ZPFileName
>SYSCALL PutS >SYSCALL PutS
bcs .9 bcs .9
>LDA.G bRecurse
bit bRecurse
bpl .8 bpl .8
lda (ZPFileName) lda (ZPFileName)
cmp #'.' cmp #'.'
beq .8 beq .8
>LDYA ZPFileName >LDYA ZPFileName
jmp EnterSubDirYA jmp EnterSubDirYA
@ -420,6 +452,7 @@ CS.RUN.PRINT.BDEV
>SYSCALL PutChar >SYSCALL PutChar
ply ply
bcc .11 bcc .11
rts rts
.2 jsr CS.RUN.UpdateColCnt .2 jsr CS.RUN.UpdateColCnt
@ -452,13 +485,15 @@ CS.RUN.PRINT.BDEV
jsr CS.RUN.NewLine.1 jsr CS.RUN.NewLine.1
bcs .90 bcs .90
ldy #bRecurse bit bRecurse
lda (pData),y
bpl .80 bpl .80
>LDYA ZPFileName >LDYA ZPFileName
jsr EnterSubDirYA jsr EnterSubDirYA
bcs .90 bcs .90
jmp CS.RUN.ENTER.MSG jmp CS.RUN.ENTER.MSG
.80 clc .80 clc
.90 rts .90 rts
*-------------------------------------- *--------------------------------------
@ -475,7 +510,7 @@ CS.RUN.PushUidGid
ldy #S.STAT.UID ldy #S.STAT.UID
lda (ZPFileStat),y lda (ZPFileStat),y
>PUSHA >PUSHA
>PUSHW ZPPW >PUSHW ZPPWBuf
>SYSCALL GetPWUID >SYSCALL GetPWUID
bcs .2 bcs .2
@ -498,7 +533,7 @@ CS.RUN.PushUidGid
.3 ldy #S.STAT.GID .3 ldy #S.STAT.GID
lda (ZPFileStat),y lda (ZPFileStat),y
>PUSHA >PUSHA
>PUSHW ZPPW >PUSHW ZPPWBuf
>SYSCALL GetGRGID >SYSCALL GetGRGID
bcs .5 bcs .5
@ -526,7 +561,7 @@ CS.RUN.PushUidGid
CS.RUN.PushUidGidStr CS.RUN.PushUidGidStr
>PUSHW L.FMT.string6 >PUSHW L.FMT.string6
>PUSHW ZPPW >PUSHW ZPPWBuf
>PUSHBI 2 >PUSHBI 2
>SYSCALL SPrintF >SYSCALL SPrintF
rts rts
@ -619,7 +654,8 @@ CS.RUN.DATEFMT.SELECT
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.UpdateColCnt CS.RUN.UpdateColCnt
>INC.G ColCount inc ColCount
lda ColCount
cmp #MAX.COL cmp #MAX.COL
bne CS.RUN.NewLine.8 bne CS.RUN.NewLine.8
@ -639,15 +675,12 @@ CS.RUN.ENTER.MSG
bcc CS.RUN.NewLine.1 bcc CS.RUN.NewLine.1
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.NewLine >LDA.G ColCount CS.RUN.NewLine lda ColCount
beq CS.RUN.NewLine.8 beq CS.RUN.NewLine.8
CS.RUN.NewLine.1 CS.RUN.NewLine.1
lda #C.CR lda #C.CR
>SYSCALL PutChar >SYSCALL PutChar
* bit bCRLF
* bpl CS.RUN.NewLine.8
lda #C.LF lda #C.LF
>SYSCALL PutChar >SYSCALL PutChar
@ -660,17 +693,16 @@ CS.DOEVENT sec
*-------------------------------------- *--------------------------------------
CS.QUIT jsr LeaveSubDir CS.QUIT jsr LeaveSubDir
bcc CS.QUIT bcc CS.QUIT
>LDA.G hFilter
beq .3
>SYSCALL FreeMem ldy #hFilter
jsr .7
.3 >LDA.G hPW ldy #hPWBuf
beq .4 jsr .7
>SYSCALL FreeMem ldy #hLineBuf
.4 lda hLineBuf .7 lda (pData),y
beq .8 beq .8
>SYSCALL FreeMem >SYSCALL FreeMem
@ -679,35 +711,45 @@ CS.QUIT jsr LeaveSubDir
rts rts
*-------------------------------------- *--------------------------------------
FileType2PSTR ldy #0 FileType2PSTR ldy #0
.1 cmp PRODOS.FT.HEX,y .1 cmp PRODOS.FT.HEX,y
beq .8 beq .8
iny iny
cpy #PRODOS.FT.TXT-PRODOS.FT.HEX cpy #PRODOS.FT.TXT-PRODOS.FT.HEX
bne .1 bne .1
pha pha
lsr lsr
lsr lsr
lsr lsr
lsr lsr
ora #$30 ora #$30
cmp #$3A cmp #'9'+1
bcc .2 bcc .2
adc #6 adc #6
.2 sta PRODOS.FT.DFLT+2
.2 sta PRODOS.FT.DFLT+1
pla pla
and #$0F and #$0F
ora #$30 ora #$30
cmp #$3A cmp #'9'+1
bcc .3 bcc .3
adc #6 adc #6
.3 sta PRODOS.FT.DFLT+3
.3 sta PRODOS.FT.DFLT+2
.8 tya .8 tya
asl asl
asl CC asl CC
adc L.PRODOS.FT.TXT adc L.PRODOS.FT.TXT
tay tay
lda L.PRODOS.FT.TXT+1 lda L.PRODOS.FT.TXT+1
adc #0 adc #0
rts rts
*-------------------------------------- *--------------------------------------
Mod2CSTR ldy #S.STAT.MODE+1 Mod2CSTR ldy #S.STAT.MODE+1
@ -755,7 +797,7 @@ CS.END
OptionList .AS "ACFLRacflr" OptionList .AS "ACFLRacflr"
OptionVars .DA #bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse,#bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse OptionVars .DA #bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse,#bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse
*-------------------------------------- *--------------------------------------
MSG.REGEXT .AZ "%s %6s %6s %10u %s %s %S %H %s" MSG.REGEXT .AZ "%s %6s %6s %10u %s %s %s %H %s"
MSG.REG .AZ "%19s" MSG.REG .AZ "%19s"
MSG.DIREXT .AZ "%s %6s %6s %s %s <dir> %s" MSG.DIREXT .AZ "%s %6s %6s %s %s <dir> %s"
MSG.DIR .AZ "\e[32m%s/\e[0m" MSG.DIR .AZ "\e[32m%s/\e[0m"
@ -764,17 +806,17 @@ MSG.BDEV .AZ "\e[32m%s/\e[0m"
MSG.ENTER .AZ "Directory:%s" MSG.ENTER .AZ "Directory:%s"
*-------------------------------------- *--------------------------------------
PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCCFFF PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCCFFF
PRODOS.FT.TXT >PSTR "txt" PRODOS.FT.TXT .AZ "txt"
>PSTR "bin" .AZ "bin"
>PSTR "asm" .AZ "asm"
>PSTR "bas" .AZ "bas"
>PSTR "var" .AZ "var"
>PSTR "atk" .AZ "atk"
>PSTR "pix" .AZ "pix"
>PSTR "fon" .AZ "fon"
>PSTR "pak" .AZ "pak"
>PSTR "sys" .AZ "sys"
PRODOS.FT.DFLT >PSTR "$ " PRODOS.FT.DFLT .AZ "$ "
MSG.NODATE .AZ "<no-date>" MSG.NODATE .AZ "<no-date>"
FMT.Date .AZ "%d-%b-%y" FMT.Date .AZ "%d-%b-%y"
FMT.Time .AZ "%H:%M:%S " FMT.Time .AZ "%H:%M:%S "
@ -786,8 +828,6 @@ ACCESS .AS "xwrxwrxwr"
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START DS.START
ArgCount .BS 1
MOD .BS 11 drwxrwxrwx0 MOD .BS 11 drwxrwxrwx0
USER .BS 7 USER .BS 7
GROUP .BS 7 GROUP .BS 7
@ -796,15 +836,8 @@ TIME.Create .BS 20
TIME.Mod .BS 20 TIME.Mod .BS 20
TIME.SysTime .BS S.TIME TIME.SysTime .BS S.TIME
bPause .BS 1 hLineBuf .BS 1
bAllmostAll .BS 1 hPWBuf .BS 1
bColumn .BS 1
bFullPath .BS 1
bLong .BS 1
bRecurse .BS 1
ColCount .BS 1
hPW .BS 1
.INB usr/src/shared/x.fileenum.g .INB usr/src/shared/x.fileenum.g
DS.END .ED DS.END .ED

View File

@ -84,6 +84,7 @@ ExcludeMatch sec
cmp #'*' another '*' ? cmp #'*' another '*' ?
beq .5 yes, '**' = '*', go next char beq .5 yes, '**' = '*', go next char
cmp #'?' '*?' ? we must match a least one char cmp #'?' '*?' ? we must match a least one char
beq .3 beq .3
@ -111,6 +112,7 @@ FilterMatch.CmpPtr2CharPtr1Y
lda (ZPFileName),y lda (ZPFileName),y
cmp #'a' cmp #'a'
bcc .1 bcc .1
cmp #'z'+1 cmp #'z'+1
bcs .1 bcs .1
@ -126,7 +128,9 @@ FilterMatch.CmpPtr2CharPtr1Y
FilterMatch.NextPtr2 FilterMatch.NextPtr2
inc ZPPtr2 Make PTR2 advance to next char inc ZPPtr2 Make PTR2 advance to next char
bne .1 bne .1
inc ZPPtr2+1 inc ZPPtr2+1
.1 lda (ZPPtr2) .1 lda (ZPPtr2)
rts rts
*-------------------------------------- *--------------------------------------
@ -153,6 +157,7 @@ InitSrcDirYA >PUSHYA
and #$F0 and #$F0
cmp /S.STAT.MODE.DIR cmp /S.STAT.MODE.DIR
bne .4 TYPE not a DIR, extract.... bne .4 TYPE not a DIR, extract....
bra .5 TYPE=DIR, do not extract pattern bra .5 TYPE=DIR, do not extract pattern
.ELSE .ELSE
bra .4 bra .4
@ -257,6 +262,28 @@ InitSrcDirYA >PUSHYA
sec sec
InitSrcDirYA.RTS InitSrcDirYA.RTS
rts rts
*--------------------------------------
ResetSrcDir jsr GethDIR
>SYSCALL CloseDir
>LDA.G hSrcBasePath
>SYSCALL GetMemPtr
>SYSCALL OpenDir
bcs .9
pha
>LDA.G index
clc
adc #hDIRs-1
tay
pla
sta (pData),y
* clc
.9 rts
*-------------------------------------- *--------------------------------------
.DO X.COPY.TO.DEST=1 .DO X.COPY.TO.DEST=1
InitDstDirYA >PUSHYA InitDstDirYA >PUSHYA
@ -296,6 +323,7 @@ InitDstDirYA >PUSHYA
>SYSCALL StrDup >SYSCALL StrDup
bcs .9 bcs .9
txa txa
>STA.G hDstFileName >STA.G hDstFileName
@ -339,6 +367,7 @@ InitDstDirYA >PUSHYA
*-------------------------------------- *--------------------------------------
GetNextEntry jsr GetEntry GetNextEntry jsr GetEntry
bcs .9 bcs .9
jsr GetFilenameLen Save actual file len for setting up jsr GetFilenameLen Save actual file len for setting up
pha new offset later pha new offset later
lda ZPFileStat lda ZPFileStat
@ -351,6 +380,7 @@ GetNextEntry jsr GetEntry
jsr GetFilenameLen are we at end of this buffer ? jsr GetFilenameLen are we at end of this buffer ?
beq .1 yes, go read next one ... beq .1 yes, go read next one ...
jsr SetFileStatPtr jsr SetFileStatPtr
jsr GetoDIRENT jsr GetoDIRENT
@ -376,21 +406,25 @@ GetNextEntry jsr GetEntry
sta (pData),y sta (pData),y
clc clc
rts rts
.1 pla .1 pla
jsr GetEntry.ReadDir jsr GetEntry.ReadDir
bcs .9 bcs .9
jsr GetFilenameLen jsr GetFilenameLen
beq GetNextEntry.99 beq .99
jsr SetFileStatPtr jsr SetFileStatPtr
clc clc
.9 rts .9 rts
GetNextEntry.99 sec .99 sec
rts rts
*-------------------------------------- *--------------------------------------
GetEntry jsr GethDIRENT GetEntry jsr GethDIRENT
bne .1 we have a buffer to scan bne .1 we have a buffer to scan
jsr GetEntry.ReadDir First run, get first block jsr GetEntry.ReadDir First run, get first block
bcs .9 ZPFileName = start of buffer bcs .9 ZPFileName = start of buffer
@ -403,15 +437,20 @@ GetEntry jsr GethDIRENT
.1 >SYSCALL GetMemPtr .1 >SYSCALL GetMemPtr
>STYA ZPFileName >STYA ZPFileName
jsr GetoDIRENT jsr GetoDIRENT
lda ZPFileName lda ZPFileName
clc clc
adc (pData),y adc (pData),y
sta ZPFileName sta ZPFileName
iny iny
lda ZPFileName+1 lda ZPFileName+1
adc (pData),y adc (pData),y
sta ZPFileName+1 ZPFileName=ZPFileName+oDIRENT sta ZPFileName+1 ZPFileName=ZPFileName+oDIRENT
.8 jsr GetFilenameLen .8 jsr GetFilenameLen
jsr SetFileStatPtr jsr SetFileStatPtr
clc clc
@ -439,7 +478,9 @@ GetEntry.ReadDir
tay tay
txa get hDIRENT in A txa get hDIRENT in A
sta (pData),y sta (pData),y
jsr GetoDIRENT jsr GetoDIRENT
lda #0 and reset offset for this buffer lda #0 and reset offset for this buffer
sta (pData),y sta (pData),y
iny iny
@ -457,8 +498,8 @@ EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
jsr EnterSubDirY jsr EnterSubDirY
>LDYA ZPPtr1 >LDYA ZPPtr1
>SYSCALL OpenDir >SYSCALL OpenDir
bcs .9 bcs .9
pha pha
>INC.G index >INC.G index
tax tax
@ -472,10 +513,12 @@ EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
tay tay
lda #0 lda #0
sta (pData),y sta (pData),y
.DO X.COPY.TO.DEST=1 .DO X.COPY.TO.DEST=1
ldy #hDstBasePath ldy #hDstBasePath
jsr EnterSubDirY jsr EnterSubDirY
.FIN .FIN
clc clc
.9 rts .9 rts
@ -495,17 +538,21 @@ EnterSubDirY lda (pData),y
lda #'/' lda #'/'
cmp (ZPPtr1),y cmp (ZPPtr1),y
beq .8 beq .8
iny iny
sta (ZPPtr1),y sta (ZPPtr1),y
iny iny
lda #0 lda #0
sta (ZPPtr1),y sta (ZPPtr1),y
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
LeaveSubDir >LDA.G index LeaveSubDir >LDA.G index
beq .9 beq .9
jsr GethDIRENT.A jsr GethDIRENT.A
beq .1 beq .1
pha pha
lda #0 lda #0
sta (pData),y sta (pData),y
@ -513,6 +560,7 @@ LeaveSubDir >LDA.G index
>SYSCALL FreeMem >SYSCALL FreeMem
.1 jsr GethDIR .1 jsr GethDIR
pha pha
lda #0 lda #0
sta (pData),y sta (pData),y
@ -521,6 +569,7 @@ LeaveSubDir >LDA.G index
>DEC.G index >DEC.G index
bne .8 bne .8
ldy #hSrcBasePath ldy #hSrcBasePath
lda (pData),y lda (pData),y
>SYSCALL FreeMem >SYSCALL FreeMem
@ -530,8 +579,10 @@ LeaveSubDir >LDA.G index
lda (pData),y lda (pData),y
>SYSCALL FreeMem >SYSCALL FreeMem
.FIN .FIN
.9 sec .9 sec
rts rts
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -564,8 +615,10 @@ BasePath..1 lda (pData),y
GetPtr1Len ldy #$ff GetPtr1Len ldy #$ff
.1 iny .1 iny
lda (ZPPtr1),y get len lda (ZPPtr1),y get len
bne .1 bne .1
rts rts
*-------------------------------------- *--------------------------------------
StrcpyPtr1ptr2 ldy #$ff StrcpyPtr1ptr2 ldy #$ff
@ -574,6 +627,7 @@ StrcpyPtr1ptr2 ldy #$ff
lda (ZPPtr1),y lda (ZPPtr1),y
sta (ZPPtr2),y sta (ZPPtr2),y
bne .1 bne .1
rts rts
*-------------------------------------- *--------------------------------------
GetFilenameLen ldy #$ff GetFilenameLen ldy #$ff
@ -581,6 +635,7 @@ GetFilenameLen ldy #$ff
.1 iny .1 iny
lda (ZPFileName),y lda (ZPFileName),y
bne .1 bne .1
tya tya
rts rts
*-------------------------------------- *--------------------------------------
@ -602,6 +657,7 @@ GethDIR ldy #index
*-------------------------------------- *--------------------------------------
GethDIRENT ldy #index GethDIRENT ldy #index
lda (pData),y lda (pData),y
GethDIRENT.A clc GethDIRENT.A clc
adc #hDIRENTs-1 adc #hDIRENTs-1
tay tay