add support for self-decrypting nibble check at B400

This commit is contained in:
4am 2017-07-15 11:24:56 -04:00
parent b7c168ecaa
commit 5e060a2dc4
3 changed files with 60 additions and 2 deletions

View File

@ -715,6 +715,7 @@ _applyToAll
!source "patchers/optimum.a" ; gIsOptimum only
!source "patchers/bootcounter.a" ; T01 only
!source "patchers/jmpb412.a" ; T02 only
!source "patchers/jmpb400.a" ; T02 && gIsBoot0 only
lda gPatchCount
beq .nopatches

57
src/patchers/jmpb400.a Normal file
View File

@ -0,0 +1,57 @@
;-------------------------------
; #JMPB400
; Boot1 jumps to $B400 for a
; self-decripting nibble check
; that seeks to track $23
; and exits via $9D84 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)
;-------------------------------
!zone {
lda gIsBoot0
bne .exit
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 #$16
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,$C8,$D1
; LDA $C08E,X
; LDA $C08C,X
; BPL $00D8
; CMP #$D5
; BNE $00D4
; CPY #$5D
; BNE $00B3
; LDA $C088,X
; JMP $9D84
bcs .exit
sta gDisplayBytes
lda #s_jmpb400
jsr PrintByID
lda #$03
ldx #$00
ldy #$03
jsr modify ; then set T02,S03,$00 =
!byte $4C,$84,$9D
.exit
}

View File

@ -220,7 +220,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2017-07-07",00
!text "Passport by 4am 2017-07-15",00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "
@ -382,7 +382,7 @@ StringTable
!text "T00,S0C Disk calls a protection check at"
!text "$B4BB before initializing DOS.",$8D,00
.jmpb400
!text "T00,S01 Disk calls a protection check at"
!text "T%t,S%0 Disk calls a protection check at"
!text "$B400 before initializing DOS.",$8D,00
.jmpbeca
!text "T00,S02 RWTS requires extra nibbles and",$8D