2016-11-01 21:37:12 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2016-11-01 21:37:12 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2017-02-24 16:34:02 +00:00
|
|
|
|
X.COPY.BUF.SIZE .EQ 4096
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
2016-11-01 21:37:12 +00:00
|
|
|
|
ZPPtr1 .EQ ZPBIN
|
|
|
|
|
ZPPtr2 .EQ ZPBIN+2
|
2017-02-24 16:34:02 +00:00
|
|
|
|
ZPFileName .EQ ZPBIN+4
|
|
|
|
|
ZPFileStat .EQ ZPBIN+6
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length To Relocate
|
|
|
|
|
.DA DS.END-DS.START Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.MSG.USAGE .DA MSG.USAGE
|
|
|
|
|
L.MSG.DIR .DA MSG.DIR
|
|
|
|
|
L.MSG.FILE .DA MSG.FILE
|
2017-02-24 16:34:02 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
L.MSG.OVERWRTE .DA MSG.OVERWRTE
|
|
|
|
|
.FIN
|
2016-11-01 21:37:12 +00:00
|
|
|
|
L.MSG.OK .DA MSG.OK
|
|
|
|
|
L.MSG.ERR .DA MSG.ERR
|
|
|
|
|
L.STAT .DA STAT
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.INIT >SYSCALL GetArgC
|
|
|
|
|
sta ArgCount
|
|
|
|
|
cmp #1
|
2017-02-22 16:32:02 +00:00
|
|
|
|
beq .99
|
2016-11-13 21:03:31 +00:00
|
|
|
|
|
|
|
|
|
stz ArgIndex
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
|
|
|
|
.1 dec ArgCount
|
2016-11-08 16:56:05 +00:00
|
|
|
|
beq .7
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
inc ArgIndex
|
|
|
|
|
lda ArgIndex
|
2016-11-01 21:37:12 +00:00
|
|
|
|
>SYSCALL GetArgA
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
cmp #2
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
ldx OptionList
|
|
|
|
|
|
|
|
|
|
.2 cmp OptionList,x
|
|
|
|
|
beq .3
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2016-11-13 21:03:31 +00:00
|
|
|
|
|
|
|
|
|
.99 >LDYA L.MSG.USAGE
|
|
|
|
|
>SYSCALL CPrintFYA
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda #SYSMGR.ERRSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 ldy OptionVars-1,x
|
|
|
|
|
lda #$80
|
|
|
|
|
sta (pData),y
|
|
|
|
|
bra .1
|
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
.4 ldy #index
|
|
|
|
|
lda (pData),y
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2016-11-08 16:56:05 +00:00
|
|
|
|
bne .5 Already have a Src dir...
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.ELSE
|
|
|
|
|
bne .99
|
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
>LDYA ZPPtr1
|
2017-02-23 07:42:48 +00:00
|
|
|
|
jsr InitSrcDirPatYA
|
2016-11-08 16:56:05 +00:00
|
|
|
|
bcc .1 success, scan for any other args
|
|
|
|
|
rts
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2016-11-08 16:56:05 +00:00
|
|
|
|
.5 ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .99 we already have a second arg....error!
|
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr1
|
|
|
|
|
jsr InitDstDirYA
|
|
|
|
|
bcc .1 success, scan for any other args
|
|
|
|
|
rts
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
.7 ldy #index processed all args
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (pData),y
|
2016-11-08 16:56:05 +00:00
|
|
|
|
beq .99 , no src ? ERROR
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2016-11-08 16:56:05 +00:00
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .8 we also have a Dst folder
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX no dst folder, use actual prefix
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
jsr InitDstDirYA
|
|
|
|
|
bcs .99
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2016-11-01 21:37:12 +00:00
|
|
|
|
.8 lda (pPs)
|
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
|
|
|
|
sta (pPs)
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-02-20 17:16:23 +00:00
|
|
|
|
CS.RUN >SYSCALL GetC
|
2017-02-22 16:32:02 +00:00
|
|
|
|
bcs .11 no char
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2017-02-20 17:16:23 +00:00
|
|
|
|
cmp #$03 Ctrl-C
|
2017-02-22 16:32:02 +00:00
|
|
|
|
bne .10
|
|
|
|
|
sec
|
|
|
|
|
rts Abort....
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.10 cmp #$13 Ctrl-S
|
|
|
|
|
bne .11
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2017-02-20 17:16:23 +00:00
|
|
|
|
ldy #bPause
|
|
|
|
|
lda (pData),y
|
|
|
|
|
eor #$ff
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.11 ldy #bPause
|
|
|
|
|
lda (pData),y
|
2017-02-24 07:46:53 +00:00
|
|
|
|
bpl .1
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.1 .DO X.COPY.TO.DEST=1
|
|
|
|
|
ldy #bCopy
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .2
|
|
|
|
|
jmp CS.RUN.Copy
|
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-23 07:42:48 +00:00
|
|
|
|
.2 .DO X.DELETE.SOURCE=1
|
2017-02-22 16:32:02 +00:00
|
|
|
|
ldy #hToDelete
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .3
|
2017-02-24 07:46:53 +00:00
|
|
|
|
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>SYSCALL RemoveYA
|
|
|
|
|
php
|
|
|
|
|
pha
|
|
|
|
|
ldy #hToDelete
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
|
|
|
|
|
ldy #hToDelete
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
pla
|
|
|
|
|
plp
|
2017-02-26 18:34:00 +00:00
|
|
|
|
jsr CS.RUN.CheckErr
|
|
|
|
|
bcs .9
|
|
|
|
|
jmp CS.RUN.NEXT
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2017-02-26 18:34:00 +00:00
|
|
|
|
*---------------
|
|
|
|
|
.3 jsr GetEntry
|
2017-02-24 16:34:02 +00:00
|
|
|
|
bcs CS.RUN.LEAVE
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
|
|
|
|
ldy #hFilter
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .4 No filter....
|
|
|
|
|
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHW ZPFileName
|
2016-11-01 21:37:12 +00:00
|
|
|
|
>SYSCALL PStrMatch
|
2017-02-26 18:34:00 +00:00
|
|
|
|
bcs CS.RUN.NEXT no match, skip....
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
.4 ldy #S.STAT.P.DRIVE
|
2017-02-24 16:34:02 +00:00
|
|
|
|
lda (ZPFileStat),y ProDOS Device ?
|
2017-02-24 07:46:53 +00:00
|
|
|
|
bne .6
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.STAT.P.TYPE
|
2017-02-24 16:34:02 +00:00
|
|
|
|
lda (ZPFileStat),y
|
2016-11-01 21:37:12 +00:00
|
|
|
|
cmp #$0F Directory ?
|
2017-02-24 07:46:53 +00:00
|
|
|
|
bne .5
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-24 07:46:53 +00:00
|
|
|
|
ldy #bRecurse
|
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
bpl CS.RUN.NEXT
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPFileName),y
|
|
|
|
|
cmp #'.'
|
2017-02-26 18:34:00 +00:00
|
|
|
|
beq CS.RUN.NEXT Skip "." & ".."
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-24 07:46:53 +00:00
|
|
|
|
jmp CS.RUN.DIR
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2017-02-24 07:46:53 +00:00
|
|
|
|
.5 jmp CS.RUN.FILE
|
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.6 lda #MLI.ERR.UNSUPST
|
2017-02-24 07:46:53 +00:00
|
|
|
|
sec
|
2017-02-24 16:34:02 +00:00
|
|
|
|
.9 rts
|
2017-02-22 16:32:02 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-26 18:34:00 +00:00
|
|
|
|
CS.RUN.CR.NEXT lda #13
|
|
|
|
|
>SYSCALL PutCA
|
2017-03-01 10:31:19 +00:00
|
|
|
|
lda #10
|
|
|
|
|
>SYSCALL PutCA
|
2017-02-26 18:34:00 +00:00
|
|
|
|
CS.RUN.NEXT jsr GetNextEntry
|
|
|
|
|
bcs CS.RUN.LEAVE
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-02-24 16:34:02 +00:00
|
|
|
|
CS.RUN.LEAVE jsr LeaveSubDir exit this sub dir....
|
2017-02-24 07:46:53 +00:00
|
|
|
|
bcs .99 base, we are done, exit
|
2017-02-26 18:34:00 +00:00
|
|
|
|
jsr BasePath..
|
2017-02-24 07:46:53 +00:00
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
.DO X.DELETE.SOURCE=1
|
2017-02-24 07:46:53 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=0
|
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
jsr GetEntry
|
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
>PUSHW ZPFileName
|
|
|
|
|
|
|
|
|
|
ldy #hSrcBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
2017-02-24 07:46:53 +00:00
|
|
|
|
>LDYA L.MSG.DIR
|
|
|
|
|
>SYSCALL CPrintFYA
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
ldy #hSrcBasePath
|
|
|
|
|
jsr CS.RUN.GetFilePath
|
|
|
|
|
|
2017-02-24 07:46:53 +00:00
|
|
|
|
>LDYAI UsrBuf256
|
2017-02-22 16:32:02 +00:00
|
|
|
|
>SYSCALL RemoveYA
|
|
|
|
|
jsr CS.RUN.CheckErr
|
2016-11-13 21:03:31 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
.FIN
|
2017-02-24 07:46:53 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
jmp CS.RUN.NEXT
|
|
|
|
|
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.99 ldy #RC
|
|
|
|
|
lda (pData),y get global RC in case of bContinue
|
2016-11-01 21:37:12 +00:00
|
|
|
|
sec
|
2017-02-24 16:34:02 +00:00
|
|
|
|
.9 rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-24 16:34:02 +00:00
|
|
|
|
CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
>PUSHW ZPFileName Filename
|
|
|
|
|
|
2017-02-23 16:43:42 +00:00
|
|
|
|
ldy #hDstBasePath
|
2017-02-26 18:34:00 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
2017-02-23 16:43:42 +00:00
|
|
|
|
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHW ZPFileName Filename
|
2017-02-23 16:43:42 +00:00
|
|
|
|
|
|
|
|
|
ldy #hSrcBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.DIR
|
|
|
|
|
>SYSCALL CPrintFYA
|
2017-02-27 14:18:03 +00:00
|
|
|
|
bcs CS.RUN.DIR.RTS
|
2017-02-24 07:46:53 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
jsr CS.RUN.GetFilePath
|
|
|
|
|
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHW L.STAT
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL Stat
|
2017-02-26 18:34:00 +00:00
|
|
|
|
bcs .3 File Not exists...go create
|
2017-02-21 17:01:30 +00:00
|
|
|
|
|
2017-02-24 16:34:02 +00:00
|
|
|
|
ldy #bNoConfirm
|
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
bmi .21 no prompt, nothing to create, enter subdir
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.OVERWRTE
|
|
|
|
|
>SYSCALL CPrintFYA
|
2017-02-27 14:18:03 +00:00
|
|
|
|
bcs CS.RUN.DIR.RTS
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
.1 >SYSCALL Sleep
|
|
|
|
|
>SYSCALL GetC
|
|
|
|
|
bcs .1
|
|
|
|
|
cmp #3
|
|
|
|
|
beq .99 abort
|
|
|
|
|
|
|
|
|
|
cmp #'N'
|
2017-02-26 18:34:00 +00:00
|
|
|
|
bne .2
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
jmp CS.RUN.CR.NEXT no overwrite, nothing to do, no recurse
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.2 cmp #'Y'
|
|
|
|
|
beq .21 no create, but recurse
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
cmp #'A'
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldy #bNoConfirm
|
|
|
|
|
lda #$ff
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.21 clc
|
|
|
|
|
lda #0
|
|
|
|
|
bra .4
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.3 >LDYAI UsrBuf256
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>SYSCALL MKDirYA
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.4 jsr CS.RUN.CheckErr
|
2017-02-27 14:18:03 +00:00
|
|
|
|
bcs CS.RUN.DIR.RTS
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
.7 >LDYA ZPFileName
|
2016-11-01 21:37:12 +00:00
|
|
|
|
jmp EnterSubDirYA
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.99 ldy #RC
|
|
|
|
|
lda (pData),y get global RC in case of bContnue
|
2017-02-24 16:34:02 +00:00
|
|
|
|
sec
|
2017-02-27 14:18:03 +00:00
|
|
|
|
CS.RUN.DIR.RTS rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-23 16:43:42 +00:00
|
|
|
|
CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
2017-02-26 18:34:00 +00:00
|
|
|
|
>PUSHW ZPFileName
|
|
|
|
|
|
2017-02-23 16:43:42 +00:00
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
.FIN
|
|
|
|
|
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHW ZPFileName
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
2017-02-23 16:43:42 +00:00
|
|
|
|
ldy #hSrcBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.FILE
|
|
|
|
|
>SYSCALL CPrintFYA
|
2017-02-27 14:18:03 +00:00
|
|
|
|
bcs CS.RUN.DIR.RTS
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
jsr CS.RUN.GetFilePath
|
|
|
|
|
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHW L.STAT
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL Stat
|
|
|
|
|
bcs .2 File Not exists...go create
|
|
|
|
|
|
|
|
|
|
ldy #bNoConfirm
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bmi .2 no prompt, ovverwrite
|
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.OVERWRTE
|
|
|
|
|
>SYSCALL CPrintFYA
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.1 >SYSCALL Sleep
|
|
|
|
|
>SYSCALL GetC
|
|
|
|
|
bcs .1
|
|
|
|
|
cmp #3
|
|
|
|
|
beq .99 abort
|
|
|
|
|
|
|
|
|
|
cmp #'N'
|
|
|
|
|
bne .11
|
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
jmp CS.RUN.CR.NEXT no overwrite exit
|
2017-02-27 14:18:03 +00:00
|
|
|
|
rts
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
.11 cmp #'Y'
|
|
|
|
|
beq .12 copy
|
|
|
|
|
|
|
|
|
|
cmp #'A'
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldy #bNoConfirm
|
|
|
|
|
lda #$ff
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.12 jsr GetEntry get back current entry corrupted by SLEEP
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
.2 jsr CS.RUN.CopyStart
|
|
|
|
|
bcc .4
|
2017-02-24 07:46:53 +00:00
|
|
|
|
jsr CS.RUN.CheckErr
|
|
|
|
|
rts
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
.4 .DO X.DELETE.SOURCE=1
|
2017-02-22 16:32:02 +00:00
|
|
|
|
ldy #hSrcBasePath
|
|
|
|
|
jsr CS.RUN.GetFilePath
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
>LDYAI UsrBuf256
|
|
|
|
|
>SYSCALL NewPStrYA
|
2017-02-23 16:43:42 +00:00
|
|
|
|
bcs .9
|
2017-02-22 16:32:02 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #hToDelete
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.FIN
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
|
|
|
|
clc
|
2017-02-27 14:18:03 +00:00
|
|
|
|
.9 rts
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.99 ldy #RC
|
|
|
|
|
lda (pData),y get global RC in case of bContnue
|
2017-02-24 16:34:02 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2017-02-20 17:16:23 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
CS.RUN.CopyStart
|
2017-02-22 07:31:16 +00:00
|
|
|
|
ldy #S.STAT.P.AUXTYPE+1
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHB (ZPFileStat),y
|
2017-02-22 07:31:16 +00:00
|
|
|
|
dey
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHB (ZPFileStat),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
ldy #S.STAT.P.TYPE
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHB (ZPFileStat),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
>PUSHBI SYS.FOpen.R
|
|
|
|
|
ldy #hSrcBasePath
|
|
|
|
|
jsr CS.RUN.GetFilePath
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2017-02-20 17:16:23 +00:00
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL FOpen
|
2017-02-24 07:46:53 +00:00
|
|
|
|
bcs .99
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2017-02-20 17:16:23 +00:00
|
|
|
|
ldy #hSrcFile
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2017-02-22 07:31:16 +00:00
|
|
|
|
ldy #S.STAT.P.AUXTYPE+1
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHB (ZPFileStat),y
|
2017-02-22 07:31:16 +00:00
|
|
|
|
dey
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHB (ZPFileStat),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
ldy #S.STAT.P.TYPE
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHB (ZPFileStat),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
jsr CS.RUN.GetFilePath
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
2017-02-20 17:16:23 +00:00
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL FOpen
|
2017-02-24 07:46:53 +00:00
|
|
|
|
bcs .9
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-24 07:46:53 +00:00
|
|
|
|
ldy #hDstFile
|
2017-02-20 17:16:23 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
ldy #bCopy
|
|
|
|
|
lda #$ff
|
|
|
|
|
sta (pData),y
|
|
|
|
|
clc
|
2017-02-24 07:46:53 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 pha
|
|
|
|
|
ldy #hSrcFile
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL FCloseA
|
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.Copy stz .90+1
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHWI X.COPY.BUF.SIZE
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>SYSCALL GetMem
|
|
|
|
|
bcs .9
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
stx .90+1
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>PUSHW ZPPtr1 Dst Ptr
|
2017-02-24 16:34:02 +00:00
|
|
|
|
>PUSHWI X.COPY.BUF.SIZE Bytes To Read
|
2017-02-21 17:01:30 +00:00
|
|
|
|
ldy #hSrcFile
|
|
|
|
|
>PUSHB (pData),y
|
|
|
|
|
>SYSCALL FRead
|
|
|
|
|
bcc .1
|
2017-02-22 07:31:16 +00:00
|
|
|
|
cmp #MLI.ERR.EOF
|
|
|
|
|
bne .9
|
|
|
|
|
lda #0
|
|
|
|
|
bra .9
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.1 >STYA ZPPtr2
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>PUSHW ZPPtr1 Src Ptr
|
|
|
|
|
>PUSHW ZPPtr2 Bytes To Write
|
|
|
|
|
ldy #hDstFile
|
|
|
|
|
>PUSHB (pData),y
|
|
|
|
|
>SYSCALL FWrite
|
|
|
|
|
bcs .9
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-22 07:31:16 +00:00
|
|
|
|
lda .90+1
|
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
lda #'.'
|
|
|
|
|
>SYSCALL PutCA
|
|
|
|
|
rts
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.9 ldy #CopyRC
|
|
|
|
|
sta (pData),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.90 lda #$00
|
|
|
|
|
beq CS.RUN.CopyEnd
|
2017-02-22 07:31:16 +00:00
|
|
|
|
>SYSCALL FreeMemA
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-22 16:32:02 +00:00
|
|
|
|
CS.RUN.CopyEnd ldy #hSrcFile
|
2017-02-21 07:52:27 +00:00
|
|
|
|
lda (pData),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
>SYSCALL FCloseA
|
2017-02-22 16:32:02 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.CheckErr
|
2017-02-21 17:01:30 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.1 ldy #hDstFile
|
2017-02-21 07:52:27 +00:00
|
|
|
|
lda (pData),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
>SYSCALL FCloseA
|
2017-02-22 16:32:02 +00:00
|
|
|
|
bcc .2
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
jsr CS.RUN.CheckErr
|
|
|
|
|
|
|
|
|
|
.2 ldy #bCopy
|
2017-02-21 17:01:30 +00:00
|
|
|
|
lda #$0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
clc
|
2017-02-21 17:01:30 +00:00
|
|
|
|
ldy #CopyRC
|
|
|
|
|
lda (pData),y
|
2017-02-26 18:34:00 +00:00
|
|
|
|
beq .3
|
2017-02-21 17:01:30 +00:00
|
|
|
|
sec
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.3 jsr CS.RUN.CheckErr
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jmp CS.RUN.NEXT
|
|
|
|
|
.9 rts
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-22 16:32:02 +00:00
|
|
|
|
CS.RUN.CheckErr bcs .1
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>LDYA L.MSG.OK
|
2017-04-04 13:07:58 +00:00
|
|
|
|
>SYSCALL PPrintFYA
|
2017-02-22 16:32:02 +00:00
|
|
|
|
rts
|
2017-02-21 17:01:30 +00:00
|
|
|
|
|
2017-02-26 18:34:00 +00:00
|
|
|
|
.1 ldy #RC
|
|
|
|
|
sta (pData),y
|
|
|
|
|
pha
|
2017-02-23 16:43:42 +00:00
|
|
|
|
|
|
|
|
|
ldy #bContinue
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
pla
|
2017-02-22 16:32:02 +00:00
|
|
|
|
>PUSHA
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>LDYA L.MSG.ERR
|
|
|
|
|
|
2017-04-03 21:13:46 +00:00
|
|
|
|
>SYSCALL PPrintFYA
|
2017-02-21 17:01:30 +00:00
|
|
|
|
bcs .9
|
2017-02-23 16:43:42 +00:00
|
|
|
|
rts
|
2017-02-22 16:32:02 +00:00
|
|
|
|
|
2017-02-23 16:43:42 +00:00
|
|
|
|
.2 lda #13
|
2017-04-03 21:13:46 +00:00
|
|
|
|
>SYSCALL PutCA
|
|
|
|
|
lda #10
|
2017-02-23 16:43:42 +00:00
|
|
|
|
>SYSCALL PutCA
|
|
|
|
|
pla
|
2017-02-22 16:32:02 +00:00
|
|
|
|
sec
|
2016-11-01 21:37:12 +00:00
|
|
|
|
rts
|
2017-02-22 16:32:02 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-20 17:16:23 +00:00
|
|
|
|
CS.RUN.GetFilePath
|
2016-11-13 21:03:31 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCpy
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
|
|
|
|
>PUSHW ZPFileName
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCat
|
2016-11-13 21:03:31 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-02-20 17:16:23 +00:00
|
|
|
|
CS.DOEVENT sec
|
2016-11-01 21:37:12 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.QUIT jsr LeaveSubDir
|
|
|
|
|
bcc CS.QUIT
|
|
|
|
|
|
2017-02-23 07:42:48 +00:00
|
|
|
|
ldy #hToDelete
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .1
|
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
|
|
|
|
|
.1 ldy #bCopy
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
ldy #hSrcFile
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL FCloseA
|
|
|
|
|
|
|
|
|
|
ldy #hDstFile
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL FCloseA
|
|
|
|
|
|
|
|
|
|
.2 ldy #hFilter
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (pData),y
|
2017-02-20 17:16:23 +00:00
|
|
|
|
beq .8
|
2017-04-10 06:07:14 +00:00
|
|
|
|
>SYSCALL FreeMemA
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2017-02-20 17:16:23 +00:00
|
|
|
|
.8 clc
|
2016-11-01 21:37:12 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/BIN/X.CPMVRM.S
|