From efaa449ea0abfc4bef8ca63d49f796a0e65280cd Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 7 Feb 2017 10:53:52 -0500 Subject: [PATCH] add patchers/gamco for Gamco disks that POKE a bad block check into memory and call it --- src/analyze.a | 2 ++ src/passport.a | 3 ++- src/patchers/gamco.a | 31 +++++++++++++++++++++++++++++++ src/strings/en.a | 15 ++++++++++----- 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 src/patchers/gamco.a diff --git a/src/analyze.a b/src/analyze.a index e9ebb29..4f7b05a 100755 --- a/src/analyze.a +++ b/src/analyze.a @@ -159,6 +159,8 @@ IsEEEF bpl - cmp #$AE bne .restart + lda #TRUE + sta gIsEEEF clc !byte $24 ; hides SEC .fail sec diff --git a/src/passport.a b/src/passport.a index 1d31afa..6695d46 100755 --- a/src/passport.a +++ b/src/passport.a @@ -94,7 +94,7 @@ flag = $FF ; byte } ; Application constants (not zero addresses) -RELBASE = $6A00 ; address to move Passport code +RELBASE = $6900 ; address to move Passport code ; so that it's out of the way BASEPAGE = $10 ; Special Delivery tracer assumes ; this is $10, so don't change it! @@ -693,6 +693,7 @@ _applyToAll !source "patchers/sierra.a" !source "patchers/corrupter.a" !source "patchers/ea.a" + !source "patchers/gamco.a" lda gPatchCount beq .nopatches diff --git a/src/patchers/gamco.a b/src/patchers/gamco.a new file mode 100644 index 0000000..ab269cb --- /dev/null +++ b/src/patchers/gamco.a @@ -0,0 +1,31 @@ +;------------------------------- +; #GAMCO +; bad block check POKEd into memory +; from compiled BASIC +; e.g. Essential Grammar, Math Football +;------------------------------- +!zone { +_gamco + +; [speed optimization: only ever seen this protection on disks with a specific +; nibble sequence on track $22] + lda gIsEEEF + bne .exit + ldy #$12 + jsr SearchTrack + !byte $33,$32,$01,$30,$03,$31,$39,$31 + !byte $03,$31,$32,$38,$02,$31,$31,$02 + !byte $39,$36 + bcs .exit + sta gDisplayBytes + pha + lda #s_poke + jsr PrintByID + pla + ldy #$12 + jsr modify + !byte $34,$34,$01,$30,$02,$31,$30,$03 + !byte $32,$33,$34,$03,$31,$36,$39,$02 + !byte $33,$39 +.exit +} diff --git a/src/strings/en.a b/src/strings/en.a index cc34785..08a5461 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -88,7 +88,8 @@ s_corrupter= $45 s_eab0 = $46 s_eatrk6 = $47 s_eeef = $48 -STRINGCOUNT = $49 +s_poke = $49 +STRINGCOUNT = $4A !zone { StringTable @@ -165,6 +166,7 @@ StringTable !word .eaboot0 !word .eatrk6 !word .eeef + !word .poke ; ; Text can contain substitution strings, which ; are replaced by current values at runtime. Each @@ -190,7 +192,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-02-06",00 + !text "Passport by 4am 2017-02-07",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " " @@ -413,13 +415,16 @@ StringTable !text "T%t,S%0 Found A5 nibble count",$8D,$00 .restart !text "Restarting scan",$8D,$00 -.corrupter - !text "T%t,S%0 Protection check intentionally",$8D - !text "destroys unauthorized copies",$8D,$00 +.corrupter + !text "T%t,S%0 Protection check intentionally",$8D + !text "destroys unauthorized copies",$8D,$00 .eaboot0 !text "T00 Found Electronic Arts bootloader",$8D,00 .eatrk6 !text "T06 Found EA protection track",$8D,00 .eeef !text "T%t Found $EEEFBBBA protection",$8D,00 +.poke + !text "T%t,S%0 BASIC program POKEs protection",$8D + !text "check into memory and CALLs it.",$8D,$00 }