FF6 Hacking
Make "The Veldt" jungle theme play everywhere on the overworld Map. - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Hacks, Resources and Tutorials (https://www.ff6hacking.com/forums/forum-1.html)
+--- Forum: Opera House Rehearsal Room (https://www.ff6hacking.com/forums/forum-71.html)
+--- Thread: Make "The Veldt" jungle theme play everywhere on the overworld Map. (/thread-2454.html)



Make "The Veldt" jungle theme play everywhere on the overworld Map. - CrumpledMedal - 12-30-2013

Is there any way to make the jungle music that plays when the party is on the Veldt play everywhere on the World of Balance map, basically replacing the regular World of Balance Theme? Any knowledge of coding would be helpful because I usually mess something up and my rom goes black.


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - madsiur - 12-30-2013

Here's the relevant code concerning the world maps song loading:

Code:
EE/8A0D:    AD641F      LDA $1F64      (Map number from SRAM, low byte)
EE/8A10:    2903        AND #$03       (We only care about world maps... and the Serpent Trench)
EE/8A12:    0A          ASL A          (Multiply by 2)
EE/8A13:    AA          TAX            (Set as song index)
EE/8A14:    ADB71E      LDA $1EB7      (Event bits)
EE/8A17:    8901        BIT #$01       (Is the "alternate overworld music" bit set?)
EE/8A19:    F001        BEQ $8A1C      (Branch if not) (LSR A, BCC...)
EE/8A1B:    E8          INX            (Increase song index)
EE/8A1C:    BF9183EE    LDA $EE8391,X  (Song number)
EE/8A20:    8D801F      STA $1F80      (Save in SRAM)


You have some free space in bank EE. You could jump to that free space and insert the following code:

Code:
first:
EE/8A0D: JSR $EE/B000

Now at EE/B0000:
01) LDA $1F64     (Map number from SRAM, low byte)
02) AND #$03      (We only care about world maps... and the Serpent Trench)
03) CMP #$01      (Check if in WOB)
04) BNE $????     (jump to step 7)
05) LDA #$19      (Veldt song ID)
06) JMP $????     (Jump to step 14)    
07) ASL A         (Multiply by 2)
08) TAX           (Set as song index)
09) LDA $1EB7     (Event bits)
10) BIT #$01      (Is the "alternate overworld music" bit set?)
11) BEQ           (Branch to step 13)
12) INX           (Increase song index)
13) LDA $EE8391,X (song number)
14) STA $1F80     (Save in SRAM)
15) RTS

Finally, NOP everything up to EE/8A20 (except your first JSL instruction).

With this code, the Veldt music would play in the WOB but the WOR would still have its 2 different map songs. I haven't tested this but I think my logic is good even if my coding is more than lazy :P


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - CrumpledMedal - 12-31-2013

Don't care about WOR, that's OK the way it is. I'm talking WOB, because I want to do a Donkey Kong hack where Donkey Kong replaces Terra and the World of Balance is the jungle. Also any hex editing tutorials on here so I can find the perameters I need to change on a hex editor? I've tried it many times but I often change something important because my Rom fails to start or crashes after I try to hex edit it.


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - madsiur - 01-02-2014

Here's the hex values for the new code. I changed the JMP for a BRA which has the same result. The rest remains the same:

Code:
03) C901    CMP #$01      (Check if in WOB)
04) D004    BNE $????     (jump to step 7)
05) A919    LDA #$19      (Veldt song ID)
06) 800E    BRA $????     (Jump to step 14)

The last instruction, RTS, is 60. The parameter of a BRA and BNE instruction is the number of bytes between the instruction and the instruction it jumps to. You can find an instruction list here. Some instructions have a different hex value and variables numbers of parameters depending of the context they are use into.


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - Vanya - 01-03-2014

Shouldn't this be a simple pointer change?


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - madsiur - 01-03-2014

(01-03-2014, 03:45 AM)Vanya Wrote: Shouldn't this be a simple pointer change?

I thought of this quickly and tbh, I just assume my solution would leave open the possibility to use the overwold theme for something else.

A pointer change is in fact a simpler solution for someone who never coded. You could also opt for a solution similar to mine, but with an optimized approach. I'm sure there's a more elegant to do this than my coding.


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - Vanya - 01-04-2014

OK. I thought as much. I was just wondering if there was a technical reason for your solution. Thanks. Smile


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - CzarMalboro - 07-27-2019

I recall there was a topic that had the pointers listed because I was able to replace the veldt music with the WoB if you were to return. i also got to change the WoR theme, but it has been a long time that I cannot remember the topic.


RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - madsiur - 07-27-2019

(07-27-2019, 05:03 AM)CzarMalboro Wrote: I recall there was a topic that had the pointers listed because I was able to replace the veldt music with the WoB if you were to return. i also got to change the WoR theme, but it has been a long time that I cannot remember the topic.

It's this list:

Code:
EE/8389:    35          (Blackjack; for the Blackjack)
EE/838A:    35          (Blackjack; normally unused)
EE/838B:    4C          (Searching for Friends; normally unused)
EE/838C:    4C          (Searching for Friends; when flying the WoR)
EE/838D:    13          (Techno de Chocobo; chocobo stables for WoB)
EE/838E:    13          (Techno de Chocobo; normally unused)
EE/838F:    13          (Techno de Chocobo; chocobo stables for WoR before finding the airship)
EE/8390:    13          (Techno de Chocobo; chocobo stables for WoR after finding the airship)
EE/8391:    06          (Terra; WoB overworld, excluding the Veldt)
EE/8392:    19          (Wild West; normally unused)
EE/8393:    4F          (Dark World; WoR before finding the airship)
EE/8394:    4C          (Searching for Friends; WoR after finding the airship)
EE/8395:    1A          (Save Them!; for mine-cart sequence)
EE/8396:    1A          (Save Them!; unused)
EE/8397:    28          (The Serpent Trench; for the Serpent Trench)
EE/8398:    28          (The Serpent Trench; normally unused)



RE: Make "The Veldt" jungle theme play everywhere on the overworld Map. - CzarMalboro - 07-27-2019

Thank you.