add support for patching Dakin5 RWTS that XORs sector ID with 0x7E

This commit is contained in:
4am 2019-02-03 10:20:02 -05:00
parent 314f4e9794
commit 0618041e91
4 changed files with 55 additions and 2 deletions

View File

@ -111,6 +111,7 @@ AnalyzeT00
!source "../patchers/panglosdos.a"
!source "../patchers/rdos13.a"
!source "../patchers/swordthrust.a"
!source "../patchers/dakin5.a"
;add only above this line
rts

48
src/patchers/dakin5.a Normal file
View File

@ -0,0 +1,48 @@
;-------------------------------
; #DAKIN5
; RWTS XORs sector ID with #$7E
;
; tested on
; - Neutrons
; - MIRV
; - Rings of Saturn
;-------------------------------
!zone {
bit gMode ; nothing to do here in verify-only mode
bpl .exit
lda gIsRWTS
bne .exit
lda #$00
ldx #$B3
ldy #(@compareend-@comparestart)
jsr compare ; if T00,S00,$B3 ==
@comparestart
CMP #$AA
BNE @b
LDA $2E
BEQ @a
EOR #$7E
STA $2E
@a LDA #$AA
CLC
RTS
@b SEC
RTS
@compareend
bcs .exit
lda #$03
ldx #$9A
ldy #$03
jsr compare ; and T00,S03,$9A ==
JMP $B6B3
bcs .exit
pha
lda #s_dakin5
jsr PrintByID
pla
ldy #$03
jsr modify ; then set T00,S03,$9A =
!byte $C9,$AA
!byte $D0
.exit
}

View File

@ -126,6 +126,7 @@ StringTable
!word .infocom18
!word .toverify
!word .sector13
!word .dakin5
;
; Text can contain substitution strings, which
; are replaced by current values at runtime. Each
@ -151,7 +152,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2018-12-29",$00
!text "Passport by 4am 2019-02-03",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "
@ -437,6 +438,8 @@ StringTable
.origin
!text "T%t,S%0 RWTS alters the sector ID if the"
!text "address epilogue contains a timing bit.",$8D,$00
.dakin5
!text "T00,S03 RWTS XORs every sector ID",$8D,$00
.volumename
!text "T%t,S%0 Volume name is ",$00
.dinkeydos

View File

@ -112,4 +112,5 @@ s_aacount = $6A
s_infocom18 = $6B
s_toverify = $6C
s_13sector = $6D
STRINGCOUNT = $6E
s_dakin5 = $6E
STRINGCOUNT = $6F