actually use world cache, and actually invalidate it properly

This commit is contained in:
4am 2020-10-01 10:51:22 -04:00
parent 725f2bc7a0
commit e2e42f5415
2 changed files with 12 additions and 13 deletions

View File

@ -48,29 +48,28 @@ bitcount = $FD
MaybeLoadWorldFromDisk
clc
adc #$41
cmp @fileLoaded
cmp WorldFileLoaded
bne +
clc
@success clc
rts
+ sta @filename+1
+ sta WorldFileLoaded
jsr LoadFile1Shot
!word @filename ; address of filename
!word WORLDDATA ; load address
!word $2F00 ; maximum length
!word WORLDFILEBUFFER ; address of ProDOS file buffer
bcs @exit
bcs @failure
jsr PreParseWorldData
cpx #100
bne +
clc
+HIDE_NEXT_BYTE
+ sec
@exit rts
@fileLoaded
!byte $FF ; no file
beq @success
@failure lda #$FF
sta WorldFileLoaded
sec
rts
@filename
!byte 1 ; length
!raw $FD ; SMC
WorldFileLoaded
!byte $FF ; no file
PreParseWorldData
; find the starting address of each of the 100 puzzles in this world

View File

@ -73,7 +73,7 @@ DemoOnEXIT
pla
pla
lda #$FF
sta gWorldID ; invalidate cache
sta WorldFileLoaded ; invalidate cache
rts
DemoOnLOAD