The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Emulation & ROM Hacking > Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Tutorials Looking for a guide to help you out? Then you're in the right place! We've got everything you need, ranging from Mapping to Music!
New threads in this forum are to be approved by a moderator before they are displayed. The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old June 26th, 2013, 09:24 AM
xGal
du bist n00b
 
Join Date: Nov 2011
Location: A tree
Gender: Male
Nature: Bold
Hello. In this post, I am going to show you the easiest way possible to extend the songtable of any GBA game.

What we need:
- A ROM
- Sappy
- A Hex Editor (I'll be using HxD but any editor would work)
- A brain

Getting our songtable offset

Code:
FireRed: 4A32CC
LeafGreen: 4A2BA8
Ruby: 45548C
Sapphire: 4554E8
Emerald: 6B49F0
2. Navigating to our songtable

Let's say I am using FireRed.

I am opening my ROM with a hex editor.

I am going to the songtable offset, which is 4A32CC is my case.

Mark every byte there is until the end of the songtable (consecutive 00s). In FireRed, the end of the songtable is exactly at:
Code:
4A3DA8
(In a case you didn't change it)

Now, copy all the bytes you marked and navigate to any free space after:
Code:
800000
I'll be using offset
Code:
960000
Paste the bytes and remember the offset you pasted the bytes to. Now, go to the start of the NEW songtable and search the bytes:
Code:
8C BE 6F 08
. After those bytes, write
Code:
00 00 00 00 8C BE 6F 08
.

Now, Open the sappy.xml file and change the songtable of the free space offset you picked up, make sure you change the songtable to the correct game code.

Now, open up sappy and play song 347. You should hear Teachy TV song. That's good.
If you don't, you probably did something wrong.

Now, close sappy and open up the hex editor. Click CTRL+F and search the bytes: Your songtable in reserve hex. Reserve hex is simple, in my case, the songtable is
Code:
4A32CC
, so this offset in reserve hex is CC 32 4A. If you found the right bytes, there should be CC 32 4A 08. Simply overwrite the CC 32 4A to the NEW songtable in reserve hex.
Code:
960000
in reserve hex is
Code:
 00 00 96
But if you might notice there are MULTIPLE CC 32 4As around there. overwrite ALL OF THEM.

Open up Sappy and navigate to the last song. In FireRed, it's songnumber
Code:
346
Click on the right arrow to navigate to the next song.

Click on assemble song and choose in a random song.

Change the followings:

Code:
Base destination offset: Free space to import the song to.
Voicegroup offset: The voicegroup offset...
MST Offset: It will probably be on 347, but if it's not, change it to 347.
Song groups: ALL to 0
. Assemble it and play song 347. You should hear the new song! Congratulations! But, hey, we didn't finish yet!

Go to advance map and change the map music of any place you want to:
Code:
15A + M
. Where the M variable stands, put the number of the new song you inserted. Example, if it is the first song I added, I will replace M with 1, if second, I will replace M with 2, if 30, I will replace M with 30, etc.

Now, open the hex editor and navigate to the end of the new songtable. After the new song you inserted's pointer, type:
Code:
00 00 00 00
If you won't do that, it won't play ingame!

Now, test that in-game, and if you hear the new song you assembled, congratulations! You extented the songtable!

To make the access to this song easier, open up sappy.xml and navigate to your ROM's songtable. Copy the last song's FULL line and copy it to the next line. If it's teachy TV's line, it should look like that:
Code:
            <song track="0x15A">Teachy TV</song>
.

Simply check out your song's number on sappy (in my case, it's 347), open up Caculator and convert the number 347 from Dec to Hex. You should get 15B. Now, when you got the hex number of the song, simply change the line to:
Code:
             <song track="0x15B">New Song W00T!</song>
.

Let's test!


Yay :<

That's it! Simple, isn't it?

Now, this is for people wants to know how it works:

Spoiler:
The 00 00 00 00 8C BE 6F 08 we put contains a pointer. Let me show you:
Code:
00 00 00 00 ' I am not sure, I think it is the space between two song pointers.
8C BE 6F ' Teachy TV's location in the ROM, in reverse hex ofcourse.
08 ' It tells the game that the offset we put before is in the ROM.
Now, when we went to song number 347, Sappy was looking for the 8C BE 6F 08 we put before, and as I mentioned earlier, it's the pointer to Teachy TV's song.
Now, once you have assembled a song as song number 347, Sappy replaced the pointer to the Teachy TV's song we put after the 00 00 00 00 with the pointer to our new song's first track!


I hope it helped you!

- Gal
__________________

Last edited by xGal; August 16th, 2013 at 03:03 AM. Reason: Le Update
Reply With Quote
  #2    
Old June 28th, 2013, 11:57 PM
阴魂君's Avatar
阴魂君
_(:зゝ∠)_ so busy i am…
 
Join Date: Nov 2012
Location: China
Age: 18
Gender: Male
Nature: Brave
wow..amazing!I just knew changing the song in the past,can i translate it to Chinese and reprint it to a Chinese forum?
Reply With Quote
  #3    
Old June 29th, 2013, 12:37 AM
xGal
du bist n00b
 
Join Date: Nov 2011
Location: A tree
Gender: Male
Nature: Bold
Quote:
Originally Posted by 阴魂君 View Post
wow..amazing!I just knew changing the song in the past,can i translate it to Chinese and reprint it to a Chinese forum?
Feel free man, but give me a credit x)
__________________

Last edited by xGal; June 29th, 2013 at 08:04 AM.
Reply With Quote
  #4    
Old July 3rd, 2013, 01:41 PM
Team Fail's Avatar
Team Fail
 
Join Date: May 2009
Age: 18
Gender: Male
Nature: Brave
But do these new songs play in-game? One major thing you're missing is telling the game itself that you have a new soundtable, and the game will just read the old table and not check the new one. Or does Sappy fix all that behind-the-scenes?
__________________



Team Fail

Community Supporter Collab
☆ ☆ ☆


Reply With Quote
  #5    
Old July 3rd, 2013, 11:56 PM
Flandre Scarlet's Avatar
Flandre Scarlet
Free your mind.
 
Join Date: Feb 2008
Location: Australia
Age: 18
Gender: Male
Nature: Adamant
Quote:
Originally Posted by Team Fail View Post
But do these new songs play in-game? One major thing you're missing is telling the game itself that you have a new soundtable, and the game will just read the old table and not check the new one. Or does Sappy fix all that behind-the-scenes?
No, you have to repoint all of the pointers to the old soundtable to the new one. Just replace them with a hex-editor, but I'm sure you're experienced enough to figure that out.

Also, yes, Team Fail is correct, you are missing a major thing in this tutorial, which is replacing the old pointers with the new one. That way it tells the game to read the new soundtable. If you compile a song in the new soundtable with Sappy, it will just be silent in game until you do this.
__________________
Reply With Quote
  #6    
Old July 4th, 2013, 03:00 AM
xGal
du bist n00b
 
Join Date: Nov 2011
Location: A tree
Gender: Male
Nature: Bold
Quote:
Originally Posted by Team Fail View Post
But do these new songs play in-game? One major thing you're missing is telling the game itself that you have a new soundtable, and the game will just read the old table and not check the new one. Or does Sappy fix all that behind-the-scenes?
For me, the music is not freezing, but I almost completely forgot about this, thanks. -I would add this part when I'll be on my computer- Done. Thanks again.
__________________

Last edited by xGal; July 4th, 2013 at 06:34 AM.
Reply With Quote
  #7    
Old August 14th, 2013, 06:01 PM
xGal
du bist n00b
 
Join Date: Nov 2011
Location: A tree
Gender: Male
Nature: Bold
Hiya guys, sorry about the BUMP, but I found some problems on the tutorial, so I fixed everything. If you already did it, I highly recommend you to re-do this tutorial!

Sorry again.

- Gal
__________________
Reply With Quote
  #8    
Old 3 Weeks Ago, 11:27 AM
2012maniac's Avatar
2012maniac
 
Join Date: Apr 2012
Gender: Male
Great, but if we want to insert Tracks, ripped from another game, what do we change?
__________________
░░░░░███████ ]▄▄▄▄▄▄▄▄
▂▄▅█████████▅▄▃▂
Il███████████████████].
◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤..

Check this link out to see the LIES you are being forced into: www.exposingchristianity.com/Conspiracy.htm

If you're looking for a good time, or just want to chat, come over to Weloxux and I's channel at:
http://mibbit.com/?server=irc.mibbit...%23Dragons_Den
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 10:41 PM.


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.