2016-08-24 15:42:33 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2016-08-24 15:42:33 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # OpenDir.YA
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In:
|
2017-08-24 15:29:22 +00:00
|
|
|
|
* Y,A = PATH (C-String)
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out:
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* CC : success
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* A = hDIR
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* CS : error
|
|
|
|
|
* A = EC
|
|
|
|
|
*\--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.OpenDir.YA jsr PFT.CheckPathYA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr2
|
2017-08-25 15:02:16 +00:00
|
|
|
|
jsr STDIO.SetMLIPathYA For GETFILEINFO,MLIOPEN
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2017-07-01 13:44:40 +00:00
|
|
|
|
>LDYAI S.NODE.DIR
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem0.YA
|
2017-06-21 15:46:43 +00:00
|
|
|
|
bcs .99
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-09-29 06:36:27 +00:00
|
|
|
|
stx .8+1
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2017-08-24 15:29:22 +00:00
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPPtr2),y One char ?
|
|
|
|
|
beq .8 No, Go open dir....
|
|
|
|
|
|
2016-10-13 16:00:27 +00:00
|
|
|
|
.7 >MLICALL MLIGETFILEINFO
|
|
|
|
|
bcs .98 file/dir does not exists....quit
|
2017-03-28 15:46:12 +00:00
|
|
|
|
lda K.MLI.PARAMS+4
|
2016-10-13 16:00:27 +00:00
|
|
|
|
cmp #$0F Directory ?
|
|
|
|
|
bne .98
|
|
|
|
|
|
2017-08-24 12:46:48 +00:00
|
|
|
|
jsr STDIO.SetIOBUF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2016-09-01 15:42:38 +00:00
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
>MLICALL MLIOPEN
|
|
|
|
|
bcs .98
|
|
|
|
|
|
2017-08-24 15:29:22 +00:00
|
|
|
|
lda K.MLI.PARAMS+5 get ref_num
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.NODE.DIR.REF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr1),y
|
2016-08-24 15:42:33 +00:00
|
|
|
|
|
2017-09-29 06:36:27 +00:00
|
|
|
|
.8 lda #$ff Self Modified
|
2016-08-24 15:42:33 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
|
|
|
|
.98 pha save MLI error
|
2017-09-29 06:36:27 +00:00
|
|
|
|
lda .8+1
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.CloseDir.A.1
|
2016-09-01 15:42:38 +00:00
|
|
|
|
pla get back MLI error
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # ReadDir.A
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In:
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hDIR
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out:
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* CC : success
|
|
|
|
|
* X = hDIRENT
|
|
|
|
|
* Y,A = PTR to S.DIRENT
|
|
|
|
|
* CS : error
|
|
|
|
|
* A = EC
|
|
|
|
|
* note : A = 0 means no more entry
|
|
|
|
|
*\--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.hDir .BS 1
|
|
|
|
|
K.ReadDir.A.hMem .BS 1
|
|
|
|
|
K.ReadDir.A.BufSize .BS 2
|
|
|
|
|
K.ReadDir.A.ECIB .BS 1
|
2016-10-14 15:39:49 +00:00
|
|
|
|
*--S.DIR Cache ------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.EL .BS 1
|
|
|
|
|
K.ReadDir.A.EPB .BS 1
|
|
|
|
|
K.ReadDir.A.EC .BS 2
|
2016-09-23 15:19:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A jsr PFT.CheckNodeA
|
|
|
|
|
sta K.ReadDir.A.hDir
|
|
|
|
|
jsr K.GetMemPtr.A
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.NODE.DIR.REF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
beq K.ReadDir.A.ROOT
|
|
|
|
|
jmp K.ReadDir.A.DIR
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.NoMore
|
2016-12-09 16:36:24 +00:00
|
|
|
|
lda #0
|
2016-09-02 15:14:24 +00:00
|
|
|
|
sec CS,A=0 no more entry
|
2016-09-23 15:19:22 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.ROOT
|
|
|
|
|
ldy #S.NODE.DIR.FC did we already returned something ?
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
bne K.ReadDir.A.NoMore
|
2016-12-09 16:36:24 +00:00
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
stz K.MLI.PARAMS+1 All Volumes
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2017-08-24 12:46:48 +00:00
|
|
|
|
>LDYAI K.Buf256
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+2
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr2
|
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
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
* pass #1 compute BufSize.....
|
|
|
|
|
.10 lda #1 +1 for Ending 0
|
2017-08-25 06:37:21 +00:00
|
|
|
|
sta K.ReadDir.A.BufSize
|
|
|
|
|
stz K.ReadDir.A.BufSize+1
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
stz K.ReadDir.A.EC
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 lda (ZPPtr2),y
|
2016-09-01 15:42:38 +00:00
|
|
|
|
and #$0F
|
|
|
|
|
beq .2
|
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
inc K.ReadDir.A.EC increase entry count
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
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
|
2017-08-25 06:37:21 +00:00
|
|
|
|
adc K.ReadDir.A.BufSize
|
|
|
|
|
sta K.ReadDir.A.BufSize
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bcc .2
|
2017-08-25 06:37:21 +00:00
|
|
|
|
inc K.ReadDir.A.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...
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.GetBuf
|
2016-10-18 15:56:06 +00:00
|
|
|
|
bcs .99
|
2016-09-02 06:09:44 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.3 lda (ZPPtr2)
|
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-10-30 07:58:08 +00:00
|
|
|
|
inc
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PATH
|
2016-09-23 15:19:22 +00:00
|
|
|
|
lda #'/'
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PATH+1
|
2016-09-23 15:19:22 +00:00
|
|
|
|
ldy #1
|
2016-09-02 06:09:44 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.4 lda (ZPPtr2),y
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PATH+1,y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.AddToBuf
|
2016-09-23 15:19:22 +00:00
|
|
|
|
iny
|
|
|
|
|
dex
|
2016-09-02 15:14:24 +00:00
|
|
|
|
bne .4
|
2016-09-01 15:42:38 +00:00
|
|
|
|
|
2017-08-24 15:29:22 +00:00
|
|
|
|
txa Add ending 0 for C String
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.AddToBuf
|
2017-08-24 15:29:22 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.ClrStat
|
2016-10-13 16:00:27 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr2)
|
2016-10-13 16:00:27 +00:00
|
|
|
|
|
|
|
|
|
asl DRIVE in Carry
|
|
|
|
|
pha
|
|
|
|
|
lda #0
|
|
|
|
|
rol
|
|
|
|
|
inc
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT+S.STAT.P.DRIVE
|
2016-10-13 16:00:27 +00:00
|
|
|
|
pla
|
|
|
|
|
lsr CC
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT+S.STAT.P.SLOT
|
2016-10-13 16:00:27 +00:00
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>LDYAI K.MLI.PATH
|
|
|
|
|
>STYA K.MLI.PARAMS+1
|
2016-10-30 07:58:08 +00:00
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
>MLICALL MLIGETFILEINFO
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT+S.STAT.P.DEVSTATUS
|
2016-10-13 16:00:27 +00:00
|
|
|
|
|
2016-09-02 15:14:24 +00:00
|
|
|
|
bcs .80
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>LDYA K.MLI.PARAMS+5 AUXTYPE=TOTAL BLOCKS
|
2017-03-21 16:29:15 +00:00
|
|
|
|
>STYA K.S.STAT+S.STAT.P.DEVBLOCKS
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>LDYA K.MLI.PARAMS+8
|
2017-03-21 16:29:15 +00:00
|
|
|
|
>STYA K.S.STAT+S.STAT.BLOCKS
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.80 jsr K.ReadDir.A.ADDSTAT
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.88 lda ZPPtr2
|
2016-09-02 15:14:24 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #16
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr2
|
2016-09-02 15:14:24 +00:00
|
|
|
|
bcc .89
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr2+1
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.89 dec K.ReadDir.A.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
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* sta (ZPPtr4) Ending 0
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.NODE.DIR.FC
|
|
|
|
|
lda #16
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr1),y Flag that we returned somthing for next time
|
2017-09-29 06:36:27 +00:00
|
|
|
|
|
|
|
|
|
jmp K.ReadDir.A.EXIT
|
2016-09-20 06:17:20 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
|
2016-09-02 06:09:44 +00:00
|
|
|
|
|
2017-07-01 13:44:40 +00:00
|
|
|
|
>LDYAI 512 Get a 512 bytes buffer for reading dir...
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem.YA
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bcs .99
|
2017-08-25 06:37:21 +00:00
|
|
|
|
stx K.ReadDir.A.hMem
|
2016-09-02 15:14:24 +00:00
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+2 For reading
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
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
|
2017-06-21 15:46:43 +00:00
|
|
|
|
sta ZPPtr2 PTR to Buffer for PASS #1
|
|
|
|
|
sta ZPPtr3 PTR to Buffer for PASS #2
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-09-20 06:17:20 +00:00
|
|
|
|
pla
|
|
|
|
|
adc #0
|
2017-06-21 15:46:43 +00:00
|
|
|
|
sta ZPPtr2+1 PTR to Buffer for PASS #1
|
|
|
|
|
sta ZPPtr3+1 PTR to Buffer for PASS #2
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI 512
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+4
|
2016-09-20 06:17:20 +00:00
|
|
|
|
>MLICALL MLIREAD Read A block from directory
|
|
|
|
|
bcs .98
|
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.NODE.DIR.EL Check if first run....
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bne .2 no, we have all we need....
|
|
|
|
|
|
2016-09-23 06:00:00 +00:00
|
|
|
|
ldy #$1f+3
|
|
|
|
|
ldx #3
|
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.1 lda (ZPPtr2),y Get K.ReadDir.A.EL.... From Block
|
|
|
|
|
sta K.ReadDir.A.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
|
2016-10-24 15:54:43 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
inc K.ReadDir.A.EC Add one to EC because we include VOL/DIR Header
|
2016-10-24 15:54:43 +00:00
|
|
|
|
bne .4
|
2017-08-25 06:37:21 +00:00
|
|
|
|
inc K.ReadDir.A.EC+1 ...and ProDOS does NOT include header entry in EC
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bra .4
|
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.98 jsr K.ReadDir.A.CLN
|
2016-09-20 06:17:20 +00:00
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
.2 ldy #S.NODE.DIR.EL+3
|
2016-09-22 15:46:01 +00:00
|
|
|
|
ldx #3
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.3 lda (ZPPtr1),y get this session parameters from S.DIR
|
2017-08-25 06:37:21 +00:00
|
|
|
|
sta K.ReadDir.A.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
|
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.4 lda K.ReadDir.A.EC
|
2016-10-30 18:17:43 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
tax
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
lda K.ReadDir.A.EC+1
|
2016-10-30 18:17:43 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
tay
|
2016-10-24 15:54:43 +00:00
|
|
|
|
|
2016-10-30 18:17:43 +00:00
|
|
|
|
inx Any entry remaining ?
|
|
|
|
|
bne .5
|
|
|
|
|
iny
|
|
|
|
|
beq .98 no...exit
|
|
|
|
|
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* pass #1 compute BufSize...
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.5 lda K.ReadDir.A.EPB
|
|
|
|
|
sta K.ReadDir.A.ECIB
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
|
|
|
|
lda #1 For Ending 0
|
2017-08-25 06:37:21 +00:00
|
|
|
|
sta K.ReadDir.A.BufSize
|
|
|
|
|
stz K.ReadDir.A.BufSize+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.DIR1 lda (ZPPtr2) 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
|
|
|
|
and #$F0 get storage_type
|
|
|
|
|
cmp #$F0 Volume header ?
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #$E0 directory header ?
|
|
|
|
|
beq .2
|
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
lda (ZPPtr2) regular DIR or File, get LEN
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-10-24 15:54:43 +00:00
|
|
|
|
and #$F compute filename len
|
2016-09-23 15:19:22 +00:00
|
|
|
|
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
|
2017-08-25 06:37:21 +00:00
|
|
|
|
adc K.ReadDir.A.BufSize
|
|
|
|
|
sta K.ReadDir.A.BufSize
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bcc .3
|
2017-08-25 06:37:21 +00:00
|
|
|
|
inc K.ReadDir.A.BufSize+1
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-10-30 18:17:43 +00:00
|
|
|
|
.3 inx
|
|
|
|
|
bne .7
|
|
|
|
|
iny
|
2017-08-25 06:37:21 +00:00
|
|
|
|
bra K.ReadDir.A.DIR2 we reached last entry in whole DIR
|
2016-10-30 18:17:43 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.7 lda ZPPtr2
|
2016-09-20 06:17:20 +00:00
|
|
|
|
clc
|
2017-08-25 06:37:21 +00:00
|
|
|
|
adc K.ReadDir.A.EL
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr2
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bcc .8
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr2+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.8 dec K.ReadDir.A.ECIB
|
|
|
|
|
bne K.ReadDir.A.DIR1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* pass #2 Fill Buffer...(ZPPtr1 & Ptr2 can now be trashed)
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.DIR2 jsr K.ReadDir.A.GetBuf
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
lda K.ReadDir.A.EPB
|
|
|
|
|
sta K.ReadDir.A.ECIB
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 lda (ZPPtr3)
|
2016-10-30 18:17:43 +00:00
|
|
|
|
beq .7 Empty slot, skip
|
2016-10-14 15:39:49 +00:00
|
|
|
|
|
2016-09-23 15:19:22 +00:00
|
|
|
|
and #$F0
|
|
|
|
|
cmp #$F0 Vol Header ?
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bne .2
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.ADD.
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bra .6
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-10-30 18:17:43 +00:00
|
|
|
|
.2 cmp #$E0 Dir Header ?
|
|
|
|
|
bne .3
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.ADD.
|
|
|
|
|
jsr K.ReadDir.A.ADD..
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bra .6
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.3 jsr K.ReadDir.A.AddFNToBuf
|
|
|
|
|
jsr K.ReadDir.A.ClrStat
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr3)
|
2016-09-23 15:19:22 +00:00
|
|
|
|
and #$F0
|
|
|
|
|
cmp #$D0 Directory ?
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bne .5
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.ADDD
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bra .6
|
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.5 jsr K.ReadDir.A.ADDF
|
2016-10-30 18:17:43 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.6 lda K.ReadDir.A.EC decrease global counter...
|
2016-10-30 18:17:43 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #1
|
2017-08-25 06:37:21 +00:00
|
|
|
|
sta K.ReadDir.A.EC
|
2016-10-30 18:17:43 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
lda K.ReadDir.A.EC+1
|
2016-10-30 18:17:43 +00:00
|
|
|
|
sbc #0
|
2017-08-25 06:37:21 +00:00
|
|
|
|
sta K.ReadDir.A.EC+1
|
|
|
|
|
ora K.ReadDir.A.EC
|
2016-10-30 18:17:43 +00:00
|
|
|
|
beq .8 0! no more files in DIR
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.7 dec K.ReadDir.A.ECIB 0! no more file in block
|
2016-10-30 18:17:43 +00:00
|
|
|
|
beq .8
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr3
|
2016-09-20 06:17:20 +00:00
|
|
|
|
clc
|
2017-08-25 06:37:21 +00:00
|
|
|
|
adc K.ReadDir.A.EL
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr3
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bcc .1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr3+1
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bra .1
|
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.9 jsr K.ReadDir.A.CLN
|
2016-10-30 18:17:43 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2016-10-30 18:17:43 +00:00
|
|
|
|
.8
|
2016-09-20 06:17:20 +00:00
|
|
|
|
* lda #0 S.MEM.F.INIT0 already did this
|
2017-09-29 06:36:27 +00:00
|
|
|
|
* sta (ZPPtr4) Ending 0
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-09-29 06:36:27 +00:00
|
|
|
|
lda K.ReadDir.A.hDir Restore ZPPtr1 trashed by STR API calls
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMemPtr.A
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2016-10-14 15:39:49 +00:00
|
|
|
|
|
2016-09-22 15:46:01 +00:00
|
|
|
|
ldx #3
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.NODE.DIR.EL+3
|
2016-09-22 15:46:01 +00:00
|
|
|
|
|
2017-09-29 06:36:27 +00:00
|
|
|
|
.81 lda K.ReadDir.A.EL,x Store back this session prameters to S.DIR
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr1),y
|
2016-09-20 06:17:20 +00:00
|
|
|
|
dey
|
2016-09-22 15:46:01 +00:00
|
|
|
|
dex
|
2016-10-30 18:17:43 +00:00
|
|
|
|
bpl .81
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.CLN Discard READBUFFER
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-09-29 06:36:27 +00:00
|
|
|
|
K.ReadDir.A.EXIT
|
|
|
|
|
ldx #$ff Self Modified : hDIRENT
|
|
|
|
|
txa
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jmp K.GetMemPtr.A
|
2016-09-20 06:17:20 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.CLN pha
|
|
|
|
|
lda K.ReadDir.A.hMem
|
|
|
|
|
jsr K.FreeMem.A
|
2016-09-23 15:19:22 +00:00
|
|
|
|
pla
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.GetBuf
|
|
|
|
|
>LDYA K.ReadDir.A.BufSize Get a BufSize bytes buffer for storing results
|
|
|
|
|
jsr K.GetMem0.YA make sure 0 filled
|
2016-09-23 15:19:22 +00:00
|
|
|
|
bcs .9
|
2017-09-29 06:36:27 +00:00
|
|
|
|
stx K.ReadDir.A.EXIT+1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr4
|
2016-09-23 15:19:22 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.ADD. ldx #1 filename="1."
|
2016-10-14 06:23:05 +00:00
|
|
|
|
.HS 2C bit abs
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.ADD..
|
2016-10-14 06:23:05 +00:00
|
|
|
|
ldx #2 filename="2.."
|
2016-10-14 15:39:49 +00:00
|
|
|
|
lda #'.'
|
2016-10-14 06:23:05 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
.1 jsr K.ReadDir.A.AddToBuf Add X dot(s)
|
2016-10-14 06:23:05 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2017-08-24 15:29:22 +00:00
|
|
|
|
txa
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.AddToBuf Add Ending 0
|
2016-09-20 06:17:20 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.ClrStat
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2016-10-14 06:23:05 +00:00
|
|
|
|
* ldy #$25 total_blocks
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* lda (ZPPtr3),y
|
2017-03-21 16:29:15 +00:00
|
|
|
|
* sta K.S.STAT+S.STAT.BLOCKS
|
2016-10-14 06:23:05 +00:00
|
|
|
|
* iny
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* lda (ZPPtr3),y
|
2017-03-21 16:29:15 +00:00
|
|
|
|
* sta K.S.STAT+S.STAT.BLOCKS+1
|
2016-09-23 15:19:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.ADDD
|
|
|
|
|
lda #$0F
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT+S.STAT.P.TYPE
|
2016-09-26 06:18:51 +00:00
|
|
|
|
|
2016-10-18 15:56:06 +00:00
|
|
|
|
lda /S.STAT.MODE.DIR
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT+S.STAT.MODE+1
|
2017-08-25 06:37:21 +00:00
|
|
|
|
bra K.ReadDir.A.AddAccess
|
2016-09-23 15:19:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.ADDF
|
|
|
|
|
lda /S.STAT.MODE.REG
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT+S.STAT.MODE+1
|
2016-10-18 15:56:06 +00:00
|
|
|
|
|
|
|
|
|
ldx #ADDF.DST-ADDF.SRC
|
|
|
|
|
|
2016-10-14 06:23:05 +00:00
|
|
|
|
.1 ldy ADDF.SRC-1,x
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr3),y
|
2016-10-14 06:23:05 +00:00
|
|
|
|
ldy ADDF.DST-1,x
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT,y
|
2016-10-14 06:23:05 +00:00
|
|
|
|
dex
|
2017-04-12 15:46:03 +00:00
|
|
|
|
bne .1
|
2016-10-18 15:56:06 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.AddAccess
|
2016-10-18 15:56:06 +00:00
|
|
|
|
ldy #$1E ProDOS Access
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr3),y
|
2016-10-18 15:56:06 +00:00
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
bit #$01 ProDOS R
|
|
|
|
|
beq .2
|
|
|
|
|
ldx #S.STAT.MODE.RO
|
|
|
|
|
|
|
|
|
|
.2 bit #$C2 ProDOS D,Rn,W
|
|
|
|
|
beq .3
|
|
|
|
|
txa
|
|
|
|
|
ora #S.STAT.MODE.XO+S.STAT.MODE.WO
|
|
|
|
|
.HS 89 bit imm to skip txa
|
|
|
|
|
|
|
|
|
|
.3 txa
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta K.S.STAT+S.STAT.MODE
|
2016-10-18 15:56:06 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.AddTime
|
2017-09-22 15:25:21 +00:00
|
|
|
|
>PUSHWI K.S.STAT+S.STAT.CTIME
|
2016-10-14 06:23:05 +00:00
|
|
|
|
lda #$18 creation Date/time
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.ConvertTime
|
2016-09-23 15:19:22 +00:00
|
|
|
|
|
2017-09-22 15:25:21 +00:00
|
|
|
|
>PUSHWI K.S.STAT+S.STAT.MTIME
|
2016-10-14 06:23:05 +00:00
|
|
|
|
lda #$21 mod Date/time
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.ConvertTime
|
2016-09-23 15:19:22 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.AddStat
|
2016-09-23 15:19:22 +00:00
|
|
|
|
ldy #S.STAT-1
|
|
|
|
|
|
2017-03-21 16:29:15 +00:00
|
|
|
|
.1 lda K.S.STAT,y
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr4),y
|
2016-09-23 15:19:22 +00:00
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr4
|
2016-09-02 06:09:44 +00:00
|
|
|
|
clc
|
2016-09-20 06:17:20 +00:00
|
|
|
|
adc #S.STAT
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr4
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bcc .8
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr4+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2017-08-25 15:02:16 +00:00
|
|
|
|
ADDF.SRC .HS 1013141516171f20
|
|
|
|
|
ADDF.DST .DA #S.STAT.P.TYPE,#S.STAT.BLOCKS,#S.STAT.BLOCKS+1
|
|
|
|
|
.DA #S.STAT.SIZE,#S.STAT.SIZE+1,#S.STAT.SIZE+2
|
|
|
|
|
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
|
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.ClrStat
|
2016-09-23 15:19:22 +00:00
|
|
|
|
ldx #S.STAT-1
|
|
|
|
|
|
2017-03-21 16:29:15 +00:00
|
|
|
|
.1 stz K.S.STAT,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
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.AddFNToBuf
|
2017-06-21 15:46:43 +00:00
|
|
|
|
ldy #$1C version/min_version for lowercase bitmap
|
|
|
|
|
lda (ZPPtr3),y check bxxxxxxx.xxxxxxxx...
|
|
|
|
|
bpl .7 not set, no lowercase bitmap present
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr3),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
lda #$1
|
|
|
|
|
sta .2+1
|
|
|
|
|
|
|
|
|
|
ldy #15
|
|
|
|
|
|
|
|
|
|
.1 pla
|
|
|
|
|
.2 bit #$ff
|
|
|
|
|
pha
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr3),y
|
|
|
|
|
ora #$20 convert a-z to A-Z adding from $4x to $6x
|
|
|
|
|
sta (ZPPtr3),y
|
|
|
|
|
|
|
|
|
|
.3 asl .2+1
|
|
|
|
|
bne .4
|
|
|
|
|
rol .2+1
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
.4 dey
|
|
|
|
|
bne .1
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
.7 lda (ZPPtr3)
|
2016-09-22 15:46:01 +00:00
|
|
|
|
and #$0F get filename len
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.8 lda (ZPPtr3),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.AddToBuf
|
2016-09-22 15:46:01 +00:00
|
|
|
|
iny
|
|
|
|
|
dex
|
2017-06-21 15:46:43 +00:00
|
|
|
|
bne .8
|
2017-08-24 15:29:22 +00:00
|
|
|
|
|
|
|
|
|
txa
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.ReadDir.A.AddToBuf
|
2017-08-24 15:29:22 +00:00
|
|
|
|
|
2016-09-22 15:46:01 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.AddToBuf
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr4)
|
|
|
|
|
inc ZPPtr4
|
2016-09-20 06:17:20 +00:00
|
|
|
|
bne .8
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr4+1
|
2016-09-20 06:17:20 +00:00
|
|
|
|
.8 rts
|
2016-08-24 15:42:33 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.ReadDir.A.ConvertTime
|
2016-10-14 06:23:05 +00:00
|
|
|
|
clc
|
2017-01-12 17:43:45 +00:00
|
|
|
|
adc ZPPtr3
|
2017-09-22 15:25:21 +00:00
|
|
|
|
tay
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr3+1
|
2016-10-14 06:23:05 +00:00
|
|
|
|
adc #0
|
2017-09-22 15:25:21 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
>SYSCALL PTime2Time
|
|
|
|
|
rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/-------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # CloseDir.A
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In:
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hDIR
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out:
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* none, always succeed.
|
|
|
|
|
*\-------------------------------------
|
2017-08-25 15:02:16 +00:00
|
|
|
|
K.CloseDir.A .EQ K.FClose.A
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.CloseDir.A.1 .EQ K.FClose.A.1
|
2016-09-05 16:00:11 +00:00
|
|
|
|
*--------------------------------------
|
2016-08-24 15:42:33 +00:00
|
|
|
|
MAN
|
2017-08-24 12:54:50 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.DIRENT
|
2017-03-29 15:48:15 +00:00
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2016-08-24 15:42:33 +00:00
|
|
|
|
ASM
|