passport/src/patchers/pfs.pascal.a

83 lines
2.4 KiB
Plaintext

;-------------------------------
; #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
@variation1
ldy #$09
jsr SearchTrack
!byte $F0,$27 ; BEQ +
!byte $AD,$EC,$C0; LDA $C0EC
!byte $10,$FB ; BPL -
!byte $C9,$93 ; CMP #$93
bcs @variation2; passport-test-suite/PFS Graph.woz [C=0] matches
jsr PrintByID
!byte s_pfs
inx
jsr modify1
!byte $25 ; unconditional jump to success path
bvc @variation1; always branches (may find additional protection checks on same track)
@variation2
ldy #$09
jsr SearchTrack
!byte $F0,$31 ; BEQ +
!byte $AD,$EC,$C0; LDA $C0EC
!byte $10,$FB ; BPL -
!byte $C9,$AD ; CMP #$AD
bcs @writeCheck; passport-test-suite/PFS Write 1984-11-01.woz [C=0] matches
jsr PrintByID
!byte s_pfs
inx
jsr modify1
!byte $2F ; unconditional jump to success path
bvc @variation2; always branches (may find additional protection checks on same track)
@writeCheck
ldy #$09
jsr SearchTrack
!byte $9E,$06
!byte $9E,$22
!byte $00
!byte $C3,$A1
!byte $02,$B9
bcc @foundWriteCheck
ldy #$09
jsr SearchTrack
!byte $9E,$06
!byte $9E,$22
!byte $00
!byte $C3,$A1
!byte $2E,$C7
bcc @foundWriteCheck
ldy #$09
jsr SearchTrack
!byte $9E,$06
!byte $9E,$22
!byte $00
!byte $C3,$AB
!byte $05,$A9
bcs @exit ; passport-test-suite/PFS Graph 1983-01-12.woz [C=0] here
@foundWriteCheck
jsr PrintByID
!byte s_corrupter
inx
jsr modify1
!byte $05 ; UREAD command instead of UWRITE
jsr inx4
jsr modify1
!byte $CB ; NEQI instead of EQUI because we expect the UREAD to succeed
bvc @writeCheck; always branches (may find additional write checks on same track)
@exit