Fix inverted mode flute loading light world music

This commit is contained in:
qwertymodo
2018-11-28 18:17:49 -08:00
parent bf49cde0ea
commit a75926b9e6
2 changed files with 69 additions and 0 deletions

View File

@@ -169,6 +169,71 @@ Overworld_FinishMirrorWarp:
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
BirdTravel_LoadTargetAreaMusic:
; Skip village and lost woods checks if entering dark world or a special area
LDA $8A : CMP.b #$40 : !BGE .notVillageOrWoods
LDX.b #$07 ; Default village theme
; Check what phase we're in
LDA $7EF3C5 : CMP.b #$03 : !BLT +
LDX.b #$02 ; Default light world theme (phase >=3)
+
; Check if we're entering the village
LDA $8A : CMP.b #$18 : BEQ .endOfLightWorldChecks
; For NA release would we also branch on indexes #$22 #$28 #$29
LDX.b #$05 ; Lost woods theme
; check if we've pulled from the master sword pedestal
LDA $7EF300 : AND.b #$40 : BEQ +
LDX.b #$02 ; Default light world theme
+
; check if we are entering lost woods
LDA $8A : BEQ .endOfLightWorldChecks
.notVillageOrWoods
; Use the normal overworld (light world) music
LDX.b #$02
; Check phase ; In phase >= 2
LDA $7EF3C5 : CMP.b #$02 : !BGE +
; If phase < 2, play the legend music
LDX.b #$03
+
.endOfLightWorldChecks
; if we are in the light world go ahead and set chosen selection
LDA $7EF3CA : BEQ .checkInverted+4
LDX.b #$0F ; dark woods theme
; This music is used in dark woods
LDA $8A
CMP.b #$40 : BEQ +
LDX.b #$0D ; dark death mountain theme
; This music is used in dark death mountain
CMP.b #$43 : BEQ + : CMP.b #$45 : BEQ + : CMP.b #$47 : BEQ +
LDX.b #$09 ; dark overworld theme
+
; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted
LDA $7EF3CA : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck
; Does Link have a moon pearl?
LDA $7EF357 : BNE +
LDX.b #$04 ; bunny theme
+
.lastCheck
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;0 = Is Kakariko Overworld
;1 = Not Kakariko Overworld