remove old direct code

This commit is contained in:
Kelvin Sherlock 2015-08-14 15:43:38 -04:00
parent 146c05806a
commit e6aff91699

View File

@ -56,12 +56,8 @@ get_dir_entry procname export
with gde_dp with gde_dp
ldx <fcr_ptr jsr init_fcr
ldy <fcr_ptr+2 jsr init_vcr
jsl deref
stx <my_fcr
sty <my_fcr+2
; check for read-access ; check for read-access
ldy #fcr.access ldy #fcr.access
@ -103,7 +99,7 @@ dir
lda data.dirent.inode lda data.dirent.inode
beq dispatch beq dispatch
; if inode == the directory inode, no need to re-load it. ; if inode == the directory inode (.) , no need to re-load it.
cmp inode cmp inode
beq dispatch beq dispatch
@ -194,9 +190,23 @@ init proc
sta dev_parms.req_cnt sta dev_parms.req_cnt
stz dirent_offset ;stz dirent_offset
stz dirent_entry ;stz dirent_entry
stz dirent_zone ;stz dirent_zone
ldy #fcr.dirent_zone
lda [my_fcr],y
sta dirent_zone
ldy #fcr.dirent_offset
lda [my_fcr],y
sta dirent_offset
ldy #fcr.dirent_entry
lda [my_fcr],y
sta dirent_entry
stz data.dirent.inode stz data.dirent.inode
stz data.dirent.name stz data.dirent.name
@ -227,7 +237,9 @@ init proc
ror size ror size
lda super.magic ldy #v1_super.magic
lda [my_vcr],y
cmp #v1L.MAGIC cmp #v1L.MAGIC
bne minix bne minix
; this is ; this is
@ -249,10 +261,10 @@ minix
base_displace proc base_displace proc
; offset is $04 for class 0, $06 for class 1
with fst_parms, dp with fst_parms, dp
with gde_dp with gde_dp
; offset is $04 for class 0, $06 for class 1
lda #$04 lda #$04
clc clc
adc <call_class adc <call_class
@ -286,12 +298,12 @@ absolute
; ;
cmp #0 cmp #0
beq @count beq @count
jmp get_indexed_entry jmp find_absolute_dirent
@count @count
jmp count_entries jmp count_entries
forward forward
jmp get_next_entry jmp find_dirent
; ;
backward backward
; backward 0 ? == forward 0 ; backward 0 ? == forward 0
@ -300,70 +312,14 @@ backward
eor #$ffff eor #$ffff
sec ; inc / clc sec ; inc / clc
ldy #fcr.dirent adc dirent_entry
adc [my_fcr],y
sta displacement sta displacement
jmp get_indexed_entry jmp find_absolute_dirent
endp endp
get_indexed_entry proc
; get the displacement entry.
lda displacement
beq eod
bmi eod
bra ok
eod
lda #end_of_dir
sec
rts
ok
; if displacement is >= current dirent, use next dirent code.
ldy #fcr.dirent
cmp [my_fcr],y
bcc hard
sec
sbc [my_fcr],y
sta displacement
jmp get_next_entry
hard
; go through all directory entries until we find the one we want.
ldx #0 ; zone.
zone_loop
lda disk_inode.zone,x
beq eod
phx ; save
jsr read_data_block
plx ; and restore
bcs exit
jsr dirent_find
; carry clear if found.
bcc done
lda dirent_count
beq eod
inx
cpx #v1.NR_DZONES
bcs eod
bra zone_loop
done
clc
exit
rts
eod
lda #end_of_dir
sec
rts
endp
count_entries proc count_entries proc
; count the number of entries. ; count the number of entries.
@ -376,22 +332,24 @@ count_entries proc
; disk inode has been copied to the dp. ; disk inode has been copied to the dp.
stz dirent_entry
ldx #0 ldx #0
zone_loop zone_loop
lda disk_inode,x lda disk_inode,x
beq done ; directory should not be sparse! beq next ; directory should not be sparse!
phx ; save phx ; save
txa
jsr read_data_block jsr read_data_block
plx ; and restore plx ; and restore
bcs exit bcs exit
jsr count_dirent_block jsr count_dirent_block
lda dirent_count lda size
beq done beq done
next
inx inx
inx inx
cpx #v1.NR_DZONES cpx #v1.NR_DZONES*2
bcs done bcs done
bra zone_loop bra zone_loop
; ;
@ -427,7 +385,7 @@ loop
inc dirent_entry inc dirent_entry
next next
; not 32-bit safe. ; not 32-bit safe.
dec disk_inode.size dec size
beq done beq done
tya tya
@ -500,9 +458,24 @@ found_it
iny iny
inx inx
inx inx
cpx #dirent_size cpx dirent_size
bcc @loop bcc @loop
; update the fcr.
lda dirent_entry
ldy #fcr.dirent_entry
sta [my_fcr],y
lda #dirent_offset
ldy #fcr.dirent_offset
sta [my_fcr],y
lda #dirent_zone
ldy #fcr.dirent_zone
sta [my_fcr],y
lda #0 lda #0
clc clc
clv clv
@ -510,51 +483,6 @@ found_it
endp endp
get_next_entry proc
; displacement is the number of records *forward*
; if displacement is 0 and dirent is 0, eod.
; if dirent is 0, don't need to advance.
ldy #fcr.dirent
lda [my_fcr],y
bne @ok
dec displacement
bpl @ok
lda #end_of_dir
sec
rts
@ok
; load the initial zone.
; current zone.
ldy #fcr.dirent_zone
lda [my_fcr],y
tax ; save
lda disk_inode.zone,x
phx
jsr read_data_block
plx
bcs exit
ldy #fcr.dirent_offset
lda [my_fcr],y
; current offset.
; while displacement, scan forward!
lda [io_buffer],y
success
clc
exit
rts
endp
strlen proc strlen proc
; strlen the dirent. ; strlen the dirent.