passport/src/patchers/jmpb400.a

74 lines
2.2 KiB
Plaintext

;-------------------------------
; #JMPB400
; Boot1 jumps to $B400 for a
; self-decrypting nibble check
; that seeks to track $23
; and exits via $9D84 or $9B00 if successful
;
; tested on
; Binomal Multiplication (1984, Mindscape)
; Decimal Discovery (1986, DLM)
; Factoring Algebraic Expressions (1984, Mindscape)
; First Degree Linear Equations (1984, Mindscape)
; PathWords (1984, Thunder Mountain)
; Success With Math - Multiplying and Dividing Fractions (1984, Mindscape)
; Rebus Writer (1987, Mindscape)
;-------------------------------
!zone {
; gIsBoot0 is TRUE here
lda gTrack
cmp #$02
bne .exit
lda #$03
ldx #$00
ldy #$0A
jsr compare ; if T02,S03,$00 ==
!byte $A0,$00 ; LDY #$00
!byte $B9,$12,$B4; LDA $B412,Y
!byte $49,$4C ; EOR #$4C
!byte $99,$12,$B4; STA $B412,Y
bcs .exit
ldx #$D5
ldy #$14
jsr compare ; and T02,S03,$D5 ==
!byte $F1,$C2,$8C,$F1,$C0,$8C,$5C,$B7 ; encrypted code --
!byte $85,$99,$9C,$BF,$8C,$11,$9C,$82 ; decrypted listing follows
!byte $F1,$C4,$8C,$00
; LDA $C08E,X
; LDA $C08C,X
; BPL $00D8
; CMP #$D5
; BNE $00D4
; CPY #$5D
; BNE $00B3
; LDA $C088,X
; JMP
bcs .exit ; passport-test-suite/Binomial Multiplication.woz [C=0] matches
; passport-test-suite/Rebus Writer.woz [C=0] matches
ldx #$B4
stx gDisplayBytes+1 ; address (hi)
ldx #$00
stx gDisplayBytes+2 ; address (lo)
jsr PrintByID
!byte s_beforedos
pha
lda $13E9
eor #$4C
sta @jmplo
lda $13EA
eor #$4C
sta @jmphi
pla
jsr modify3 ; then set T02,S03,$00 =
!byte $4C
@jmplo !byte $84 ; SMC
@jmphi !byte $9D ; SMC
.exit
}