From 7975003b15a0027bbb6bee606e3cc4a7dac78e10 Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 12 Sep 2021 15:46:08 -0400 Subject: [PATCH] add support for various PFS protections --- README.md | 4 ++++ src/passport.a | 2 ++ src/patchers/pfs.pascal.a | 26 ++++++++++++++++++++++++++ src/patchers/pfs.prodos.a | 28 ++++++++++++++++++++++++++++ src/strings/en.a | 2 +- 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 src/patchers/pfs.pascal.a create mode 100644 src/patchers/pfs.prodos.a diff --git a/README.md b/README.md index 6f6ca89..4d26248 100644 --- a/README.md +++ b/README.md @@ -409,6 +409,10 @@ IN THE SOFTWARE. ## History In-development (unreleased) +- NEW: patchers/pfs.pascal.a (fixes + pfs:* Pascal titles) +- NEW: patchers/pfs.prodos.a (fixes + pfs:* ProDOS titles) - IMPROVED: patchers/ea.a (fixes Boulder Dash II) (by qkumba) diff --git a/src/passport.a b/src/passport.a index dfe792a..8304fbe 100755 --- a/src/passport.a +++ b/src/passport.a @@ -397,6 +397,7 @@ _endDiversiPatchers + !source "patchers/bbf9.a" ; gIsProDOS only !source "patchers/fbffencrypted.a" ; gIsProDOS only + !source "patchers/pfs.prodos.a" ; gIsProDOS && T05 only !source "patchers/leisure.a" ; gIsProDOS && T22 only !source "patchers/memory.config.a" ; gIsProDOS only !source "patchers/origin.a" ; gIsProDOS only @@ -415,6 +416,7 @@ _endProDOSPatchers !source "patchers/a5count.a" ; gIsPascal only !source "patchers/a6bc95.a" ; gIsPascal only !source "patchers/fbffpascal.a" ; gIsPascal only + !source "patchers/pfs.pascal.a" ; gIsPascal only _endPascalPatchers ; /!\ execution falls through here because why not diff --git a/src/patchers/pfs.pascal.a b/src/patchers/pfs.pascal.a new file mode 100644 index 0000000..331032c --- /dev/null +++ b/src/patchers/pfs.pascal.a @@ -0,0 +1,26 @@ +;------------------------------- +; #PFSPASCAL +; a variant of Activision's Timing Bit Detection +; linked as an Apple Pascal module +; (soft switches are hard-coded to slot 6) +; +; tested on +; - pfs: file (Pascal version) +; - pfs: graph (Pascal version) +; - pfs: report (Pascal version) +;------------------------------- + ; gIsPascal is TRUE here + + ldy #$09 + jsr SearchTrack + !byte $F0,$27 ; BEQ + + !byte $AD,$EC,$C0; LDA $C0EC + !byte $10,$FB ; BPL - + !byte $C9,$93 ; CMP #$93 + bcs + ; passport-test-suite/PFS Graph.woz [C=0] matches + jsr PrintByID + !byte s_fbff + inx + jsr modify1 + !byte $25 ; unconditional jump to success path ++ diff --git a/src/patchers/pfs.prodos.a b/src/patchers/pfs.prodos.a new file mode 100644 index 0000000..d385728 --- /dev/null +++ b/src/patchers/pfs.prodos.a @@ -0,0 +1,28 @@ +;------------------------------- +; #PFSPRODOS +; a variant of Activision's Timing Bit Detection +; used by PFS ProDOS titles +; (soft switches are munged and corrected at runtime) +; +; tested on +; - pfs: file (ProDOS version) +; - pfs: report (ProDOS version) +; - pfs: write (ProDOS version) +;------------------------------- + ; gIsProDOS is TRUE here + + ldy gTrack + cpy #$05 + bne + + lda #$00 + ldx #$5E + jsr compare ; if T05,S00,$5E == + !byte $FF + !byte $CD,$88,$C0 + !byte $60 + bcs + ; passport-test-suite/PFS Write.woz [C=0] matches + jsr PrintByID + !byte s_fbff + jsr modify1 + !byte $00 ++ diff --git a/src/strings/en.a b/src/strings/en.a index 072e27d..b80c706 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -365,7 +365,7 @@ StringTableHigh ; must be kept in sync with constants in enid.a .passport !text "Passport ",$00 .header - !text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-09-08",$00 + !text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-09-12",$00 .bar9 !text "_________",$00 .bar18