From 691e6f8777529f4e40c92d3764e70a8182840501 Mon Sep 17 00:00:00 2001 From: 4am Date: Thu, 29 Apr 2021 21:55:45 -0400 Subject: [PATCH] support Micrograms bad block check [fixes Granny Applebee's Cookie Factory, Uncle Clyde's Consonant Slide, and several others] --- README.md | 6 ++++- src/apicode.a | 5 ++++ src/apidefs.a | 3 ++- src/id/volumename.a | 15 ++++++++++++ src/passport.a | 1 + src/patchers/errord51.a | 53 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 src/patchers/errord51.a diff --git a/README.md b/README.md index 3ebc272..ce94e84 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,8 @@ were common in educational software. e.g. Fantasy Land, Behind The Wheel - Micrograms - e.g. Wild West Math + e.g. Wild West Math, Granny + Applebee's Cookie Factory - Millennium Group e.g. The Brain Game, Concentration @@ -427,6 +428,9 @@ Development (unreleased) - NEW: patchers/mastery.a (Mastery Arithmetic Games) - NEW: patchers/leisure.a (Clue, RISK) +- NEW: patchers/errord51.a (Granny + Applebee's Cookie Factory, Uncle + Clyde's Consonant Slides) - IMPROVED: patches/mecc.a to erase site license information from final generation of MECC disks (by qkumba) diff --git a/src/apicode.a b/src/apicode.a index dfc7991..8ff1176 100644 --- a/src/apicode.a +++ b/src/apicode.a @@ -73,6 +73,11 @@ ; set in IDBootFailure() after reading T00 FIRSTFILTER +;gIsLowDOS + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDVolumeName() after identifying ProDOS bootloader + ;gPossibleB4BBBasic !byte FALSE ; 0=true, 1=false ; reset before each operation diff --git a/src/apidefs.a b/src/apidefs.a index b16858c..9663a5e 100644 --- a/src/apidefs.a +++ b/src/apidefs.a @@ -138,9 +138,10 @@ gIsTSR = gIsDiversi-$01 ; byte gPossibleMECCSwapper = gIsTSR-$01 ; byte gPossibleWoodbury = gPossibleMECCSwapper-$01 ; byte gPossibleB4BBBasic = gPossibleWoodbury-$01 ; byte +gIsLowDOS = gPossibleB4BBBasic-$01 ; byte ;LASTFILTER ; add new gIs* above this line ;gIsInfocom18 is a special case whose ID is not in the regular inspection path -gIsInfocom18 = gPossibleB4BBBasic-$01 ; byte +gIsInfocom18 = gIsLowDOS-$01 ; byte ;gIs13Sector is a special case whose ID is not in the regular inspection path gIs13Sector = gIsInfocom18-$01 ; byte ;gMECCFastloadType is a special case integer whose default value cannot be #FALSE diff --git a/src/id/volumename.a b/src/id/volumename.a index f19659c..042cd10 100644 --- a/src/id/volumename.a +++ b/src/id/volumename.a @@ -72,6 +72,21 @@ IDVolumeName bne - lda #$8D jsr PrintA + +; while we're here, we check for a specific file that is +; always (!) in a specific place in the root directory +; (this will unlock a patcher with an expensive search) + lda #$0B + ldx #$7A + ldy #$06 + jsr compare + !byte $4C,$4F,$57,$44,$4F,$53 + bcs + + lda #TRUE + sta gIsLowDOS + lda #kSectorOptional + sta T00S0C ++ clc !byte $24 ; hide next SEC .error diff --git a/src/passport.a b/src/passport.a index 45a7577..76b8ccd 100755 --- a/src/passport.a +++ b/src/passport.a @@ -389,6 +389,7 @@ AnalyzeTrack !source "patchers/woodbury.a" ; gPossibleWoodbury only !source "patchers/leisure.a" ; gIsProDOS && T22 only !source "patchers/b4bbbasic.a" ; gPossibleB4BBBasic only + !source "patchers/errord51.a" ; gIsLowDOS only _checkPatchCount lda gPatchCount diff --git a/src/patchers/errord51.a b/src/patchers/errord51.a new file mode 100644 index 0000000..56e0cb0 --- /dev/null +++ b/src/patchers/errord51.a @@ -0,0 +1,53 @@ +;------------------------------- +; #ERRORD51 +; sneaky bad block check sets an error callback +; then expects the RWTS call not to return +; (prints ']ERROR D51' on failure) +; +; tested on +; - Granny Applebee's Cookie Factory +; - Hugo Hound's Vowel Sounds (series) +; - Marty's Family Reader (series) +; - Marty's Reading Workout (series) +; - Uncle Clyde's Consonant Slides (series) +;------------------------------- +ERRORD51 + lda gIsLowDOS + bne @exit + + ldy #$10 + jsr SearchTrack + !byte $A9,WILDCARD + !byte $8D,$07,WILDCARD + !byte $A9,WILDCARD + !byte $8D,$08,WILDCARD + !byte $A9,$01 + !byte $8D,WILDCARD,WILDCARD + !byte $20 + bcs @exit + sta gDisplayBytes + pha + clc + adc #BASEPAGE + sta @highBytePtr+2 + txa + pha + jsr inx6 + stx @highBytePtr+1 + lda #s_badblock + jsr PrintByID + pla + tax + pla + ldy #$01 + jsr modify + !byte $4C ; JMP opcode +@highBytePtr + ldy $FDFD ; SMC + sty + + inx + inx + ldy #$01 + jsr modify ++ !byte $FD ; SMC (high byte of JMP address) +@exit