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

TrollandToad.com
Closed Thread
 
Thread Tools
  #1    
Old June 26th, 2013 (9:24 AM). Edited August 16th, 2013 by xGal.
xGal xGal is offline
Mhm
     
    Join Date: Nov 2011
    Location: A tree
    Gender: Other
    Nature: Relaxed
    Posts: 243
    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:
                Teachy TV
    .

    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:
                 New Song W00T!
    .

    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
    __________________

    Relevant Advertising!

      #2    
    Old June 28th, 2013 (11:57 PM).
    阴魂君's Avatar
    阴魂君 阴魂君 is offline
    _(:зゝ∠)_ so busy i am…
       
      Join Date: Nov 2012
      Location: China
      Age: 21
      Gender: Male
      Nature: Brave
      Posts: 22
      wow..amazing!I just knew changing the song in the past,can i translate it to Chinese and reprint it to a Chinese forum?
        #3    
      Old June 29th, 2013 (12:37 AM). Edited June 29th, 2013 by xGal.
      xGal xGal is offline
      Mhm
         
        Join Date: Nov 2011
        Location: A tree
        Gender: Other
        Nature: Relaxed
        Posts: 243
        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)
        __________________
          #4    
        Old July 3rd, 2013 (1:41 PM).
        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,525
        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?
        __________________
          #5    
        Old July 3rd, 2013 (11:56 PM).
        Flandre Scarlet's Avatar
        Flandre Scarlet Flandre Scarlet is offline
        Free your mind.
        • Gold Tier
         
        Join Date: Feb 2008
        Location: Australia
        Age: 21
        Gender: Male
        Nature: Adamant
        Posts: 355
        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.
        __________________
          #6    
        Old July 4th, 2013 (3:00 AM). Edited July 4th, 2013 by xGal.
        xGal xGal is offline
        Mhm
           
          Join Date: Nov 2011
          Location: A tree
          Gender: Other
          Nature: Relaxed
          Posts: 243
          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.
          __________________
            #7    
          Old August 14th, 2013 (6:01 PM).
          xGal xGal is offline
          Mhm
             
            Join Date: Nov 2011
            Location: A tree
            Gender: Other
            Nature: Relaxed
            Posts: 243
            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
            __________________
              #8    
            Old March 25th, 2014 (11:27 AM).
            Chaos_Darkrai's Avatar
            Chaos_Darkrai Chaos_Darkrai is offline
               
              Join Date: Apr 2012
              Gender: Male
              Posts: 284
              Great, but if we want to insert Tracks, ripped from another game, what do we change?
              __________________
              ░░░░░███████ ]▄▄▄▄▄▄▄▄
              ▂▄▅█████████▅▄▃▂
              Il███████████████████].
              ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤..

              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.net&channel=%23Dragons_Den

                #9    
              Old June 17th, 2014 (2:47 PM).
              karatekid552's Avatar
              karatekid552 karatekid552 is offline
              What happens if I push it?....
                 
                Join Date: Nov 2012
                Location: Do you really want to know? Really?
                Gender: Male
                Nature: Bold
                Posts: 1,766
                Closed at owner's request for a new thread where he will revise the tutorial and make it better.

                ~karatekid552
                __________________

                Paired with Simba
                Closed Thread

                Quick Reply

                Join the conversation!

                Create an account to post a reply in this thread, participate in other discussions, and more!

                Create a PokéCommunity Account

                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 2:07 AM.