Modify Overworld Music Triggers

View previous topic View next topic Go down

Modify Overworld Music Triggers

Post by qwertymodo on Tue 14 Jun 2016 - 22:33

In the light world overworld, there are 4 different song triggers for each area.  In HM, these are found by clicking Properties



The original code for determining these triggers is at $02C46F

Code:
seek($02C46F)
    ldy #$00C0    // Load music option #4
    lda $7EF3C5   // Check progress indicator
    cmp #$03      // If you've beaten Agahnim
    bcs +         // Exit
    ldy #$0080    // Else, load music option #3
    lda $7EF359   // Check sword level
    cmp #$02      // If >= 2 (Master Sword)
    bcs +         // Exit
    lda #$05      // Else
    sta $00       // Not sure what this does...
    ldy #$0040    // Load music option #2
    lda $7EF3C5   // Check progress indicator
    cmp #$02      // If you have rescued Zelda
    bcs +         // Exit
    ldy #$0000    // Else, load music option #1
+;  lda $C303,y   // Load selected song

I want to make a few changes specific to Parallel Worlds, but if you want to, you can change this however you like.  All you need to do is change what gets checked for each.  In my case, for PW, I want the triggers to remain the same, but the two problems are that you beat Agahnim before getting the Master Sword, and the Master Sword is actually sword #4.

One thing that's important to note is that when you don't have your sword at the beginning of the game, $7EF359 = $00, but when you give your sword to the swordsmiths to be tempered, it's $FE (or maybe $FF, not sure), so in PW, the check for any sword greater than #$02 will evaluate as true when the smiths have your sword, even though the tempered sword comes before the Master Sword.  So, my changes look like this:

Code:
seek($02C46F)
    ldy #$0080    // Load music option #3
    lda $7EF359   // Check sword level
    cmp #$04      // If = 4 (Master Sword)
    beq +         // Exit
    ldy #$00C0    // Else, load music option #4
    lda $7EF3C5   // Check progress indicator
    cmp #$03      // If you've beaten Agahnim
    bcs +         // Exit
    lda #$05      // Else
    sta $00       // Not sure what this does...
    ldy #$0040    // Load music option #2
    lda $7EF3C5   // Check progress indicator
    cmp #$02      // If you have rescued Zelda
    bcs +         // Exit
    ldy #$0000    // Else, load music option #1
+;  lda $C303,y   // Load selected song

By putting the sword check first, it overrides the Agahnim check, which is what you would want if you get the Master Sword after beating him instead of before (basically, the first true condition wins, so you want the latest trigger in the game to come first).
avatar
qwertymodo



Since : 2014-10-21

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum