passport/src/patchers/fbffpascal.a
2021-06-21 11:57:02 -04:00

46 lines
1.6 KiB
Plaintext

;-------------------------------
; #FBFFPASCAL
; a variant of Activision's Timing Bit Detection
; linked as an Apple Pascal module
; (soft switches are hard-coded to slot 6)
;
; tested on
; Geometry: Simple Closed Curves (1985)
; Multiplication: Advanced Level (1985)
; Basic Fraction Concepts (1985)
; Widespread
; Power Up! The Typewriter
;-------------------------------
!zone {
; gIsPascal is TRUE here
ldy #$14
jsr SearchTrack
!byte $AD,$E9,$C0; LDA $C0E9
!byte $A9,WILDCARD; LDA ...
!byte $85,$03 ; STA $03
!byte $A9,$08 ; LDA #$08
!byte $C6,$02 ; DEC $02
!byte $D0,$04 ; BNE +
!byte $C6,$03 ; DEC $03
!byte $F0,WILDCARD; BEQ ... (this branch offset will be used later to build the patch)
!byte $AC,$EC,$C0; LDY $C0EC
bcs .exit ; passport-test-suite/The Typewriter.woz [C=0] matches
stx .a+1
adc #BASEPAGE ; carry is guaranteed to be clear here
sta .a+2
ldy #$10 ; get the branch offset from the WILDCARD above
.a lda $FDFD,y ; set at runtime
adc #$0A ; calculate new branch offset (note: carry still guaranteed to be clear here)
sta .branch ; store offset in patch bytes below
jsr PrintByID
!byte s_fbff
lda gDisplayBytes
jsr modify3
; unconditional jump to success path
!byte $18 ; CLC
!byte $90 ; BCC +
.branch !byte $FD ; set at runtime
.exit
}