add support for various PFS protections

This commit is contained in:
4am 2021-09-12 15:46:08 -04:00
parent 63cb05140b
commit 7975003b15
5 changed files with 61 additions and 1 deletions

View File

@ -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)

View File

@ -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

26
src/patchers/pfs.pascal.a Normal file
View File

@ -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
+

28
src/patchers/pfs.prodos.a Normal file
View File

@ -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
+

View File

@ -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