2016-08-24 15:42:33 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* In :
|
|
|
|
|
* X = #SYSCall
|
|
|
|
|
* Y,A = PATH (PSTR)
|
|
|
|
|
* Out :
|
|
|
|
|
* CC : Y,A = PTR to S.DIR
|
|
|
|
|
* CS : A = EC
|
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
K.OPENDIRYA jsr PFT.CheckPathYA
|
2016-09-01 15:42:38 +00:00
|
|
|
|
>STYA ZPQuickPtr2
|
2016-10-13 16:00:27 +00:00
|
|
|
|
>STYA MLICALL.PARAMS+1 For GETFILEINFO,MLIOPEN
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2016-09-01 15:42:38 +00:00
|
|
|
|
>PUSHWI S.DIR.PRODOS
|
|
|
|
|
>PUSHBI S.MEM.F.INIT0
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMem
|
2016-09-01 15:42:38 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPQuickPtr1
|
2016-09-23 15:19:22 +00:00
|
|
|
|
stx K.OPENDIRYA.hDIR
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
|
|
|
|
lda (ZPQuickPtr2)
|
|
|
|
|
cmp #1 One char ?
|
|
|
|
|
bne .7 No, Go open dir....
|
|
|
|
|
tay Y=1
|
|
|
|
|
lda (ZPQuickPtr2),y
|
|
|
|
|
cmp #'/' Root required ?
|
|
|
|
|
beq .8 Yes, Go for ONLINE Call (S.DIR.PRODOS.REF=0)
|
|
|
|
|
|
|
|
|
|
lda #SYSMGR.ERRSYN
|
|
|
|
|
sec
|
|
|
|
|
.9 rts
|
|
|
|
|
|
2016-10-13 16:00:27 +00:00
|
|
|
|
.7 >MLICALL MLIGETFILEINFO
|
|
|
|
|
bcs .98 file/dir does not exists....quit
|
|
|
|
|
lda MLICALL.PARAMS+4
|
|
|
|
|
cmp #$0F Directory ?
|
|
|
|
|
bne .98
|
|
|
|
|
|
|
|
|
|
>PUSHWI 1024 get a ProDOS IOBUF
|
2016-09-01 15:42:38 +00:00
|
|
|
|
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMem
|
2016-09-01 15:42:38 +00:00
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
>STYA MLICALL.PARAMS+3 Save Ptr to IOBUF for MLIOPEN call
|
|
|
|
|
txa
|
|
|
|
|
ldy #S.DIR.PRODOS.IOBUF
|
|
|
|
|
sta (ZPQuickPtr1),y
|
|
|
|
|
|
|
|
|
|
>MLICALL MLIOPEN
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
lda MLICALL.PARAMS+5 get ref_num
|
|
|
|
|
ldy #S.DIR.PRODOS.REF
|
|
|
|
|
sta (ZPQuickPtr1),y
|
2016-08-24 15:42:33 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.8 lda K.OPENDIRYA.hDIR
|
2016-08-24 15:42:33 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
|
|
|
|
.98 pha save MLI error
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.CLOSEDIRA.1
|
2016-09-01 15:42:38 +00:00
|
|
|
|
pla get back MLI error
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2016-09-23 15:19:22 +00:00
|
|
|
|
K.OPENDIRYA.hDIR .BS 1
|
2016-08-24 15:42:33 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* In :
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hDIR
|
2016-08-24 15:42:33 +00:00
|
|
|
|
* Out :
|
2016-09-01 15:42:38 +00:00
|
|
|
|
* CC : X = hDIREND, Y,A = PTR to S.DIRENT
|
|
|
|
|
* CS : A = EC, A = 0 : no more entry
|
2016-08-24 15:42:33 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-23 15:19:22 +00:00
|
|
|
|
K.READDIRA.hMem .BS 1
|
|
|
|
|
K.READDIRA.hDIRENT .BS 1
|
|
|
|
|
K.READDIRA.BufSize .BS 2
|
|
|
|
|
K.READDIRA.EL .BS 1
|
|
|
|
|
K.READDIRA.EBP .BS 1
|
|
|
|
|
K.READDIRA.EC .BS 2
|
|
|
|
|
K.READDIRA.ECIB .BS 1
|
|
|
|
|
K.READDIRA.EC2Return .BS 1
|
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
K.READDIRA jsr PFT.CheckDirA
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
2016-09-01 15:42:38 +00:00
|
|
|
|
>STYA ZPQuickPtr1
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.DIR.F
|
|
|
|
|
lda (ZPQuickPtr1),y
|
|
|
|
|
and #S.DIR.F.NOMORE
|
|
|
|
|
bne .9
|
|
|
|
|
|
2016-09-01 15:42:38 +00:00
|
|
|
|
ldy #S.DIR.PRODOS.REF
|
|
|
|
|
lda (ZPQuickPtr1),y
|
2016-09-21 15:20:37 +00:00
|
|
|
|
beq K.READDIRA.ROOT
|
|
|
|
|
jmp K.READDIRA.DIR
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
.9 lda #0
|
|
|
|
|
sec CS,A=0 no more entry
|
2016-09-23 15:19:22 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.READDIRA.ROOT stz MLICALL.PARAMS+1 All Volumes
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI 256 Get a 256 bytes buffer for ONLINE call...
|
|
|
|
|
>PUSHBI 0
|
|
|
|
|
jsr K.GetMem
|
|
|
|
|
bcs .99
|
|
|
|
|
stx K.READDIRA.hMem
|
|
|
|
|
|
2016-09-01 15:42:38 +00:00
|
|
|
|
>STYA MLICALL.PARAMS+2
|
2016-09-23 15:19:22 +00:00
|
|
|
|
>STYA ZPQuickPtr2 For PASS #1 & #2
|
2016-09-01 15:42:38 +00:00
|
|
|
|
>MLICALL MLIONLINE
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bcc .10
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.98 jsr K.READDIRA.CLN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
* pass #1 compute BufSize.....
|
|
|
|
|
.10 lda #1 +1 for Ending 0
|
|
|
|
|
sta K.READDIRA.BufSize
|
|
|
|
|
stz K.READDIRA.BufSize+1
|
|
|
|
|
|
|
|
|
|
stz K.READDIRA.EC
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.1 lda (ZPQuickPtr2),y
|
2016-09-01 15:42:38 +00:00
|
|
|
|
and #$0F
|
|
|
|
|
beq .2
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
inc K.READDIRA.EC increase entry count
|
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
sec Add Filelen +1
|
2016-09-23 15:19:22 +00:00
|
|
|
|
adc #S.STAT will ends with CC
|
|
|
|
|
adc K.READDIRA.BufSize
|
|
|
|
|
sta K.READDIRA.BufSize
|
|
|
|
|
bcc .2
|
|
|
|
|
inc K.READDIRA.BufSize+1
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
|
|
|
|
.2 tya
|
2016-08-29 15:12:04 +00:00
|
|
|
|
clc
|
2016-09-01 15:42:38 +00:00
|
|
|
|
adc #16
|
|
|
|
|
tay
|
2016-09-02 15:14:24 +00:00
|
|
|
|
bcc .1 loop until 256 bytes scanned
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
* pass #2 Fill Buffer...
|
|
|
|
|
jsr K.READDIRA.GetBuf
|
|
|
|
|
bcs .98
|
2016-09-02 06:09:44 +00:00
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
.3 lda (ZPQuickPtr2)
|
2016-09-02 06:09:44 +00:00
|
|
|
|
and #$0F
|
2016-09-02 15:14:24 +00:00
|
|
|
|
beq .88
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
tax
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-10-13 16:00:27 +00:00
|
|
|
|
>LDYA ZPQuickPtr4 Store actual PTR for MLIGETFILEINFO
|
2016-09-23 15:19:22 +00:00
|
|
|
|
>STYA MLICALL.PARAMS+1
|
|
|
|
|
|
|
|
|
|
txa
|
2016-09-02 15:14:24 +00:00
|
|
|
|
inc
|
2016-09-23 15:19:22 +00:00
|
|
|
|
jsr K.READDIRA.AddToBuf
|
|
|
|
|
lda #'/'
|
|
|
|
|
jsr K.READDIRA.AddToBuf
|
|
|
|
|
|
|
|
|
|
ldy #1
|
2016-09-02 06:09:44 +00:00
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
.4 lda (ZPQuickPtr2),y
|
2016-09-23 15:19:22 +00:00
|
|
|
|
jsr K.READDIRA.AddToBuf
|
|
|
|
|
iny
|
|
|
|
|
dex
|
2016-09-02 15:14:24 +00:00
|
|
|
|
bne .4
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2016-10-13 16:00:27 +00:00
|
|
|
|
jsr K.READDIRA.ClrStat
|
|
|
|
|
|
|
|
|
|
lda (ZPQuickPtr2)
|
|
|
|
|
|
|
|
|
|
asl DRIVE in Carry
|
|
|
|
|
pha
|
|
|
|
|
lda #0
|
|
|
|
|
rol
|
|
|
|
|
inc
|
|
|
|
|
sta KrnBuf256+S.STAT.PRODOS.DRIVE
|
|
|
|
|
pla
|
|
|
|
|
lsr CC
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
sta KrnBuf256+S.STAT.PRODOS.SLOT
|
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
>MLICALL MLIGETFILEINFO
|
2016-10-13 16:00:27 +00:00
|
|
|
|
sta KrnBuf256+S.STAT.PRODOS.DEVSTATUS
|
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
bcs .80
|
2016-10-13 16:00:27 +00:00
|
|
|
|
>LDYA MLICALL.PARAMS+5 AUXTYPE=TOTAL BLOCKS
|
|
|
|
|
>STYA KrnBuf256+S.STAT.PRODOS.DEVBLOCKS
|
|
|
|
|
>LDYA MLICALL.PARAMS+8
|
|
|
|
|
>STYA KrnBuf256+S.STAT.BLOCKS
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.80 jsr K.READDIRA.ADDSTAT
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
|
|
|
|
.88 lda ZPQuickPtr2
|
|
|
|
|
clc
|
|
|
|
|
adc #16
|
|
|
|
|
sta ZPQuickPtr2
|
|
|
|
|
bcc .89
|
|
|
|
|
inc ZPQuickPtr2+1
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.89 dec K.READDIRA.EC
|
2016-09-02 15:14:24 +00:00
|
|
|
|
bne .3
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
* lda #0 done by S.MEM.F.INIT0
|
|
|
|
|
* sta (ZPQuickPtr4) Ending 0
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.DIR.F
|
|
|
|
|
lda #S.DIR.F.NOMORE
|
|
|
|
|
sta (ZPQuickPtr1),y
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
jsr K.READDIRA.CLN Discard ONLINE BUFFER
|
|
|
|
|
|
|
|
|
|
lda K.READDIRA.hDIRENT
|
|
|
|
|
tax
|
|
|
|
|
jmp K.GetMemPtrA
|
2016-09-20 06:17:20 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.READDIRA.DIR ldy #S.DIR.PRODOS.REF
|
2016-09-20 06:17:20 +00:00
|
|
|
|
lda (ZPQuickPtr1),y
|
|
|
|
|
sta MLICALL.PARAMS+1
|
2016-09-02 06:09:44 +00:00
|
|
|
|
|
2016-09-20 06:17:20 +00:00
|
|
|
|
>PUSHWI 512 Get a 512 bytes buffer for reading dir...
|
|
|
|
|
>PUSHBI 0
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMem
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bcs .99
|
2016-09-21 15:20:37 +00:00
|
|
|
|
stx K.READDIRA.hMem
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
2016-09-20 06:17:20 +00:00
|
|
|
|
>STYA MLICALL.PARAMS+2 For reading
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
tya
|
2016-09-21 15:20:37 +00:00
|
|
|
|
* clc CC from K.GetMem
|
2016-09-20 06:17:20 +00:00
|
|
|
|
adc #4 Skip 4 bytes linked list
|
2016-09-23 15:19:22 +00:00
|
|
|
|
sta ZPQuickPtr2 PTR to Buffer for PASS #1
|
|
|
|
|
sta ZPQuickPtr3 PTR to Buffer for PASS #2
|
|
|
|
|
|
2016-09-20 06:17:20 +00:00
|
|
|
|
pla
|
|
|
|
|
adc #0
|
2016-09-23 15:19:22 +00:00
|
|
|
|
sta ZPQuickPtr2+1 PTR to Buffer for PASS #1
|
|
|
|
|
sta ZPQuickPtr3+1 PTR to Buffer for PASS #2
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI 512
|
|
|
|
|
>STYA MLICALL.PARAMS+4
|
|
|
|
|
>MLICALL MLIREAD Read A block from directory
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
ldy #S.DIR.PRODOS.EL Check if first run....
|
|
|
|
|
lda (ZPQuickPtr1),y
|
|
|
|
|
bne .2 no, we have all we need....
|
|
|
|
|
|
2016-09-23 06:00:00 +00:00
|
|
|
|
ldy #$1f+3
|
|
|
|
|
ldx #3
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.1 lda (ZPQuickPtr2),y Get K.READDIRA.EL.... From Block
|
|
|
|
|
sta K.READDIRA.EL,x
|
2016-09-20 06:17:20 +00:00
|
|
|
|
dey
|
2016-09-23 06:00:00 +00:00
|
|
|
|
dex
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bpl .1
|
|
|
|
|
bra .4
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.98 jsr K.READDIRA.CLN
|
2016-09-20 06:17:20 +00:00
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
|
|
|
|
|
.2 ldy #S.DIR.PRODOS.EL+3
|
2016-09-22 15:46:01 +00:00
|
|
|
|
ldx #3
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-22 15:46:01 +00:00
|
|
|
|
.3 lda (ZPQuickPtr1),y get this session parameters from S.DIR
|
2016-09-23 15:19:22 +00:00
|
|
|
|
sta K.READDIRA.EL,x
|
2016-09-20 06:17:20 +00:00
|
|
|
|
dey
|
2016-09-22 15:46:01 +00:00
|
|
|
|
dex
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bpl .3
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.4 ldx K.READDIRA.EC
|
|
|
|
|
cpx K.READDIRA.EBP
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
lda K.READDIRA.EC+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
sbc #0
|
|
|
|
|
bcc .5 We have less than EPB to read
|
2016-09-23 15:19:22 +00:00
|
|
|
|
ldx K.READDIRA.EBP
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.5 stx K.READDIRA.ECIB
|
|
|
|
|
stz K.READDIRA.EC2Return
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
lda #1 For Ending 0
|
2016-09-23 15:19:22 +00:00
|
|
|
|
sta K.READDIRA.BufSize
|
|
|
|
|
stz K.READDIRA.BufSize+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
* pass #1 compute BufSize.....
|
2016-09-23 15:19:22 +00:00
|
|
|
|
K.READDIRA.DIR1 lda (ZPQuickPtr2) X = EntryCount In This Block
|
2016-09-20 06:17:20 +00:00
|
|
|
|
beq .7 Free slot....goto next
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
tay save LEN
|
|
|
|
|
|
|
|
|
|
and #$F0 get storage_type
|
|
|
|
|
cmp #$F0 Volume header ?
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #$E0 directory header ?
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
inc K.READDIRA.EC2Return regular DIR or File....
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
and #$F get filename len
|
|
|
|
|
sec add "#<filename>" + S.STAT
|
|
|
|
|
|
|
|
|
|
adc #S.STAT
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
|
|
|
|
|
.1 lda #2+S.STAT add "1." string + S.STAT
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
|
|
|
|
|
.2 lda #2+S.STAT+3+S.STAT add "1." + S.STAT + "2.." + S.STAT...
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
clc
|
|
|
|
|
adc K.READDIRA.BufSize
|
|
|
|
|
sta K.READDIRA.BufSize
|
|
|
|
|
bcc .7
|
|
|
|
|
inc K.READDIRA.BufSize+1
|
|
|
|
|
|
2016-09-20 06:17:20 +00:00
|
|
|
|
.7 lda ZPQuickPtr2
|
|
|
|
|
clc
|
2016-09-23 15:19:22 +00:00
|
|
|
|
adc K.READDIRA.EL
|
2016-09-20 06:17:20 +00:00
|
|
|
|
sta ZPQuickPtr2
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bcc .8
|
2016-09-20 06:17:20 +00:00
|
|
|
|
inc ZPQuickPtr2+1
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.8 dex
|
|
|
|
|
bne K.READDIRA.DIR1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
* pass #2 Fill Buffer...
|
2016-09-23 15:19:22 +00:00
|
|
|
|
K.READDIRA.DIR2 jsr K.READDIRA.GetBuf
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bcs .98
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
ldy #S.DIR.PRODOS.EL Check if first run....
|
|
|
|
|
lda (ZPQuickPtr1),y
|
|
|
|
|
bne .73
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
lda (ZPQuickPtr3)
|
2016-09-23 15:19:22 +00:00
|
|
|
|
and #$F0
|
|
|
|
|
cmp #$F0 Vol Header ?
|
|
|
|
|
bne .72
|
|
|
|
|
jsr K.READDIRA.ADD.
|
|
|
|
|
bra .78
|
|
|
|
|
|
|
|
|
|
.72 cmp #$E0 Dir Header ?
|
|
|
|
|
bne .73
|
|
|
|
|
jsr K.READDIRA.ADD.
|
|
|
|
|
jsr K.READDIRA.ADD..
|
|
|
|
|
bra .78
|
|
|
|
|
|
|
|
|
|
.73 lda K.READDIRA.EC
|
|
|
|
|
sec
|
|
|
|
|
sbc #1
|
|
|
|
|
sta K.READDIRA.EC
|
|
|
|
|
bcs .74
|
|
|
|
|
|
|
|
|
|
lda K.READDIRA.EC+1
|
|
|
|
|
sbc #0
|
|
|
|
|
sta K.READDIRA.EC+1 CC, we reached $ffff
|
|
|
|
|
bcc .80 no more file to list...
|
|
|
|
|
|
|
|
|
|
.74 lda (ZPQuickPtr3)
|
2016-09-20 06:17:20 +00:00
|
|
|
|
beq .78
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
and #$F0
|
|
|
|
|
cmp #$D0 Directory ?
|
|
|
|
|
bne .75
|
|
|
|
|
jsr K.READDIRA.ADDD
|
|
|
|
|
bra .78
|
|
|
|
|
|
|
|
|
|
.75 jsr K.READDIRA.ADDF
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
.78 lda ZPQuickPtr3
|
|
|
|
|
clc
|
2016-09-23 15:19:22 +00:00
|
|
|
|
adc K.READDIRA.EL
|
2016-09-20 06:17:20 +00:00
|
|
|
|
sta ZPQuickPtr3
|
|
|
|
|
bcc .79
|
|
|
|
|
inc ZPQuickPtr3+1
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.79 dec K.READDIRA.ECIB
|
2016-09-23 06:00:00 +00:00
|
|
|
|
bne .72
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
.80
|
|
|
|
|
* lda #0 S.MEM.F.INIT0 already did this
|
|
|
|
|
* sta (ZPQuickPtr4) Ending 0
|
|
|
|
|
|
2016-09-22 15:46:01 +00:00
|
|
|
|
ldx #3
|
2016-09-20 06:17:20 +00:00
|
|
|
|
ldy #S.DIR.PRODOS.EL+3
|
2016-09-22 15:46:01 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.8 lda K.READDIRA.EL,x Store back this session prameters to S.DIR
|
2016-09-20 06:17:20 +00:00
|
|
|
|
sta (ZPQuickPtr1),y
|
|
|
|
|
dey
|
2016-09-22 15:46:01 +00:00
|
|
|
|
dex
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bpl .8
|
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
jsr K.READDIRA.CLN Discard READBUFFER
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
lda K.READDIRA.hDIRENT
|
2016-09-20 06:17:20 +00:00
|
|
|
|
tax
|
2016-09-23 15:19:22 +00:00
|
|
|
|
jmp K.GetMemPtrA
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.98 jsr K.READDIRA.CLN
|
|
|
|
|
sec
|
2016-09-20 06:17:20 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-09-23 15:19:22 +00:00
|
|
|
|
K.READDIRA.CLN pha
|
|
|
|
|
lda K.READDIRA.hMem
|
|
|
|
|
jsr K.FreeMemA
|
|
|
|
|
pla
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.READDIRA.GetBuf
|
|
|
|
|
>PUSHW K.READDIRA.BufSize Get a BufSize bytes buffer for storing results
|
|
|
|
|
>PUSHBI S.MEM.F.INIT0 make sure 0 filled
|
|
|
|
|
jsr K.GetMem
|
|
|
|
|
bcs .9
|
|
|
|
|
stx K.READDIRA.hDIRENT
|
|
|
|
|
>STYA ZPQuickPtr4
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2016-10-14 06:23:05 +00:00
|
|
|
|
K.READDIRA.ADD. ldx #1 filename="1."
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
K.READDIRA.ADD..
|
|
|
|
|
ldx #2 filename="2.."
|
|
|
|
|
txa
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.READDIRA.AddToBuf
|
2016-09-22 15:46:01 +00:00
|
|
|
|
lda #'.' filename="1."
|
2016-10-14 06:23:05 +00:00
|
|
|
|
|
|
|
|
|
.1 jsr K.READDIRA.AddToBuf
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
jsr K.READDIRA.ClrStat
|
|
|
|
|
|
2016-09-26 06:18:51 +00:00
|
|
|
|
lda #$0F
|
2016-10-03 06:18:46 +00:00
|
|
|
|
sta KrnBuf256+S.STAT.PRODOS.TYPE
|
2016-09-26 06:18:51 +00:00
|
|
|
|
|
2016-10-14 06:23:05 +00:00
|
|
|
|
* ldy #$25 total_blocks
|
|
|
|
|
* lda (ZPQuickPtr3),y
|
|
|
|
|
* sta KrnBuf256+S.STAT.BLOCKS
|
|
|
|
|
* iny
|
|
|
|
|
* lda (ZPQuickPtr3),y
|
|
|
|
|
* sta KrnBuf256+S.STAT.BLOCKS+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bra K.READDIRA.ADDSTAT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.READDIRA.ADDD jsr K.READDIRA.AddFNToBuf
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
jsr K.READDIRA.ClrStat
|
|
|
|
|
|
2016-09-26 06:18:51 +00:00
|
|
|
|
lda #$0F
|
2016-10-03 06:18:46 +00:00
|
|
|
|
sta KrnBuf256+S.STAT.PRODOS.TYPE
|
2016-09-26 06:18:51 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bra K.READDIRA.ADDSTAT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.READDIRA.ADDF jsr K.READDIRA.AddFNToBuf
|
|
|
|
|
|
|
|
|
|
jsr K.READDIRA.ClrStat
|
|
|
|
|
|
2016-10-14 06:23:05 +00:00
|
|
|
|
ldx #ADDF.DST-ADDF.SRC
|
|
|
|
|
.1 ldy ADDF.SRC-1,x
|
2016-09-23 15:19:22 +00:00
|
|
|
|
lda (ZPQuickPtr3),y
|
2016-10-14 06:23:05 +00:00
|
|
|
|
ldy ADDF.DST-1,x
|
|
|
|
|
sta KrnBuf256,y
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
2016-10-13 16:00:27 +00:00
|
|
|
|
|
2016-10-14 06:23:05 +00:00
|
|
|
|
>PUSHWI KrnBuf256+S.STAT.CTIME
|
|
|
|
|
lda #$18 creation Date/time
|
|
|
|
|
jsr K.READDIRA.ConvertTime
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-10-14 06:23:05 +00:00
|
|
|
|
>PUSHWI KrnBuf256+S.STAT.MTIME
|
|
|
|
|
lda #$21 mod Date/time
|
|
|
|
|
jsr K.READDIRA.ConvertTime
|
2016-09-23 15:19:22 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.READDIRA.AddStat
|
|
|
|
|
ldy #S.STAT-1
|
|
|
|
|
|
2016-09-26 06:18:51 +00:00
|
|
|
|
.1 lda KrnBuf256,y
|
2016-09-23 15:19:22 +00:00
|
|
|
|
sta (ZPQuickPtr4),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
lda ZPQuickPtr4
|
2016-09-02 06:09:44 +00:00
|
|
|
|
clc
|
2016-09-20 06:17:20 +00:00
|
|
|
|
adc #S.STAT
|
|
|
|
|
sta ZPQuickPtr4
|
|
|
|
|
bcc .8
|
|
|
|
|
inc ZPQuickPtr4+1
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2016-09-23 15:19:22 +00:00
|
|
|
|
K.READDIRA.ClrStat
|
|
|
|
|
ldx #S.STAT-1
|
|
|
|
|
|
2016-09-26 06:18:51 +00:00
|
|
|
|
.1 stz KrnBuf256,x
|
2016-10-13 16:00:27 +00:00
|
|
|
|
dex
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bpl .1
|
|
|
|
|
rts
|
2016-09-20 06:17:20 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-22 15:46:01 +00:00
|
|
|
|
K.READDIRA.AddFNToBuf
|
|
|
|
|
lda (ZPQuickPtr3)
|
|
|
|
|
and #$0F get filename len
|
|
|
|
|
tax
|
|
|
|
|
jsr K.READDIRA.AddToBuf
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPQuickPtr3),y
|
|
|
|
|
jsr K.READDIRA.AddToBuf
|
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.READDIRA.AddToBuf
|
2016-09-20 06:17:20 +00:00
|
|
|
|
sta (ZPQuickPtr4)
|
|
|
|
|
inc ZPQuickPtr4
|
|
|
|
|
bne .8
|
|
|
|
|
inc ZPQuickPtr4+1
|
|
|
|
|
.8 rts
|
2016-08-24 15:42:33 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-14 06:23:05 +00:00
|
|
|
|
K.READDIRA.ConvertTime
|
|
|
|
|
clc
|
|
|
|
|
adc ZPQuickPtr3
|
|
|
|
|
tay
|
|
|
|
|
lda ZPQuickPtr3+1
|
|
|
|
|
adc #0
|
|
|
|
|
>PUSHYA
|
|
|
|
|
jmp K.PTime2Time
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
ADDF.SRC .HS 1013141516171f20
|
|
|
|
|
ADDF.DST .DA #S.STAT.PRODOS.TYPE,#S.STAT.BLOCKS,#S.STAT.BLOCKS+1
|
|
|
|
|
.DA #S.STAT.SIZE,#S.STAT.SIZE+1,#S.STAT.SIZE+2
|
|
|
|
|
.DA #S.STAT.PRODOS.AUXTYPE,#S.STAT.PRODOS.AUXTYPE+1
|
|
|
|
|
*--------------------------------------
|
2016-08-24 15:42:33 +00:00
|
|
|
|
* In :
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hDIR
|
2016-08-24 15:42:33 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
K.CLOSEDIRA jsr PFT.CheckDirA
|
2016-10-13 16:00:27 +00:00
|
|
|
|
sta K.OPENDIRYA.hDIR
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
2016-09-01 15:42:38 +00:00
|
|
|
|
>STYA ZPQuickPtr1
|
2016-10-13 16:00:27 +00:00
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.CLOSEDIRA.1 ldy #S.DIR.PRODOS.REF
|
2016-09-01 15:42:38 +00:00
|
|
|
|
lda (ZPQuickPtr1),y
|
|
|
|
|
beq .1
|
|
|
|
|
sta MLICALL.PARAMS+1
|
|
|
|
|
>MLICALL MLICLOSE
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.DIR.PRODOS.IOBUF
|
|
|
|
|
lda (ZPQuickPtr1),y
|
|
|
|
|
beq .2
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.FreeMemA
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2016-10-13 16:00:27 +00:00
|
|
|
|
.2 lda K.OPENDIRYA.hDIR
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.FreeMemA
|
2016-08-29 15:12:04 +00:00
|
|
|
|
clc
|
2016-08-24 15:42:33 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
K.MKDIRYA jsr PFT.CheckPathYA
|
2016-09-05 16:00:11 +00:00
|
|
|
|
>STYA MLICALL.PARAMS+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
lda #S.FILEINFO.ACCESS.FULL
|
|
|
|
|
sta MLICALL.PARAMS+S.FILEINFO.ACCESS
|
|
|
|
|
lda #S.FILEINFO.TYPE.DIR
|
|
|
|
|
sta MLICALL.PARAMS+S.FILEINFO.TYPE
|
|
|
|
|
lda #S.FILEINFO.STORETYPE.DIR
|
|
|
|
|
sta MLICALL.PARAMS+S.FILEINFO.STORETYPE
|
2016-09-05 16:00:11 +00:00
|
|
|
|
>MLICALL MLICREATE
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-08-24 15:42:33 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.DIR
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|