From fd0dd20afe13d0929430b6bc018ec8907158ed5f Mon Sep 17 00:00:00 2001 From: 4am Date: Mon, 3 Jul 2017 10:50:55 -0400 Subject: [PATCH] add log message for D5-plus-timing-bit patch; expand support for detection of possible Gamco protection --- src/analyze.a | 21 +++++++++++++++++---- src/id/inspect0.a | 2 +- src/passport.a | 8 ++++---- src/patchers/bademu.a | 3 +++ src/patchers/gamco.a | 8 +++++--- src/strings/en.a | 9 +++++++-- 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/analyze.a b/src/analyze.a index 4f7b05a..7b50803 100755 --- a/src/analyze.a +++ b/src/analyze.a @@ -24,7 +24,7 @@ SkipTrack .checkunformat jsr IsUnformatted bcs .checkf7 - lda #s_unformat ++ lda #s_unformat bcc .skiptrack ; always taken ; ; 3) $F7 protection track (F7F6EFEAAB nibble sequence) @@ -53,7 +53,22 @@ SkipTrack ; note: execution falls through here .skiptrack jsr PrintByID - clc +; +; Skipping T22 on a ProDOS disk might indicate the presence of a +; Gamco Industries protection elsewhere on the disk. Different +; Gamco disks present as different types of weirdness on T22 -- +; EEEF, sync, or even unformatted. (The actual protection is just +; a bad block check, so putting the code here will catch all +; possible cases.) +; + lda gTrack + cmp #$22 + bne + + lda gIsProDOS + bne + + lda #TRUE + sta gPossibleGamco ++ clc !byte $24 ; hides next SEC .fail sec @@ -159,8 +174,6 @@ IsEEEF bpl - cmp #$AE bne .restart - lda #TRUE - sta gIsEEEF clc !byte $24 ; hides SEC .fail sec diff --git a/src/id/inspect0.a b/src/id/inspect0.a index efcb74a..bbb99de 100755 --- a/src/id/inspect0.a +++ b/src/id/inspect0.a @@ -21,8 +21,8 @@ IDBootloader sta gIsProtDOS sta gIsDavidDOS sta gIsEA - sta gIsEEEF sta gIsMECCFastloader + sta gPossibleGamco sta gPossibleD5D5F7 lda #$00 sta gLastTrack diff --git a/src/passport.a b/src/passport.a index 1075fbc..fdc8253 100755 --- a/src/passport.a +++ b/src/passport.a @@ -95,7 +95,7 @@ flag = $FF ; byte } ; Application constants (not zero addresses) -RELBASE = $5D00 ; address to move Passport code +RELBASE = $5C00 ; address to move Passport code ; so that it's out of the way LOWPOINT = $4300 ; lowest available address for code BASEPAGE = $10 ; Special Delivery tracer assumes @@ -737,7 +737,7 @@ _applyToAll !source "patchers/sierra.a" ; gIsBoot0 only !source "patchers/corrupter.a" ; T13 only !source "patchers/ea.a" ; (gIsEA || gIsBoot0) only - !source "patchers/gamco.a" ; gIsEEEF only + !source "patchers/gamco.a" ; gPossibleGamco only !source "patchers/optimum.a" ; gIsOptimum only !source "patchers/bootcounter.a" ; T01 only !source "patchers/jmpb412.a" ; T02 only @@ -821,10 +821,10 @@ gIsEA !byte FALSE ; 0=true, 1=false ; reset before each operation ; set in IDBootloader() after reading T00,S00 -gIsEEEF +gPossibleGamco !byte FALSE ; 0=true, 1=false ; reset before each operation - ; set in IsEEEF() after reading T22 + ; set in SkipTrack() after reading T22 gIsOptimum !byte FALSE ; 0=true, 1=false ; reset before each operation diff --git a/src/patchers/bademu.a b/src/patchers/bademu.a index c00b5cb..f13e572 100755 --- a/src/patchers/bademu.a +++ b/src/patchers/bademu.a @@ -12,6 +12,7 @@ lda gIsRWTS ; if DOS 3.3 RWTS bne .exit lda #$03 + sta gDisplayBytes ldx #$4F ldy #$11 jsr compare ; and T00,S03,$4F == @@ -24,6 +25,8 @@ !byte $C9,$D5 ; CMP #$D5 !byte $F0,$12 ; BEQ +$12 bcs .exit + lda #s_d5timing + jsr PrintByID lda #$03 ldx #$58 ldy #$02 diff --git a/src/patchers/gamco.a b/src/patchers/gamco.a index 4be61c2..9cb8ddd 100644 --- a/src/patchers/gamco.a +++ b/src/patchers/gamco.a @@ -5,9 +5,11 @@ ; e.g. Essential Grammar, Math Football ;------------------------------- !zone { -; [speed optimization: only ever seen this protection on disks with a specific -; nibble sequence on track $22] - lda gIsEEEF +; [speed optimization: only ever seen this protection on disks with +; a specific nibble sequence on track $22, or an unformatted T22 -- +; if this global variable is set in SkipTrack() after failing to read T22S0F, +; then we scan every other track for the Gamco protection code] + lda gPossibleGamco bne .exit ldy #$12 jsr SearchTrack diff --git a/src/strings/en.a b/src/strings/en.a index 55a8aab..96edab3 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -102,7 +102,8 @@ s_bbf9 = $53 s_micrograms = $54 s_cmpbne0 = $55 s_writeram = $56 -STRINGCOUNT = $57 +s_d5timing = $57 +STRINGCOUNT = $58 !zone { StringTable @@ -193,6 +194,7 @@ StringTable !word .micrograms !word .cmpbne0 !word .writeram + !word .d5timing ; ; Text can contain substitution strings, which ; are replaced by current values at runtime. Each @@ -218,7 +220,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-07-02",00 + !text "Passport by 4am 2017-07-03",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " " @@ -483,4 +485,7 @@ StringTable !text "first address epilogue nibble.",$8D,00 .writeram !text "Writing to RAM disk",$8D,00 +.d5timing + !text "T%t,S%0 RWTS accepts $D5 plus a timing",$8D + !text "bit as the entire address prologue.",$8D,$00 }