From 5e060a2dc4e85f8bfb8996c37615ad7dfef14be6 Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 15 Jul 2017 11:24:56 -0400 Subject: [PATCH] add support for self-decrypting nibble check at B400 --- src/passport.a | 1 + src/patchers/jmpb400.a | 57 ++++++++++++++++++++++++++++++++++++++++++ src/strings/en.a | 4 +-- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/patchers/jmpb400.a diff --git a/src/passport.a b/src/passport.a index a1852a8..75872f7 100755 --- a/src/passport.a +++ b/src/passport.a @@ -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 diff --git a/src/patchers/jmpb400.a b/src/patchers/jmpb400.a new file mode 100644 index 0000000..b93d14b --- /dev/null +++ b/src/patchers/jmpb400.a @@ -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 +} diff --git a/src/strings/en.a b/src/strings/en.a index 5bafc3b..f4bad73 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -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