Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

Reply
 
Thread Tools
  #1    
Old October 21st, 2008 (2:51 PM). Edited April 15th, 2010 by Logan.
linkandzelda's Avatar
linkandzelda linkandzelda is offline
n00b desu ka?
     
    Join Date: Dec 2006
    Location: Hastings, England
    Gender: Male
    Nature: Careful
    Posts: 775
    Adding Extra Songs to a Fire Red ROM.
    Created by linkandzelda.

    Hello. I'm linkandzelda.
    This is my first tutorial for the PokéCommunity so hope you enjoy it. This tutorial is for FR only.
    It will show you how to add in extra slots for inserting songs into your GBA Pokémon hacks.

    Requirments:
    1. Hex editor
    2. Sappy
    3. A-Map
    4. Know how to use the tools above.
    5. Some patience and a brain.

    1. Repointing the song table.

    Ok were gonna start by opening up or FR Rom in Sappy. Pretty easy but if you cant do that then you should'nt be following this guide.
    Next were going to look for the location of tha song table. Look at the picture bellow for the location:




    Now open your Rom with a hex editor and goto the location of your song table. I use Hex Workshop but it will work with any hex editor.
    Once your there you should see something like this:




    This is how song that are in FR are placed onto the song table.
    They are structured like this:




    Our next job is to find where our song table ends. This is a simple task and heres how to do it.
    keep looking through the table until you see 0000 0000 0000 0000 and then other random bytes. this is the end of the table.
    It should look like this:




    Now you need to go back to the beginning of the song table and highlight from 0x4A32CC until 0x4A3DA8. Thats the song table.
    Once you've highlighted the text you need to copy it.

    Now we are going to repoint that table to a custom location. Find some free space after 0x800000. This is where we are going to place a copy of the table.
    I used 0x960000 but you can use what you like. Before you paste the table in there is a slight calculation we have to do first.
    Open up the windows calculator and switch it into scientific view.
    What we need to do is find out how much bytes the table is taking up. We need to know this so that we can highlight the right amount of bytes to overight when we paste in the copyed table. The way to do this is to subtract the offset of where the table ends with where it starts. Then we are left with the size of the table.

    When you do this make sure you switch it over to hex mode. Enter in 4A3DA8. Subtract 4A32CC from it. you should be left with ACD.
    Now we have the size of the table we can calculate how much to highlight. Open the calculator again and enter in the offset to the beginning of your free space. Then add ACD to it. In my case it was very easy as I had 0x960000 so the result was 960ACD. If you chose another location then your result will be different to mine.

    Ok. So we now know how much free space the table will take up we can highlight it and paste in the table.

    Note: To hex workshop users: You can select a block of bytes from the coursor to an end postion using select block from the edit menu. This is usfull to select your data to then paste over. I don't know about other editors. They may have a similar option.

    Now that the table is in the new location we need to first tell Sappy where it is. Minimize the hex editor and make your way to the folder you keep Sappy in.
    Now locate a file named Sappy.xml and make a backup of it. Now open it with a hex editor or xml editor.

    This is Sappy's config file. All the locations of the song tables are kept here also along with the names Sappy gives to it's songs. were gonna start be searching for the header of our Rom. Sappy list it's infomation by the Roms header. Were useing FR so make a search for BPRE. if your useing a hex editor then you should see something like this:




    Can you see the circled area? Thats the location that Sappy looks for the song table. Now change that to the location of your new table. As you can see from the picture that i have already done it.
    Note: After doing this you can only use sappy with your modified rom. Thats why I said to make a backup of the .xml so you can swap them round.
    After you've replaced the offset save the changes and close Sappy.xml off.

    Now you have almost completed the first part. Check the results by opening the Rom in sappy and try to play a song. It should play corectly.
    Note the table offset has now changed to somwhere around your new offset.

    The last part is to tell the Rom where to find the new table. we've told Sappy were to find it but not the Rom so open the Rom in a hex editor.
    This is the part that confused me and caused damage to the Rom. Make a backup to be sure nothing can go wrong.

    Now we need to tell the Rom that our table has moved to a new place. To do this we need to find the location that points to the old table. We do this by searching for the offset of the old table in reverse hex. So search for CC324A08. Thats the pointer to the old table in reverse.

    You should come to this location:




    There are five pointers to the song table. The highlighted one is to be changed last. For some reason if you change it before then it crashes the titlescreen and editing it back does not fix it.

    Replace the other 4 pointers with your new pointer in reverse. To reverese a pointer is simple. 0x4A32CC becomes CC324A. you need to convert the pointer to your table into this format otherwise the Rom cant read it. This is one of the most important parts.
    After you have replaced the 4 pointers save and open your Rom with VBA. If it reaches the titlescreen without a problem then your good to go. If it didn't make it to the titlescreen then you went wrong somewhere and probably have to restart.

    If it worked for you then good. Now make a backup of your Rom because the next step could ruin everything. After you made a backup goto the power switch of your Computer and switch it off............. XD joking. We are now going to try changing that first pointer to the song table. If done last like this then it should work fine. Well it did for me. If it dos'nt then I can't help. Now test the rom again in VBA. If you reach the titlescreent hen you were sucsesful.

    Congratulations. You have just repointed the song table in a FR Rom. This step is required to proceed onto step 2. If you like you can go onto do step 2 now.



    2. Extending the song table and adding new songs.


    Lets begin with the structure again.
    Open your rom in a hex editor and goto the end of our new song table. This is where we make space for new songs to be added in. Put in about 2 lines of 0's.

    That will create space for new songs.

    Now open the Rom in Sappy and goto the last song, number 346: Teachy TV. Once there click over to song number 347 or just type 347 into the box. You will think nothing has changed but actully it has. Sappy was looking at those 0's you placed earlyer. As they are blank it said nothing. Were going to do something about that.

    Go back into the rom opened in a hex editor and return to the end of your table. Following the scructure of the table type in the offset of the last song into the next space. Like this:




    Now save and load up sappy. Goto song number 347 and play. It should be the teachy tv. Just to be sure that it worked open your rom in A-Map and change the muisc of a map to the Teachy tv. Note the number displayed to the left and add one to it. It is a hex number. Now test the map with VBA and it should be the teachy TV!.

    Congratulations. You have just extended the song table and inserted an extra song. Now all you have to do is insert some custom tracks to that space and............Oh. It replaces the teachy tv also. Sorry but were not quite finished. You probably didnt notice but try switching between song number 346 and 347. If you watch carfully you will notice that the only thing that changes is the table offset. That is because when you inserted the tracks over our new slot you wrote the header infomation onto the teachy tv's header. Thats because we copyed it. No worrys. Were going to go back into the Rom with a hex editor and create our own header for our song................XD joking. Were lucky that Sappy does this for us. All we have to do find 2 lots of free space. One load for the tracks of our song data. And another for the new header that Sappy will make for us.

    Now really open your Rom with a hex editor and find 2 lots of free space. You will need about 1 line for each songs header. Make a note of the offset your putting the header so you can insert other songs on the next line. Once you have your free space goto insert your tracks as normal over our new spot but make sure it looks something like the picture below:




    I wouldnt recommend assembling a song useing any new slots you create. For the simple reason of you not chooseing where the header is placed. Whereas if you insert tracks you can choose where it's placed. If your insert window looks like mine then insert the tracks. Now check the teachy tv to see if it still is the teachy tv lol. It should be still the teachy tv. Our new track should now be your inserted tracks. Just to double check open the rom with VBA again and see if the music changed from the teachy tv to your new tracks. Remember to change the music in the map header to our new track number.

    Congratulations. You have now completed the tutorial. You can add as many songs into your rom as you like useing this method. Just dont't forget to add in more 0's to the end of the song table.

    One quick note. As this is still in beta stages I have no idea if there are any after effects. I dought that there is and if you are a talented rom hacker then you should know this aswell.


    Hope this helps people.
    Link


    Credits: Me XD
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old October 21st, 2008 (9:23 PM).
    ~Teh Panda~'s Avatar
    ~Teh Panda~ ~Teh Panda~ is offline
    Sea of Dreams - Redux
    • Silver Tier
     
    Join Date: Aug 2007
    Posts: 906
    Great tutorial, I will def. use this!
    __________________




    Mystic still in work to let you know...
    Reply With Quote
      #3    
    Old October 22nd, 2008 (1:10 AM).
    linkandzelda's Avatar
    linkandzelda linkandzelda is offline
    n00b desu ka?
       
      Join Date: Dec 2006
      Location: Hastings, England
      Gender: Male
      Nature: Careful
      Posts: 775
      thanks dude. part 3 will come soon. making sappy and a-map show new names for our songs.

      link
      __________________
      Reply With Quote
        #4    
      Old October 22nd, 2008 (1:37 AM).
      Thrace's Avatar
      Thrace Thrace is offline
      @tion
      • Gold Tier
       
      Join Date: Jun 2007
      Age: 26
      Gender: Male
      Posts: 1,048
      Wow, nice tutorial LaZ :D

      Though I can't see myself needing this (I've never even opened Sappy before) I might have a go at this tomorrow.
      Mac emulation on XP is a bad idea.
      __________________
      Reply With Quote
        #5    
      Old October 22nd, 2008 (1:49 AM).
      linkandzelda's Avatar
      linkandzelda linkandzelda is offline
      n00b desu ka?
         
        Join Date: Dec 2006
        Location: Hastings, England
        Gender: Male
        Nature: Careful
        Posts: 775
        xd. thanks. its not mac emulation btw.... its the best mac theme for xp.
        __________________
        Reply With Quote
          #6    
        Old October 22nd, 2008 (4:35 AM).
        Darthatron's Avatar
        Darthatron Darthatron is offline
        巨大なトロール。
        • Silver Tier
         
        Join Date: Jan 2006
        Location: Melbourne, Australia
        Age: 25
        Gender: Male
        Nature: Modest
        Posts: 1,152
        Good to see a half decent guide. It's been a while.

        Whenever I start my hack again, I'll probably use this information.
        __________________
        あなた は しきしゃ です
        わたし は ばか です
        Reply With Quote
          #7    
        Old October 22nd, 2008 (3:39 PM).
        Zeikku™'s Avatar
        Zeikku™ Zeikku™ is offline
        Johto remaker
        • Silver Tier
         
        Join Date: Aug 2007
        Location: London, England
        Age: 25
        Gender: Male
        Nature: Naughty
        Posts: 1,118
        I managed to do this
        just proves hard work really pays of thanks Laz!
        __________________

        Follow me on Twitter by clicking on my signature.
        Reply With Quote
          #8    
        Old October 25th, 2008 (2:18 PM).
        Magnius Magnius is offline
        Pokemon Music Hacking Guru
           
          Join Date: Jul 2005
          Gender:
          Nature: Adamant
          Posts: 295
          Sweet, so now there's almost no point in overwriting music. This should certainly help Zel out in Shiny Gold(Now he can keep the Kanto themes without overwriting them).
          __________________
          Check out my original music on my youtube channel:
          http://www.youtube.com/user/MagniusKun?feature=mhee
          Reply With Quote
            #9    
          Old October 26th, 2008 (12:42 AM).
          ZodiacDaGreat's Avatar
          ZodiacDaGreat ZodiacDaGreat is offline
          Working on a Mobile System
             
            Join Date: Feb 2007
            Location: South Pacific
            Age: 24
            Gender: Male
            Nature: Relaxed
            Posts: 429
            Great News, I made something useful for repointing stuff. You can get it here or at my thread in the toolbox.

            To use just enter the offset from which you want to repoint and the lenght in HEX, then enter your new offset below... Bam... Table repointed.

            Enjoy
            __________________
            Reply With Quote
              #10    
            Old August 20th, 2009 (5:04 AM). Edited August 20th, 2009 by online-music.
            online-music online-music is offline
               
              Join Date: Aug 2009
              Gender: Male
              Posts: 1
              Thanks for sharing and providing in depth wonderful info
              Reply With Quote
                #11    
              Old August 26th, 2009 (10:11 PM).
              Chaos21 Chaos21 is offline
                 
                Join Date: Aug 2009
                Gender: Male
                Posts: 1
                it didn't quite work for me, even though I tried redoing it 3 times over, and then a really horrible thing happened and Hex Workshop didn't switch from my main file so now my rom is hosed ;A;
                Reply With Quote
                  #12    
                Old September 25th, 2009 (7:05 AM). Edited October 17th, 2009 by Jambo51.
                Jambo51's Avatar
                Jambo51 Jambo51 is offline
                Glory To Arstotzka
                   
                  Join Date: Jun 2009
                  Gender: Male
                  Nature: Quiet
                  Posts: 732
                  Fantastic. Worked perfectly after multiple tries (i made some silly errors haha).

                  I just have one note, if you're adding a new song and you overwrite an old pointer that you added and it's placed BEFORE the song table in the rom, the song WILL NOT play in game.

                  Like if song table is at 0x9D1000 and it points to a header at 0x850000, sappy will play the song, but it wont work in the game. But if the header is at 0xA50000 it works perfectly.

                  Another note, if you add extra songs, make sure you don't repoint them in a hex editor. It plays the song but there's a weird reverb effect if you do that.
                  Instead, when inserting the song, just change the header in sappy.

                  Would post pictures, but can't yet.

                  Perhaps you should add that into your tutorial, LinkandZelda.
                  __________________
                  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
                    #13    
                  Old October 7th, 2009 (11:24 PM).
                  Maxzeroedge's Avatar
                  Maxzeroedge Maxzeroedge is offline
                  Ready for simply anything
                     
                    Join Date: Jun 2009
                    Location: In my home?
                    Gender: Male
                    Nature: Relaxed
                    Posts: 49
                    Emm......Where can I find Sappy? I don't know what to search in google even....... *Hides*
                    __________________
                    Life is simply awesome
                    Reply With Quote
                      #14    
                    Old October 16th, 2009 (5:25 AM).
                    Halfshadow's Avatar
                    Halfshadow Halfshadow is offline
                    Sono italiano/I'm italian.
                       
                      Join Date: Sep 2008
                      Location: Lucca ITALY (Yes i'm of Lucca, the city of "Lucca comics and games" !)
                      Age: 28
                      Gender: Male
                      Nature: Docile
                      Posts: 56
                      Thank you very much, this guide was very helpful.
                      Reply With Quote
                        #15    
                      Old November 9th, 2009 (12:16 AM).
                      nemoma nemoma is offline
                         
                        Join Date: Jun 2008
                        Gender:
                        Posts: 9
                        Is this my problem or something is wrong?
                        This ROM I have has its copyright image (the 1st screen when you opened the ROM where it says Copyright Nintendo and else) changed into other stuff. So when rewritting the song table offsets it will never reach the titlescreen , anything before the title screen still works, though (referring to Gengar Vs Nidoran)

                        PS: 900000 did translate as 000090, right?
                        Reply With Quote
                          #16    
                        Old November 9th, 2009 (12:58 PM).
                        Pokepal17's Avatar
                        Pokepal17 Pokepal17 is offline
                        More cowbell~
                        • Silver Tier
                         
                        Join Date: Oct 2008
                        Location: Steeltown
                        Age: 22
                        Gender: Male
                        Nature: Modest
                        Posts: 1,511
                        Quote:
                        Originally Posted by nemoma View Post
                        Is this my problem or something is wrong?
                        This ROM I have has its copyright image (the 1st screen when you opened the ROM where it says Copyright Nintendo and else) changed into other stuff. So when rewritting the song table offsets it will never reach the titlescreen , anything before the title screen still works, though (referring to Gengar Vs Nidoran)

                        PS: 900000 did translate as 000090, right?
                        Your rom crashed. So try again, and read the tutorial carefull. BTW, 0x900000 would be 00009008

                        The 08 means it will point into the first 16mb of thr ROM.
                        __________________
                        Pokémon Stardrop
                        Reply With Quote
                          #17    
                        Old November 9th, 2009 (2:35 PM).
                        Liquid Shadow's Avatar
                        Liquid Shadow Liquid Shadow is offline
                        xD
                           
                          Join Date: Mar 2008
                          Gender:
                          Posts: 223
                          Quote:
                          Originally Posted by nemoma View Post
                          Is this my problem or something is wrong?
                          This ROM I have has its copyright image (the 1st screen when you opened the ROM where it says Copyright Nintendo and else) changed into other stuff. So when rewritting the song table offsets it will never reach the titlescreen , anything before the title screen still works, though (referring to Gengar Vs Nidoran)

                          PS: 900000 did translate as 000090, right?
                          You must have messed up somewhere (this happened to me like twice and I found some silly errors such as not repointing at the right offsets).
                          __________________

                          4 truths of life
                          1. You cannot touch all your teeth with your tongue.
                          2. All idiots, after reading the first truth, will try it.
                          3. And discover that the first truth is a lie.
                          4. You're smiling now because you're an idiot.
                          Reply With Quote
                            #18    
                          Old November 9th, 2009 (3:37 PM).
                          nemoma nemoma is offline
                             
                            Join Date: Jun 2008
                            Gender:
                            Posts: 9
                            Yeah I was able to solve the problem when typing 00009008 instead of 000090.
                            Thanks.

                            Also, I'd like to mention something important.

                            When modifying the values in ROM via HEX Editor, make sure Sappy or VBA is not loading the same ROM it's editing, or it WILL fail, no matter your actions are correct or not.

                            For the easiest way, just close both programs.
                            Reply With Quote
                              #19    
                            Old December 5th, 2009 (7:27 PM).
                            NoriakiZ's Avatar
                            NoriakiZ NoriakiZ is offline
                            Rookie
                               
                              Join Date: Jul 2008
                              Nature: Timid
                              Posts: 18
                              For some reason, Hex WS is only showing 2 numbers at a time. Are you using a different setting or something? Using the newest version of Hex WS.

                              I really hate being a n00b.
                              __________________
                              Spoiler:



                              Reply With Quote
                                #20    
                              Old December 6th, 2009 (11:01 AM).
                              omegazeroINFI's Avatar
                              omegazeroINFI omegazeroINFI is offline
                                 
                                Join Date: Sep 2009
                                Gender: Male
                                Posts: 19
                                i need help, i have a vista and cant use sappy, anytips or alternate ways?
                                __________________
                                私は救世主午前!HAHAHAHA...

                                i need some scripthelp, music help, and some images editing help. because one. i have vista. two. dont have photoshop and gimp doesnt seem to work.
                                three. because i got imagination. four. i can do pretty much everything else cept pallette editing.
                                Reply With Quote
                                  #21    
                                Old December 16th, 2009 (2:30 AM).
                                Incineroar's Avatar
                                Incineroar Incineroar is offline
                                the spirit of the fighter
                                • Moderator
                                • Platinum Tier
                                • Developer
                                 
                                Join Date: May 2009
                                Location: Iki Town
                                Age: 22
                                Gender: Male
                                Nature: Brave
                                Posts: 13,446
                                Quote:
                                Originally Posted by omegazeroINFI View Post
                                i need help, i have a vista and cant use sappy, anytips or alternate ways?
                                No, unfortunately. I have it harder, though. I run Windows 7, and it never works. I have to use it on Virtual XP and the sound lags horribly.


                                This tutorial could come in handy for people. But, I have a question: What happens to the space of data after you move the song header to its new position? Does it have to stay there, or can it be overwritten?
                                __________________
                                Reply With Quote
                                  #22    
                                Old December 17th, 2009 (10:39 AM).
                                linkandzelda's Avatar
                                linkandzelda linkandzelda is offline
                                n00b desu ka?
                                   
                                  Join Date: Dec 2006
                                  Location: Hastings, England
                                  Gender: Male
                                  Nature: Careful
                                  Posts: 775
                                  Quote:
                                  Originally Posted by Team Fail View Post
                                  No, unfortunately. I have it harder, though. I run Windows 7, and it never works. I have to use it on Virtual XP and the sound lags horribly.


                                  This tutorial could come in handy for people. But, I have a question: What happens to the space of data after you move the song header to its new position? Does it have to stay there, or can it be overwritten?
                                  Well once you point to the new table the old table can be deleted yes. Oh and btw, you can use sappy on vista/7 but just not the 2006 version. The 2005 version works fine on them. it just dosnt look as good as 2006.

                                  link
                                  __________________
                                  Reply With Quote
                                    #23    
                                  Old February 1st, 2010 (1:38 PM).
                                  Omega Zero's Avatar
                                  Omega Zero Omega Zero is offline
                                  Is back...
                                  • Gold Tier
                                   
                                  Join Date: Dec 2009
                                  Location: I'm always living aren't I?
                                  Age: 19
                                  Gender: Male
                                  Nature: Relaxed
                                  Posts: 445
                                  Wow this is neat and useful.. i'm gonna try this some time and ask for help on msn from you as well this will certainly help me in my up coming hack :3
                                  __________________
                                  Reply With Quote
                                    #24    
                                  Old March 31st, 2010 (12:15 PM).
                                  abood321 abood321 is offline
                                  Banned
                                     
                                    Join Date: Jul 2009
                                    Gender: Male
                                    Posts: 62
                                    how to make sappy 2006 work on windows 7?
                                    It doesn't open any rom, it says 'sappy 2006 has stopped working'.
                                    Reply With Quote
                                      #25    
                                    Old February 18th, 2011 (3:09 AM).
                                    gamesharkhacker's Avatar
                                    gamesharkhacker gamesharkhacker is offline
                                    SupremoHack Entertainment Inc.
                                       
                                      Join Date: Jun 2009
                                      Location: In a massive hole :)
                                      Gender: Male
                                      Nature: Careful
                                      Posts: 47
                                      Nice tut dude. This could be really helpful to me in the near future.
                                      Keep it coming.
                                      Thanks, GSH.
                                      __________________
                                      I'm BACK!!!!

                                      GSH - Owner and Creator of
                                      Pokemon PoisonedPyrite/ParalysisPyrite



                                      GSH - Music creator/hacker of
                                      Pokemon Morganite
                                      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

                                      Forum Jump


                                      All times are GMT -8. The time now is 3:42 AM.