FIX: search cache incorrectly returned if a shorter input buffer matched

This commit is contained in:
4am 2021-11-09 17:19:25 -05:00
parent 89d2f3cdc4
commit 7afebf6b04
9 changed files with 16 additions and 22 deletions

View File

@ -70,20 +70,14 @@ def main():
if not index4: continue if not index4: continue
if index4 != index3: if index4 != index3:
cache[a][b][c][d] = index4 cache[a][b][c][d] = index4
if (len(cache[a][b][c]) == 1) and (" " in cache[a][b][c]): if not cache[a][b][c]:
cache[a][b][c] = cache[a][b][c][" "]
elif not cache[a][b][c]:
del cache[a][b][c] del cache[a][b][c]
if (len(cache[a][b]) == 1) and (" " in cache[a][b]): if not cache[a][b]:
cache[a][b] = cache[a][b][" "]
elif not cache[a][b]:
del cache[a][b] del cache[a][b]
if (len(cache[a]) == 1) and (" " in cache[a]): if not cache[a]:
cache[a] = cache[a][" "]
elif not cache[a]:
del cache[a] del cache[a]
print('*=$B000') print('*=$A000')
for a in cache: for a in cache:
print(f' !text "{a}"') print(f' !text "{a}"')
if type(cache[a]) == int: if type(cache[a]) == int:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -20,14 +20,14 @@ HGR4.IDX=Type(06),AuxType(4000),Access(C3)
HGR5.IDX=Type(06),AuxType(4000),Access(C3) HGR5.IDX=Type(06),AuxType(4000),Access(C3)
HGR6.IDX=Type(06),AuxType(4000),Access(C3) HGR6.IDX=Type(06),AuxType(4000),Access(C3)
DHGR.IDX=Type(06),AuxType(4000),Access(C3) DHGR.IDX=Type(06),AuxType(4000),Access(C3)
SEARCH00.IDX=Type(06),AuxType(8200),Access(C3) SEARCH00.IDX=Type(06),AuxType(6000),Access(C3)
SEARCH01.IDX=Type(06),AuxType(8200),Access(C3) SEARCH01.IDX=Type(06),AuxType(6000),Access(C3)
SEARCH10.IDX=Type(06),AuxType(8200),Access(C3) SEARCH10.IDX=Type(06),AuxType(6000),Access(C3)
SEARCH11.IDX=Type(06),AuxType(B000),Access(C3) SEARCH11.IDX=Type(06),AuxType(6000),Access(C3)
CACHE00.IDX=Type(06),AuxType(B000),Access(C3) CACHE00.IDX=Type(06),AuxType(A000),Access(C3)
CACHE01.IDX=Type(06),AuxType(B000),Access(C3) CACHE01.IDX=Type(06),AuxType(A000),Access(C3)
CACHE10.IDX=Type(06),AuxType(B000),Access(C3) CACHE10.IDX=Type(06),AuxType(A000),Access(C3)
CACHE11.IDX=Type(06),AuxType(B000),Access(C3) CACHE11.IDX=Type(06),AuxType(A000),Access(C3)
COVER=Type(06),AuxType(2000),Access(C3) COVER=Type(06),AuxType(2000),Access(C3)
TITLE=Type(06),AuxType(2000),Access(C3) TITLE=Type(06),AuxType(2000),Access(C3)
HELP=Type(06),AuxType(2000),Access(C3) HELP=Type(06),AuxType(2000),Access(C3)

View File

@ -123,7 +123,7 @@ ResetVector ; 6 bytes, copied to $100
!source "src/hw.vbl.a" !source "src/hw.vbl.a"
!source "src/ui.wait.a" !source "src/ui.wait.a"
gSearchStore gSearchStore
!word $8200 !word $6000
gSlideshowStore gSlideshowStore
!word $0800 !word $0800
gGlobalPrefsStore gGlobalPrefsStore

View File

@ -116,8 +116,8 @@ UI_ToPlay = $1FF7
gValLen = $1F80 gValLen = $1F80
gVal = $1F81 gVal = $1F81
gSearchIndex = $8200 gSearchIndex = $6000
gSearchCache = $B000 gSearchCache = $A000
; LC RAM 1 ; LC RAM 1
iLoadFileDirect = $FFEF iLoadFileDirect = $FFEF

View File

@ -15,7 +15,7 @@
; - kCheat ; - kCheat
; ;
kGlobalPrefsBuffer = $8000 kGlobalPrefsBuffer = $BD00
; valid pref keys ; valid pref keys
kNextAttract kNextAttract