patcher cleanup, combine jmpbeca and jmpbeca2

This commit is contained in:
4am 2017-05-04 11:25:32 -04:00
parent 9dff1a598f
commit 6554b44b3d
9 changed files with 87 additions and 57 deletions

View File

@ -669,7 +669,6 @@ _applyToT00
!source "patchers/jmpbcf0.a" !source "patchers/jmpbcf0.a"
!source "patchers/jmpbeb1.a" !source "patchers/jmpbeb1.a"
!source "patchers/jmpbeca.a" !source "patchers/jmpbeca.a"
!source "patchers/jmpbeca2.a"
!source "patchers/jmpb660.a" !source "patchers/jmpb660.a"
!source "patchers/jmpb720.a" !source "patchers/jmpb720.a"
!source "patchers/bademu.a" !source "patchers/bademu.a"

View File

@ -5,7 +5,6 @@
; e.g. Troll's Tale ; e.g. Troll's Tale
;------------------------------- ;-------------------------------
!zone { !zone {
jmpb4bb
lda gIsMaster ; if DOS 3.3 lomem bootloader lda gIsMaster ; if DOS 3.3 lomem bootloader
bne .exit bne .exit
lda #$0C lda #$0C

View File

@ -18,9 +18,22 @@ _jmpb4bbhi
lda #s_jmpb4bb lda #s_jmpb4bb
jsr PrintByID jsr PrintByID
lda #$0C lda #$0C
ldx #$84
ldy #$03 ldy #$03
jsr modify ; then set T00,S0C,$84 = jsr modify ; then set T00,S0C,$84 =
!byte $AD,$E9,$B7 !byte $AD,$E9,$B7
;
; also check a variant that redirects the DOS input
; vector through code that is only loaded by the
; protection check we just bypassed
;
lda #$0D
ldx #$BA
ldy #$03
jsr compare ; if T00,S0D,$BA ==
!byte $4C,$0B,$B7
bcs .exit
ldy #$03
jsr modify ; then set T00,S0D,$BA =
!byte $6C,$38,00
.exit .exit
} }

View File

@ -12,10 +12,20 @@ _jmpb660
ldx #$DC ldx #$DC
ldy #$1D ldy #$1D
jsr compare ; and T00,S02,$DC == jsr compare ; and T00,S02,$DC ==
!byte $A0,$20,$88,$F0,$61,$BD,$8C,$C0 !byte $A0,$20
!byte $10,$FB,$49,$97,$D0,$F4,$EA,$BD !byte $88
!byte $8C,$C0,$10,$FB,$C9,$97,$D0,$F2 !byte $F0,$61
!byte $A0,$56,$4C,$60,$B6 !byte $BD,$8C,$C0
!byte $10,$FB
!byte $49,$97
!byte $D0,$F4
!byte $EA
!byte $BD,$8C,$C0
!byte $10,$FB
!byte $C9,$97
!byte $D0,$F2
!byte $A0,$56
!byte $4C,$60,$B6
bcs .exit bcs .exit
lda #s_jmpb660 lda #s_jmpb660
jsr PrintByID jsr PrintByID

View File

@ -13,14 +13,22 @@ _jmpb720
ldx #$08 ldx #$08
ldy #$18 ldy #$18
jsr compare ; and T00,S0B,$08 == jsr compare ; and T00,S0B,$08 ==
!byte $4C,$20,$B7,$4C,$0E,$A9,$A2,$02 !byte $4C,$20,$B7
!byte $BD,$0B,$B7,$9D,$5E,$B8,$BD,$08 !byte $4C,$0E,$A9
!byte $B7,$9D,$F6,$B8,$CA,$10,$F1,$60 !byte $A2,$02
!byte $BD,$0B,$B7
!byte $9D,$5E,$B8
!byte $BD,$08,$B7
!byte $9D,$F6,$B8
!byte $CA
!byte $10,$F1
!byte $60
bcs .exit bcs .exit
lda #$0B lda #$0B
ldx #$08 ldx #$08
ldy #$06 ldy #$06
jsr modify ; then set T00,S0B,$08 = jsr modify ; then set T00,S0B,$08 =
!byte $BD,$8C,$C0,$20,$B8,$B8 !byte $BD,$8C,$C0
!byte $20,$B8,$B8
.exit .exit
} }

View File

@ -14,7 +14,9 @@ _jmpbcf0
ldx #$94 ldx #$94
ldy #$08 ldy #$08
jsr compare ; and T00,S03,$94 == jsr compare ; and T00,S03,$94 ==
!byte $DD,$8C,$C0,$D0,$A9,$4C,$F0,$BC !byte $DD,$8C,$C0
!byte $D0,$A9
!byte $4C,$F0,$BC
bcs .exit bcs .exit
lda #s_jmpbcf0 lda #s_jmpbcf0
jsr PrintByID jsr PrintByID
@ -22,6 +24,9 @@ _jmpbcf0
ldx #$94 ldx #$94
ldy #$08 ldy #$08
jsr modify ; then set T00,S03,$94 = jsr modify ; then set T00,S03,$94 =
!byte $EA,$BD,$8C,$C0,$10,$FB,$C9,$AA !byte $EA
!byte $BD,$8C,$C0
!byte $10,$FB
!byte $C9,$AA
.exit .exit
} }

View File

@ -13,23 +13,29 @@ _jmpbeb1
lda #$02 lda #$02
ldx #$48 ldx #$48
ldy #$10 ldy #$10
jsr compare ; and T00,S03,$48 == jsr compare ; and T00,S02,$48 ==
!byte $A0,$03,$48,$68,$20,$B9,$B8,$88 !byte $A0,$03
!byte $D0,$F8,$4C,$B1,$BE,$EA,$EA,$A9 !byte $48
!byte $68
!byte $20,$B9,$B8
!byte $88
!byte $D0,$F8
!byte $4C,$B1,$BE
!byte $EA
!byte $EA
!byte $A9
bcs .exit bcs .exit
lda #$02
ldx #$59 ldx #$59
ldy #$04 ldy #$04
jsr compare ; and T00,S02,$59 == jsr compare ; and T00,S02,$59 ==
!byte $20,$B8,$B8,$A9 !byte $20,$B8,$B8
!byte $A9
bcs .exit bcs .exit
lda #$02
ldx #$5E ldx #$5E
ldy #$03 ldy #$03
jsr compare ; and T00,S04,$5E == jsr compare ; and T00,S02,$5E ==
!byte $20,$BB,$B8 !byte $20,$BB,$B8
bcs .exit bcs .exit
lda #$02
ldx #$49 ldx #$49
ldy #$01 ldy #$01
jsr modify ; then set T00,S02,$49 = jsr modify ; then set T00,S02,$49 =

View File

@ -7,23 +7,43 @@
; patchers due to overlapping bytes ; patchers due to overlapping bytes
;------------------------------- ;-------------------------------
!zone { !zone {
_jmpbeca
lda gIsRWTS ; if DOS 3.3 RWTS lda gIsRWTS ; if DOS 3.3 RWTS
bne .exit bne .exit
lda #$02 lda #$02
ldx #$F4 ldx #$F4
ldy #$0D ldy #$0D
jsr compare ; and T00,S02,$F4 == jsr compare ; and T00,S02,$F4 ==
!byte $EA,$BD,$8C,$C0,$10,$FB,$C9,$AD !byte $EA
!byte $D0,$E8,$4C,$CA,$BE !byte $BD,$8C,$C0
!byte $10,$FB
!byte $C9,$AD
!byte $D0,$E8
!byte $4C,$CA,$BE
bcc .yes
;
; variant seen in Library Magic
;
ldy #$0D
jsr compare ; or T00,S02,$F4 ==
!byte $4C,$CA,$BE
!byte $EA
!byte $BD,$8C,$C0
!byte $10,$FB
!byte $49
!byte $AD,$D0,$DD
bcs .exit bcs .exit
.yes
lda #s_jmpbeca lda #s_jmpbeca
jsr PrintByID jsr PrintByID
lda #$02 lda #$02
ldx #$F4
ldy #$0D ldy #$0D
jsr modify ; and set T00,S02,$F4 = jsr modify ; and set T00,S02,$F4 =
!byte $A0,$56,$BD,$8C,$C0,$10,$FB,$C9 !byte $A0,$56
!byte $AD,$D0,$E7,$A9,$00 !byte $BD,$8C,$C0
!byte $10,$FB
!byte $C9,$AD
!byte $D0,$E7
!byte $A9,$00
.exit .exit
} }

View File

@ -1,30 +0,0 @@
;-------------------------------
; #JMPBECA2
; RWTS calls $BECA for funny business
; instead of checking data prologue
; (variation #2)
; e.g. Library Magic
; NOTE: must be run before RWTS
; patchers due to overlapping bytes
;-------------------------------
!zone {
_jmpbeca2
lda gIsRWTS ; if DOS 3.3 RWTS
bne .exit
lda #$02
ldx #$F4
ldy #$0D
jsr compare ; and T00,S02,$F4 ==
!byte $4C,$CA,$BE,$EA,$BD,$8C,$C0,$10
!byte $FB,$49,$AD,$D0,$DD
bcs .exit
lda #s_jmpbeca
jsr PrintByID
lda #$02
ldx #$F4
ldy #$0D
jsr modify ; and set T00,S02,$F4 =
!byte $A0,$56,$BD,$8C,$C0,$10,$FB,$C9
!byte $AD,$D0,$E7,$A9,$00
.exit
}