Merge pull request #17 from codemann8/MSUMuteFix

Preserve original Sanc/HC music track change if Zelda isn't delivered yet
This commit is contained in:
aerinon
2022-01-05 14:32:37 -07:00
committed by GitHub
2 changed files with 9 additions and 7 deletions

View File

@@ -189,9 +189,9 @@ Main_ShowTextMessage:
; Conditionally disable UW music changes in Door Rando
org $028ADB ; <- Bank02.asm:2088-2095 (LDX.b #$14 : LDA $A0 ...)
JSL.l Underworld_DoorDown_Entry : CPX #$10
db $B0, $21 ; BCS $028B04
BRA + : NOP #6 : +
JSL.l Underworld_DoorDown_Entry : CPX #$FF
BEQ + : db $80, $1C ; BRA $028B04
NOP #6 : +
org $02C3F2 ; <- Bank02.asm:10521 Unused call
Underworld_DoorDown_Call:

View File

@@ -289,14 +289,16 @@ Overworld_MosaicDarkWorldChecks:
;
; On entry, A=16bit XY=8bit, A & X safe to mod, Y unknown
Underworld_DoorDown_Entry:
LDA.l DRMode : TAX : LDA $A0 : CPX #0 : BNE .done
LDX #$FF ; some junk value to be used later to determine if the below lines will change the track
LDA.l $7EF3C5 : AND.w #$00FF : CMP.w #2 : !BLT .vanilla
LDA.l DRMode : BNE .done
.vanilla ; thing we wrote over
CMP.w #$0012 : BNE +
LDA $A0 : CMP.w #$0012 : BNE +
LDX.b #$14 ; value for Sanc music
BRA .done
+ CMP.w #$0002 : BNE .done
+ LDA $A2 : CMP.w #$0012 : BNE .done
LDX.b #$10 ; value for Hyrule Castle music
.done
RTL
LDA $A0 : RTL
;--------------------------------------------------------------------------------