The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

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.

Reply
 
Thread Tools
  #1    
Old March 25th, 2013, 02:31 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Have you ever noticed that FireRed only has 3 pieces of encounter music for trainerbattles? How limiting! Even using Mastermind_X's code doesn't improve things that much, since it requires careful setting and clearing of variables.

Have you ever wished that you could just define which "Music" number in A-Trainer applied to which track in the ROM?

If so, this hack is for you!

Firstly, assemble this code, remembering to change the YY to the number of encounter tracks you will have - 1 (That is, if you have encounter tracks 0-7 (a total of 8), you would put 7 as the YY number).

Code:
.text
.align 2
.thumb
.thumb_func
.global exclaimhack

main:
ldr r1, table // Creates a new table for the music to be put on
cmp r0, #0xYY /*This is the number of encounter music track you want
to have. If you use a value above this, it loads slot 3 of the table as a
failsafe*/
ble back
mov r0, #0x0 // If the slot the game is trying to load is too large, defaults to this slot to prevent crashes
back: lsl r0, r0, #0x1 // Multiplies the slot ID by 2
add r1, r0, r1 // Adds the Slot ID to the Table location
ldrh r0, [r1, #0x0] // Loads the actual song ID from the table
ldr r1, place // Returns to normal execution
bx r1
.align
place: .word 0x080806BB
table: .word 0x08FFFFFF
Then, in a hex editor, navigate to 0x80650, and overwrite the data there with this:
Code:
00 49 08 47 XX XX XX 08
Where the XX's stand for the pointer to the new routine plus 1.

All this does is reads the "music" byte which accompanies every trainer battle, and reads a newly created table. This table should have a half word for each entry. Which represents which music slot will be played for that music byte. Create your table wherever you like, then change the table: .word 0x08FFFFFF to be a pointer to this new table.

Build the table like so:

Code:
[Track to Play 0][Track to Play 1]
putting in as many entries as you defined above (so, using my earlier example, entries 0 to 7.

So, if you wanted 0x11B to be Encounter 0, 0x11C to be 1 and 0x11D to be 2 (as an example), your table would be:
Code:
1B 01 1C 01 1D 01
Easy, isn't it!
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

Last edited by Jambo51; March 25th, 2013 at 10:32 PM.
Reply With Quote
  #2    
Old March 25th, 2013, 07:04 PM
RPD490's Avatar
RPD490
 
Join Date: Jan 2009
Location: Blackthorn City, Johto
Gender: Male
Nature: Relaxed
Makes me curious, what exactly are the numbers for the Music function in A-Trainer, I mean there isn't any guide or references to tell you what number goes to what theme. It is rather annoying.
__________________
This signature has been disabled.
Signature is over 600px wide :(
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #3    
Old April 3rd, 2013, 08:46 AM
GoGoJJTech's Avatar
GoGoJJTech
http://GoGoJJTech.com (WIP!)
Community Supporter
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
How do you come up with this jambo?
You just keep proving yourself to be a guru
__________________
Reply With Quote
  #4    
Old April 5th, 2013, 05:11 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Quote:
Originally Posted by RPD490 View Post
Makes me curious, what exactly are the numbers for the Music function in A-Trainer, I mean there isn't any guide or references to tell you what number goes to what theme. It is rather annoying.
It's defined by ASM in the background to be (basically) this:

Code:
if (musicNumber == 1)
{
    return 0x11C;
}
else if (musicNumber == 0)
{
    return 0x11D;
}
else
{
    return 0x11B;
}
Which works for FR's setup, but isn't much good for what we need to do with it in hacking terms. There are other numbers which refer to the music tracks of course, but largely what I showed above is accurate.

Quote:
Originally Posted by gogojjtech View Post
How do you come up with this jambo?
Usually boredom combined with an annoyance at a limitation of the engine.

Quote:
Originally Posted by gogojjtech View Post
You just keep proving yourself to be a guru
No, just... no. Lol.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #5    
Old September 21st, 2014, 03:40 AM
RaileysXerilyasRX's Avatar
RaileysXerilyasRX
You have failed me from the last time.
 
Join Date: Feb 2014
Location: Philippines
Gender: Male
Nature: Adamant
Send a message via Skype™ to RaileysXerilyasRX
How about controlling and extending VICTORY MUSIC? I want to make assigned victory themes for teams, E4, and champion. That's a last thing i need. Thanks.
__________________
RaileysXerilyasRX
Pokémon Dark Vengeance Version
Reply With Quote
Reply
Quick Reply

Sponsored Links
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 02:31 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 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.
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.