Community

The PokéCommunity

We are still working on a better slogan!

Visit Index



Advertise here

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.

Post Reply
 
Thread Tools
  #1    
Old April 5th, 2013, 05:24 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet

Advertise here
First things first, this only applies to legendary battles created through the use of setwildbattle followed by special 0x138.

A short health warning before you embark on this tutorial - You have to redefine all species you wish to put through this code, so Mewtwo, Zapdos and Moltres will default to a certain track if you don't put them on the definition list.

Ever wondered why Moltres, Zapdos and Mewtwo get their own battle music, while every other Pokémon has to have the "normal" battle music?

More importantly, have you ever wished you could control which Pokémon gets what piece of music played for it?

If so, then read on!

First up, some more ASM code to assemble:

Code:
.text
.align 2
.thumb
.thumb_func
.global battlemusichackleg
main: push {r2,r3}
ldr r0, tableloc
loopstart: ldrh r2, [r0, #0x0]       // Loads the species ID from the current slot of the table
cmp r1, r2                 // R1 contains the species you are about to battle
beq loadmusic            // If R1 == R2, then go on to load the music ID
ldr r3, end                // Loads the delimiter ID to check if the end of the table has been reached
cmp r2, r3                // Checks if the Loaded species ID is the same as the table delimiter
beq loadnormal          // If it is, it loads a standard music slot instead (same slot as vanilla FR)
add r0, #0x4             // Increments the slot ID
b loopstart                    // Loops back round to the start
loadnormal: mov r1, #0xAA
lsl r1, r1, #0x1
add r1, #0x1                 // R1 will contain 0x155 at this point
return: pop {r2,r3}
ldr r0, goback               // Returns to normal execution
bx r0
loadmusic: ldrh r1, [r0, #0x2]             // Loads the song ID provided in the table to R1
b return
.align
end: .word 0x0000FEFE
goback: .word 0x0807FA3F
tableloc: .word 0x08FFFFFF
Then, navigate to 0x7F9F4 and change the bytes to 01 1C 00 00 00 48 00 47 XX XX XX 08.
Where the XX's stand for the pointer to the new routine plus 1.

Finally, you need to add a new table to your ROM, and repoint the tableloc: .word 0x08FFFFFF to it. The table should be arranged as such:

Code:
[Species - Half-Word][Music to Play - Half-Word]
SO, for example, I wanted Mew to have song 0x129 as its music and Ho-oh to have 0x124 as its music, it would look like:

Code:
97 00 29 01 FA 00 24 01 FE FE 00 00
The FEFE0000 at the end is necessary to limit the table length. On reading that number, the game will stop searching for new species to get music for.

The table can be as long or as short as you desire. Just ensure it's correctly aligned and has the FEFE0000 delimiter at the end.
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
  #2    
Old April 27th, 2013, 06:41 PM
GoGoJJTech's Avatar
GoGoJJTech
http://GoGoJJTech.com
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
FREAKING FINALLY
I've looked into this for a while. Great work as always Jambo, I'm using this!
Post Reply
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 12:21 PM.

About Us
© 2002 - 2014 The PokéCommunity™, pokecommunity.com. Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.

Copyright
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com. PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator. Header artwork by Jordanice of deviantART.

Social Media
If you would like to stay up-to-date with us on the go, when we're down, or other such things, follow us on social media sites--most notibly Twitter, Facebook, and Google Plus--by clicking on the links provided.

Design presented by Peitharchia. Special thanks to Hiroshi Sotomura and Ausaudriel.