2016-10-18 06:26:24 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2016-10-18 06:26:24 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2016-10-19 15:47:53 +00:00
|
|
|
|
* Uses: (pData)
|
2016-11-08 16:56:05 +00:00
|
|
|
|
* hDIRs .BS X.MAX.RECURSE+1
|
|
|
|
|
* hDIRENTs .BS X.MAX.RECURSE+1
|
|
|
|
|
* hSrcBasePath .BS 1
|
|
|
|
|
* hDstBasePath .BS 1 (optional)
|
2016-10-19 15:47:53 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-24 16:34:02 +00:00
|
|
|
|
X.MAX.RECURSE .EQ 8
|
|
|
|
|
*--------------------------------------
|
2016-11-03 07:29:24 +00:00
|
|
|
|
InitSrcDirPatYA ldx #$80
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
InitSrcDirYA ldx #0
|
|
|
|
|
stx .11+1
|
|
|
|
|
>SYSCALL GetFullPathYA
|
2016-10-20 16:04:35 +00:00
|
|
|
|
bcc .10
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.10 stx .90+1
|
2016-10-19 15:47:53 +00:00
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
cmp #1
|
|
|
|
|
beq .5 we have '/'
|
|
|
|
|
|
2016-11-03 07:29:24 +00:00
|
|
|
|
.11 lda #$ff Self Modified
|
|
|
|
|
bmi .1 Force using pattern
|
|
|
|
|
|
2016-10-19 15:47:53 +00:00
|
|
|
|
>PUSHW L.STAT
|
|
|
|
|
>PUSHW ZPPtr1
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>SYSCALL Stat
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
2016-11-03 07:29:24 +00:00
|
|
|
|
bcs .1 File/DIR does not exists, go extract pattern
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
lda STAT+S.STAT.P.TYPE
|
2016-10-19 15:47:53 +00:00
|
|
|
|
cmp #$0f
|
2016-10-20 16:04:35 +00:00
|
|
|
|
beq .5 TYPE=DIR, do not extract wildcard
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr1)
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y search backward for a /
|
|
|
|
|
cmp #'/'
|
|
|
|
|
beq .3
|
|
|
|
|
dey
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
.3 tya
|
|
|
|
|
cmp (ZPPtr1)
|
2016-10-20 16:04:35 +00:00
|
|
|
|
beq .5 Make sure at least one char
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
phy save / pos to trunk string later
|
|
|
|
|
|
|
|
|
|
.4 iny
|
|
|
|
|
inx
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta UsrBuf256,x
|
|
|
|
|
tya
|
|
|
|
|
cmp (ZPPtr1)
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
pla get back / pos
|
|
|
|
|
sta (ZPPtr1) trunk it for Opendir
|
|
|
|
|
|
|
|
|
|
stx UsrBuf256
|
|
|
|
|
>LDYAI UsrBuf256
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL NewPstrYA
|
2016-10-19 15:47:53 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
txa
|
|
|
|
|
ldy #hFilter
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
.5 >PUSHWI 256
|
|
|
|
|
>PUSHBI 0
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMem Get a 256 buffer to store BasePath
|
2016-10-19 15:47:53 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
txa
|
2016-11-08 16:56:05 +00:00
|
|
|
|
ldy #hSrcBasePath
|
2016-10-19 15:47:53 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2016-11-03 07:29:24 +00:00
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
sta (ZPPtr2)
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.6 lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
dey
|
|
|
|
|
bne .6
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
2017-02-23 16:43:42 +00:00
|
|
|
|
lda (ZPPtr2)
|
|
|
|
|
tay
|
|
|
|
|
lda #'/'
|
|
|
|
|
cmp (ZPPtr2),y
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
tya
|
|
|
|
|
sta (ZPPtr2)
|
|
|
|
|
|
|
|
|
|
.7 >LDYA ZPPtr1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
>SYSCALL OpenDirYA
|
|
|
|
|
|
2016-10-19 15:47:53 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #hDIRs
|
2016-10-28 09:37:57 +00:00
|
|
|
|
sta (pData),y set hDIRs[0] = Src Hdir
|
2016-10-20 16:04:35 +00:00
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
ldy #index
|
|
|
|
|
lda #1
|
2016-10-28 09:37:57 +00:00
|
|
|
|
sta (pData),y index=hDIRs[0]
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
|
|
|
|
jsr .9 Cleanup
|
|
|
|
|
|
|
|
|
|
clc
|
2016-10-20 16:04:35 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2016-10-19 15:47:53 +00:00
|
|
|
|
.9 pha
|
|
|
|
|
.90 lda #$ff self modified
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL FreeMemA
|
2016-10-19 15:47:53 +00:00
|
|
|
|
pla
|
|
|
|
|
sec
|
2016-10-28 09:37:57 +00:00
|
|
|
|
InitSrcDirYA.RTS
|
2016-10-19 15:47:53 +00:00
|
|
|
|
rts
|
2017-02-23 16:43:42 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
InitDstDirYA >SYSCALL GetFullPathYA
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
stx .90+1
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
.5 >PUSHWI 256
|
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>SYSCALL GetMem Get a 256 buffer to store DstBasePath
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
txa
|
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
sta (ZPPtr2)
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.6 lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
dey
|
|
|
|
|
bne .6
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr2)
|
|
|
|
|
tay
|
|
|
|
|
lda #'/'
|
|
|
|
|
cmp (ZPPtr2),y
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
tya
|
|
|
|
|
sta (ZPPtr2)
|
|
|
|
|
|
|
|
|
|
.7 jsr .9 Cleanup
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.99 rts
|
|
|
|
|
|
|
|
|
|
.9 pha
|
|
|
|
|
.90 lda #$ff self modified
|
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.FIN
|
2016-10-19 15:47:53 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-26 18:34:00 +00:00
|
|
|
|
GetNextEntry jsr GetEntry
|
|
|
|
|
bcs .9
|
2016-10-25 06:58:15 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
lda (ZPFileName) Save actual file len for setting up
|
|
|
|
|
tax new offset later
|
|
|
|
|
|
|
|
|
|
lda ZPFileStat
|
2016-10-26 20:51:06 +00:00
|
|
|
|
clc
|
2017-02-26 18:34:00 +00:00
|
|
|
|
adc #S.STAT
|
|
|
|
|
sta ZPFileName
|
2016-10-25 06:58:15 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
lda ZPFileStat+1
|
|
|
|
|
adc /S.STAT
|
|
|
|
|
sta ZPFileName+1 Make nDIRENTs[i] point to next DIRENT
|
|
|
|
|
|
|
|
|
|
lda (ZPFileName) are we at end of this buffer ?
|
|
|
|
|
beq .1 yes, go read next one ...
|
2016-10-25 06:58:15 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
sec
|
|
|
|
|
adc ZPFileName
|
|
|
|
|
sta ZPFileStat
|
|
|
|
|
lda ZPFileName+1
|
|
|
|
|
adc #0
|
|
|
|
|
sta ZPFileStat+1
|
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
ldy #index
|
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
asl
|
2016-10-26 20:51:06 +00:00
|
|
|
|
clc
|
2017-02-26 18:34:00 +00:00
|
|
|
|
adc #oDIRENTs-1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
tay
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
|
|
|
|
txa Get back previous file len
|
2016-10-25 06:58:15 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
sec
|
|
|
|
|
adc (pData),y
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
lda #0
|
2017-02-26 18:34:00 +00:00
|
|
|
|
adc (pData),y
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
|
|
|
|
|
lda #S.STAT
|
|
|
|
|
clc
|
|
|
|
|
adc (pData),y
|
2016-10-26 20:51:06 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
|
|
|
|
lda /S.STAT
|
|
|
|
|
adc (pData),y
|
2016-10-26 20:51:06 +00:00
|
|
|
|
sta (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 jsr GetEntry.ReadDir
|
|
|
|
|
bcs .9
|
|
|
|
|
lda (ZPFileName)
|
|
|
|
|
beq .99
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
adc ZPFileName
|
|
|
|
|
sta ZPFileStat
|
|
|
|
|
lda ZPFileName+1
|
|
|
|
|
adc #0
|
|
|
|
|
sta ZPFileStat+1
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
|
|
|
|
|
.99 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GetEntry ldy #index
|
|
|
|
|
lda (pData),y
|
|
|
|
|
clc
|
|
|
|
|
adc #hDIRENTs-1
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .1 we have a buffer to scan
|
|
|
|
|
|
|
|
|
|
jsr GetEntry.ReadDir First run, get first block
|
|
|
|
|
bcs .9 ZPFileName = start of buffer
|
2016-10-26 20:51:06 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
lda (ZPFileName) Empty !!!
|
|
|
|
|
bne .8
|
2016-10-26 20:51:06 +00:00
|
|
|
|
|
2017-04-03 15:35:03 +00:00
|
|
|
|
* txa
|
|
|
|
|
* >SYSCALL FreeMemA
|
2017-02-26 18:34:00 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
.1 >SYSCALL GetMemPtrA
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>STYA ZPFileName
|
2016-10-26 20:51:06 +00:00
|
|
|
|
|
|
|
|
|
ldy #index
|
|
|
|
|
lda (pData),y
|
|
|
|
|
asl
|
2017-02-26 18:34:00 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #oDIRENTs-1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
tay
|
|
|
|
|
|
2017-02-24 16:34:02 +00:00
|
|
|
|
lda ZPFileName
|
|
|
|
|
clc
|
2016-10-26 20:51:06 +00:00
|
|
|
|
adc (pData),y
|
2017-02-24 16:34:02 +00:00
|
|
|
|
sta ZPFileName
|
2016-10-26 20:51:06 +00:00
|
|
|
|
|
|
|
|
|
iny
|
2017-02-24 16:34:02 +00:00
|
|
|
|
lda ZPFileName+1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
adc (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
sta ZPFileName+1 ZPFileName=ZPFileName+oDIRENT
|
2016-10-26 20:51:06 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.8 lda ZPFileName
|
|
|
|
|
sec
|
|
|
|
|
adc (ZPFileName)
|
|
|
|
|
sta ZPFileStat
|
|
|
|
|
lda ZPFileName+1
|
|
|
|
|
adc #0
|
|
|
|
|
sta ZPFileStat+1
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GetEntry.ReadDir
|
2016-10-26 20:51:06 +00:00
|
|
|
|
ldy #index
|
|
|
|
|
lda (pData),y
|
|
|
|
|
clc
|
|
|
|
|
adc #hDIRENTs-1
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
beq .1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
pha
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y reset hDIRENT
|
|
|
|
|
pla
|
2017-02-26 18:34:00 +00:00
|
|
|
|
>SYSCALL FreeMemA discard previous hDIRENT
|
2016-10-26 20:51:06 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.1 ldy #index
|
2016-10-26 20:51:06 +00:00
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #hDIRs-1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
tay
|
2017-02-26 18:34:00 +00:00
|
|
|
|
lda (pData),y
|
2016-10-28 09:37:57 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
>SYSCALL ReadDirA
|
|
|
|
|
bcs .9
|
|
|
|
|
>STYA ZPFileName
|
2016-10-28 09:37:57 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
ldy #index
|
|
|
|
|
lda (pData),y
|
|
|
|
|
clc
|
|
|
|
|
adc #hDIRENTs-1
|
|
|
|
|
tay
|
|
|
|
|
txa get hDIRENT in A
|
2016-10-26 20:51:06 +00:00
|
|
|
|
sta (pData),y
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
ldy #index
|
2016-10-26 20:51:06 +00:00
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
asl
|
|
|
|
|
clc
|
|
|
|
|
adc #oDIRENTs-1 and reset offset for this buffer
|
|
|
|
|
tay
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
2016-10-26 20:51:06 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
clc
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.9 rts
|
2016-10-25 06:58:15 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-20 16:04:35 +00:00
|
|
|
|
EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
|
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
ldy #index
|
2016-10-20 16:04:35 +00:00
|
|
|
|
lda (pData),y
|
2016-11-08 16:56:05 +00:00
|
|
|
|
cmp #X.MAX.RECURSE
|
2016-10-26 20:51:06 +00:00
|
|
|
|
beq .9
|
2016-10-20 16:04:35 +00:00
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
ldy #hSrcBasePath
|
2016-11-13 21:03:31 +00:00
|
|
|
|
jsr EnterSubDirYA.1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
|
2016-10-20 16:04:35 +00:00
|
|
|
|
>LDYA ZPPtr1
|
2016-10-26 20:51:06 +00:00
|
|
|
|
>SYSCALL OpenDirYA
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
bcs .9
|
2016-10-20 16:04:35 +00:00
|
|
|
|
pha
|
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
ldy #index
|
2016-10-20 16:04:35 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
2016-10-26 20:51:06 +00:00
|
|
|
|
tax
|
|
|
|
|
* clc from BCS
|
|
|
|
|
adc #hDIRs-1
|
2016-10-20 16:04:35 +00:00
|
|
|
|
tay
|
|
|
|
|
pla
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
txa make sure hDIRENTs[i] is closed
|
|
|
|
|
adc #hDIRENTs-1
|
|
|
|
|
tay
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2016-11-13 21:03:31 +00:00
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
jsr EnterSubDirYA.1
|
|
|
|
|
.FIN
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
|
|
|
|
clc
|
2016-10-26 20:51:06 +00:00
|
|
|
|
.9 rts
|
2016-11-13 21:03:31 +00:00
|
|
|
|
|
|
|
|
|
EnterSubDirYA.1 lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1 save full path
|
|
|
|
|
|
|
|
|
|
>PUSHW ZPPtr2
|
|
|
|
|
>PUSHW ZPPtr1
|
|
|
|
|
>SYSCALL PStrCat
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
inc
|
|
|
|
|
tay
|
|
|
|
|
sta (ZPPtr1)
|
|
|
|
|
lda #'/'
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
rts
|
2016-10-19 15:47:53 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
LeaveSubDir ldy #index
|
2016-10-19 15:47:53 +00:00
|
|
|
|
lda (pData),y
|
2016-10-26 20:51:06 +00:00
|
|
|
|
beq .9
|
2017-02-23 16:43:42 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
ldy #index
|
|
|
|
|
lda (pData),y
|
|
|
|
|
clc
|
|
|
|
|
adc #hDIRENTs-1
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
pla
|
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
|
|
|
|
|
.1 ldy #index
|
|
|
|
|
lda (pData),y
|
2016-10-26 20:51:06 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #hDIRs-1
|
2016-10-20 16:04:35 +00:00
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
pha
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
pla
|
|
|
|
|
>SYSCALL CloseDirA
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
ldy #index
|
|
|
|
|
lda (pData),y
|
|
|
|
|
dec
|
|
|
|
|
sta (pData),y
|
2016-11-01 21:37:12 +00:00
|
|
|
|
bne .8
|
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
ldy #hSrcBasePath
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL FreeMemA
|
2017-02-23 16:43:42 +00:00
|
|
|
|
|
2017-02-27 14:18:03 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
.FIN
|
|
|
|
|
|
2016-10-30 18:19:43 +00:00
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2016-10-30 18:19:43 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-21 17:01:30 +00:00
|
|
|
|
BasePath.. .DO X.COPY.TO.DEST=1
|
2016-11-13 21:03:31 +00:00
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
jsr BasePath..1
|
|
|
|
|
.FIN
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
ldy #hSrcBasePath
|
|
|
|
|
|
|
|
|
|
BasePath..1 lda (pData),y
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMemPtrA
|
2016-10-30 18:19:43 +00:00
|
|
|
|
|
2016-10-20 16:04:35 +00:00
|
|
|
|
>STYA ZPPtr1 save full path
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1) get len
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.1 dey At first run, discard ending /
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp #'/'
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
sta (ZPPtr1) cut DIR2/ from /dir1/DIR2/
|
2016-10-19 15:47:53 +00:00
|
|
|
|
|
2016-10-26 20:51:06 +00:00
|
|
|
|
rts
|
2016-10-18 06:26:24 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/BIN/X.FILEENUM.S
|