From cdd806d49510642f43c5b091ae856e94aca32181 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Mon, 18 Jun 2018 19:27:53 -0700 Subject: [PATCH] detect Z4 and Z5 saves --- src/parse.gameinfo.a | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/parse.gameinfo.a b/src/parse.gameinfo.a index 325ea6a..63cf60a 100644 --- a/src/parse.gameinfo.a +++ b/src/parse.gameinfo.a @@ -219,19 +219,12 @@ CheckForSavedGames jsr GetFileInfo !word gPathname bcs @no ; no file -> no saved games - lda blocks+1 - bne @yes ; file exists and is quite large -> assume saved games - lda blocks - cmp #$06 ; file exists but is small -> no saved games (.Z4/.Z5 files have a 5 block 'empty' .sav file) - bcc @no -@yes lda auxtype ; if low byte of auxtype is $3x, x is the last save slot + lda auxtype ; if low byte of auxtype is $3x, then saved and x is the last save slot and #$F0 cmp #$30 - bne + - lda auxtype + bne @no +@yes lda auxtype and #$0F - +HIDE_NEXT_2_BYTES -+ lda #$FF ; no save slot sta gLastSavedGameSlot lda #1 +HIDE_NEXT_2_BYTES