add support for JMP BB03 variant [Alice in Wonderland, Sum Ducks], consolidate other BB03 patchers

This commit is contained in:
4am 2018-09-28 10:21:42 -04:00
parent a56a2a3537
commit cef1aeb329
7 changed files with 102 additions and 106 deletions

View File

@ -88,8 +88,7 @@ AnalyzeT00
!source "../patchers/mecc4.a"
!source "../patchers/rol1e.a"
; !source "../patchers/thunder.a"
!source "../patchers/jsrbb03.a"
!source "../patchers/davidbb03.a"
!source "../patchers/bb03.a"
!source "../patchers/rwtsswap.a"
!source "../patchers/rwtsswap2.a"
!source "../patchers/border.a"

96
src/patchers/bb03.a Executable file
View File

@ -0,0 +1,96 @@
;-------------------------------
; #BB03
; boot1 calls $BB03 for a self-decrypting nibble check
;
; variant 1 (JSR $BB03)
; Classifying Animals with Backbones
; EduCalc
;
; variant 2 (JSR $BB03 but David-DOS)
; Case of the Great Train Robbery
; Case of the Missing Chick
; Mrs. Wigglesworth's Secret
; Mystery of the Witch's Shoes
;
; variant 3 (JMP $BB03)
; Sum Ducks
; Alice in Wonderland
;-------------------------------
!zone {
sec
bit gMode ; nothing to do here in verify-only mode
bpl .noButInYellow
lda #$07 ; sector to check for David-DOS variant
ldx gIsDavidDOS
beq .maybe
ldx gIsBoot0 ; if DOS 3.3 boot0 loader
bne .noButInYellow
ldx gIsBoot1 ; and DOS 3.3 boot1 loader
bne .noButInYellow
lda #$05 ; sector to check for DOS 3.3 variant
.maybe
ldx #$03
ldy #$25
jsr compare ; if T00,S0(5|7),$03 ==
!byte $4E,$06,$BB,$71,$6E
!byte $0A,$BB,$40,$27,$6E,$0F,$BB,$DD
!byte $1B,$BB,$6E,$15,$BB,$DC,$1E,$BB
!byte $6E,$25,$BB,$72,$00,$BB,$B3,$00
!byte $B8,$99,$00,$BB,$C8,$A0,$F4,$B0
bcs .no
sta gDisplayBytes
lda #s_bb03
jsr PrintByID
lda gIsDavidDOS
beq .variant2
lda #$01
ldx #$38
ldy #$03
jsr compare ; if T00,S01,$38 ==
!byte $20,$03,$BB; JSR $BB03
bcc .variant1
ldy #$03
jsr compare ; if T00,S01,$38 ==
!byte $4C,$03,$BB; JMP $BB03
bcs .no
lda #$05
ldx #$6B
ldy #$05
jsr compare ; if T00,S05,$6B ==
!byte $06,$26,$7D,$39,$41; encrypted, decrypts to 'LDA $C08C,X / BPL -'
.noButInYellow
bcs .no
.variant3
ldy #$02
jsr modify ; then set T00,S05,$6B =
!byte $6B,$F6 ; encrypted, decrypts to 'BNE +$5C' which will unconditionally branch to success path at $BBC9
lda #$06
ldx #$0F
ldy #$01
jsr modify ; and set T00,S06,$0F =
!byte $89 ; encrypted, decrypts to $10 which is the expected nibble count value
bvc .no ; unconditional branch
.variant1
lda #$05
ldx #$03
ldy #$09
jsr modify ; then set T00,S05,$03 =
!byte $A9,$B5
!byte $48
!byte $A9,$18
!byte $48
!byte $4C,$93,$B7
bvc .no ; uncondtional branch
.variant2
lda #$07
ldx #$03
ldy #$0B
jsr modify ; then set T00,S07,$03 =
!byte $A9,$B5
!byte $48
!byte $A9,$18
!byte $48
!byte $A0,$04
!byte $4C,$A9,$B7
.no
}

View File

@ -11,7 +11,6 @@
; Fraction-oids
; Math Magic
; RoboMath
; Sum Ducks
; NoteCard Maker
;-------------------------------
!zone {

View File

@ -1,54 +0,0 @@
;-------------------------------
; #DAVIDBB03
; David-DOS boot0 calls $BB03
; for a self-decrypting nibble
; check which continues to $B7A9
; on success
; e.g. Case of the Great Train
; Robbery, Case of the Missing
; Chick, Mrs. Wigglesworth's Secret
; Mystery of the Witch's Shoes
;-------------------------------
!zone {
sec
bit gMode ; nothing to do here in verify-only mode
bpl .branchexit
lda #$00
ldx #$00
ldy #$38
jsr compare ; and T00,S00,$00 ==
!byte $01,$A5,$27,$C9,$09,$D0,$17,$A5
!byte $2B,$4A,$4A,$4A,$4A,$AA,$09,$C0
!byte $85,$3F,$A9,$00,$9D,$78,$04,$9D
!byte $F8,$04,$A9,$5C,$85,$3E,$AE,$FF
!byte $08,$30,$15,$BD,$ED,$08,$85,$3D
!byte $CE,$FF,$08,$AD,$FE,$08,$85,$27
!byte $CE,$FE,$08,$A6,$2B,$6C,$3E,$00
.branchexit
bcs .exit
lda #$00
ldx #$8B
ldy #$03
jsr compare ; and T00,S00,$8B ==
!byte $20,03,$BB
bcs .exit
lda #$07
ldx #$03
ldy #$25
jsr compare ; and T00,S07,$03 ==
!byte $4E,$06,$BB,$71,$6E
!byte $0A,$BB,$40,$27,$6E,$0F,$BB,$DD
!byte $1B,$BB,$6E,$15,$BB,$DC,$1E,$BB
!byte $6E,$25,$BB,$72,$00,$BB,$B3,$00
!byte $B8,$99,$00,$BB,$C8,$A0,$F4,$B0
bcs .exit
lda #s_jsrbb03
jsr PrintByID
lda #$07
ldx #$03
ldy #$0B
jsr modify ; then set T00,S07,$03 =
!byte $A9,$B5,$48,$A9,$18,$48,$A0,$04
!byte $4C,$A9,$B7
.exit
}

View File

@ -1,44 +0,0 @@
;-------------------------------
; #JSRBB03
; boot1 calls $BB03 for a self-
; decrypting nibble check which
; continues to $B793 on success
; e.g. Classifying Animals with
; Backbones, EduCalc
;-------------------------------
!zone {
bit gMode ; nothing to do here in verify-only mode
bpl .exit
lda gIsBoot0 ; if DOS 3.3 boot0 loader
bne .exit
lda gIsBoot1 ; and DOS 3.3 boot1 loader
bne .exit
lda #$01
ldx #$38
ldy #$03
jsr compare ; and T00,S01,$38 ==
!byte $20,$03,$BB
bcs .exit
lda #$05
ldx #$03
ldy #$25
jsr compare ; and T00,S05,$03 ==
!byte $4E,$06,$BB,$71,$6E
!byte $0A,$BB,$40,$27,$6E,$0F,$BB,$DD
!byte $1B,$BB,$6E,$15,$BB,$DC,$1E,$BB
!byte $6E,$25,$BB,$72,$00,$BB,$B3,$00
!byte $B8,$99,$00,$BB,$C8,$A0,$F4,$B0
bcs .exit
lda #s_jsrbb03
jsr PrintByID
lda #$05
ldx #$03
ldy #$09
jsr modify ; then set T00,S05,$03 =
!byte $A9,$B5
!byte $48
!byte $A9,$18
!byte $48
!byte $4C,$93,$B7
.exit
}

View File

@ -63,7 +63,7 @@ StringTable
!word .jmpb4bb
!word .jmpb400
!word .jmpbeca
!word .jsrbb03
!word .bb03
!word .thunder
!word .jmpae8e
!word .diskvol
@ -146,7 +146,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2018-09-27",$00
!text "Passport by 4am 2018-09-28",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "
@ -315,8 +315,8 @@ StringTable
!text "T00,S02 RWTS requires extra nibbles and",$8D
!text "timing bits after the data prologue by",$8D
!text "jumping to $BECA.",$8D,$00
.jsrbb03
!text "T00,S05 Found a self-decrypting",$8D
.bb03
!text "T%t,S%0 Found a self-decrypting",$8D
!text "protection check at $BB03.",$8D,$00
.thunder
!text "T00,S03 RWTS counts timing bits and",$8D

View File

@ -50,7 +50,7 @@ s_e7 = $2C
s_jmpb4bb = $2D
s_jmpb400 = $2E
s_jmpbeca = $2F
s_jsrbb03 = $30
s_bb03 = $30
s_thunder = $31
s_jmpae8e = $32
s_diskvol = $33