From 39758aaba97ec00e297c5e57e58ed33fbf718342 Mon Sep 17 00:00:00 2001 From: 4am Date: Mon, 26 Jun 2023 20:39:38 -0400 Subject: [PATCH] add unexpected 5&3 track detection [fixes Real Math] --- README.md | 2 ++ src/strings/en.a | 6 ++++- src/strings/enid.a | 1 + src/wholetrack.a | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82375ed..3b814b3 100644 --- a/README.md +++ b/README.md @@ -473,6 +473,8 @@ development branch - NEW: patchers/t00_scottforesman_ dos33.a (fixes Addition and Subtraction 3, Decimals 2) +- NEW: unexpected 5&3 track detection + (fixes Real Math, Mathosaurus) - IMPROVED: patchers/d5d5f7.a (fixes Les Sports) - IMPROVED: patchers/gamco.a (fixes diff --git a/src/strings/en.a b/src/strings/en.a index ced12d5..eb45717 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -220,6 +220,7 @@ StringTableLow ; must be kept in sync with constants in enid.a !byte <.probs5 !byte <.didatech !byte <.anychecksum + !byte <.unexpected5and3 StringTableHigh ; must be kept in sync with constants in enid.a !byte >.header @@ -379,11 +380,12 @@ StringTableHigh ; must be kept in sync with constants in enid.a !byte >.probs5 !byte >.didatech !byte >.anychecksum + !byte >.unexpected5and3 .passport !text "Passport ",$00 .header - !text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2023-05-28",$00 + !text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2023-06-26",$00 .bar9 !text "_________",$00 .bar18 @@ -786,3 +788,5 @@ StringTableHigh ; must be kept in sync with constants in enid.a .anychecksum !text "@",s_rwts,"@",s_acceptsany,$8D !text "address field checksum",$8D,$00 +.unexpected5and3 + !text "@",s_tfound,"5-and-3 @",s_protectiontrack,$8D,$00 diff --git a/src/strings/enid.a b/src/strings/enid.a index 52e2857..805a360 100644 --- a/src/strings/enid.a +++ b/src/strings/enid.a @@ -158,3 +158,4 @@ s_neosoft = $99 s_probs5 = $9A s_didatech = $9B s_anychecksum = $9C +s_unexpected5and3 = $9D diff --git a/src/wholetrack.a b/src/wholetrack.a index 3f7fa69..926bda2 100755 --- a/src/wholetrack.a +++ b/src/wholetrack.a @@ -39,6 +39,13 @@ SkipTrack lda #s_sync bcc @print ; +; Unexepcted 13-sector track on a 16-sector disk? +; (Micrograms likes to do this) +; + jsr Unexpected5And3InBaggingArea + lda #s_unexpected5and3 + bcc @print +; ; RW18-format track? ; jsr VerifyInfocom18 @@ -312,3 +319,52 @@ Read4x4 } and tmp rts + +;------------------------------- +; Unexpected5And3InBaggingArea +; check if track is unexpectedly full of +; 5-and-3-encoded sectors on a disk where +; we expected 6-and-2 encoded sectors +; +; used by e.g. Micrograms as a weak form +; of copy protection to foil COPYA-style +; copying +; +; in slot 6, drive 1 is on track to test +; out C clear if unexpected track found +; C set if not found +;------------------------------- +Unexpected5And3InBaggingArea + lda gIs13Sector + beq @no ; if ID'd as a 13 sector disk, then this is not unexpected + lda $C0E9 + lda #$19 + sta nibcount + ldx #$0C + ldy #$00 +@restart + dey + bne + + dec nibcount + beq @no ++ +- lda $C0EC + bpl - +@maybeD5 + cmp #$D5 + bne @restart +- lda $C0EC + bpl - + cmp #$AA + bne @maybeD5 +- lda $C0EC + bpl - + cmp #$B5 + bne @maybeD5 + dex + bne @restart + clc ; passport-test-suite/Real Math.woz [C=0] matches + !byte $A9 +@no sec + lda $C0E8 + rts