fixup ctree matching, combine copy loop w/ uppercase loop.

This commit is contained in:
Kelvin Sherlock 2021-07-18 10:59:23 -04:00
parent a9a44bb4c8
commit 97997a48dc

View File

@ -672,39 +672,33 @@ name_check
sta cat_str_len sta cat_str_len
beq cmp beq cmp
@loop ; copy and upper case the string.
copy
lda buffer+HFSCatalogKey.nodeName+1,y lda buffer+HFSCatalogKey.nodeName+1,y
cmp #'a'
blt @store
cmp #'z'+1
bge @store
and #$ff xor $20
@store
sta cat_str,x sta cat_str,x
iny iny
inx inx
cpx cat_str_len cpx cat_str_len
blt @loop blt copy
upper
; now uppercase it
ldy #0
ldx cat_str_len
@loop lda cat_str,y
cmp #'z'+1
bge @next
cmp #'a'
blt @next
and #$ff xor $20
sta cat_str,y
@next iny
dex
bne @loop
cmp cmp
lda target_str_len
ora cat_str_len
beq match ; folder thread - no name.
ldx target_str_len ldx target_str_len
cpx cat_str_len cpx cat_str_len
bge @ok bge @x
ldx cat_str_len ldx cat_str_len
@ok @x
dex
ldy #0 ldy #0
@loop @loop
lda target_str,y lda target_str,y
@ -715,7 +709,8 @@ cmp
@next @next
iny iny
bpl @loop dex
bne @loop
long m long m
lda #0 lda #0
@ -741,13 +736,19 @@ match ; a match!
with dp with dp
lda buffer+HFSCatalogKey.keyLength,y lda buffer+HFSCatalogKey.keyLength,y
and #$ff ; and #$ff
inc a ; doesn't include itself inc a ; length doesn't include itself
inc a ; pad to a word boundary.
and #$fe
sta r0
lda buffer,x ; x still valid
xba
clc clc
adc buffer,x ; x still valid adc r0
tay tay
lda buffer+HFSCatalogFile.recordType lda buffer+HFSCatalogFile.recordType,y
xba xba
cmp #kHFSFolderRecord cmp #kHFSFolderRecord
beq folder beq folder