Question about sound hacking

Discussion in 'NDS - ROM Hacking and Translations' started by Sevael, Oct 30, 2006.

Oct 30, 2006

Question about sound hacking by Sevael at 7:01 AM (2,664 Views / 0 Likes) 22 replies

  1. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    Hi all,

    I'm currently in the process of replacing some of the music in Gyakuten Saiban 2 (Phoenix Wright 2) with some of the tunes from the first game. (The first one had much better music, IMO.)

    Anyways, I have successfully replaced a few tunes and they work 100% perfectly when the recompiled rom is run on a flash cart. However, the only ones I could replace were the same size in each game, or were smaller in the source game (GS1) and padded with zeros to fill the gap in the sound_data.sdat file. This was all done in a hex editor, of course.

    My question is, is there any way to find and change the pointers that indicate where in the sound_data.sdat file the game looks up the music? Reason I ask is that I want to replace some tunes that are smaller in GS2. I can't just put in the entire track from GS1, as it would offset every following track, and the game crashes when trying to look up those tracks and they are not where the game code points to in the sound_data.sdat file.

    So, is it even possible to hex edit one of the files to change the pointers? I don't mind doing the work, as I love the music in GS1 and am not at all fond of the remixed music in GS2. The few tracks I have already replaced make a huge difference in enjoyability for me, so I'd like to go to the trouble to doing more. Unfortunately, the ones I have left are all larger in GS1 than GS2, which would cause the above-mentioned offset in the sound data file.

    Any advice or ideas? Thanks in advance.
     


  2. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    Wow, don't I feel silly. [​IMG] After that long-winded post, I found some pointers near the beginning of the sound_data.sdat file itself. I'm going to play around with this and see if I can get it all working with longer tracks inserted.

    Does anybody have any input on this? Will increasing the overall size of the sound_data.dat file cause any issues? Do I have to worry about checksums or anything else like that?
     
  3. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,738
    Country:
    United Kingdom
    I was going to start just such a project this evening (it was going to be an example for my GBA/DS rom hacking docs), seeing hacks (especially DS ones and especially sound hacks) is always good though and I wish you the best of luck.

    Unfortunately there exists no sound recompiler like NDSTool does for DS roms so you are in for a fun time with your hex editor. Length of soundfiles should not matter for most games (see all the early rom rips during the loadme/ndspatcher days where soundfiles were replaced) and even then I have simply chopped off the end of the file on problem roms (Animal crossing mainly) without issue.

    As for checksums the only ones I am aware of are the CRC16 of the header (as well as the usual GBA logo buisness), none of which are going to affect you here.
     
  4. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    Thanks for the feedback.

    I replaced a total of about 8 tracks in GS2, and am currently crawling through the sound_data.sdat file updating the pointers. I've spent the last 2.5 hours on it and am about 10% of the way through it. It's very tedious, but it will be worth it when it's done. My only fear is that after all this work, I'll have missed or miscalculated one offset, which would screw up the entire file. [​IMG]

    But yes, it would be nice if a recompliler existed. Since this is something I can do fairly quickly and easily on my own, this would be extremely simple for an .exe file to do. All it would have to do is to put all the files back together in the order specified in the .smap file and just update the address for the beginning of each file in the table at the beginning of the sound_data.sdat file. I wish I knew some programming, I'd make it myself....
     
  5. kelvinate

    Member kelvinate GBAtemp Regular

    Joined:
    Nov 22, 2005
    Messages:
    172
    Location:
    Sydney Australia
    Country:
    Australia
    if you would like another project after your done with that you could rip the music from the children of mana.
     
  6. Harsky

    Member Harsky Madmin

    Joined:
    Aug 2, 2004
    Messages:
    5,263
    Country:
    United Kingdom
    I bid you good luck with this. I like Phoenix Wright 2 but the music doesn't hold the same tension as the first one.
     
  7. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    Looks like it was a success. Over four hours worth of work! [​IMG] Would have taken two seconds with a proper compliler though.... [​IMG]

    I haven't played far enough to get to any parts with the swapped tracks, but the existing tracks still work just fine. I'll post another message in this thread once I've gotten back into court and objected to some testimonies. I'm currently on the third case, pre-trial.
     
  8. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    Sorry, I'm not really looking for additional work. You can easily do it yourself though, it's pretty simple. Check out some of FAST6191's past posts on the subject and you'll find a link to some tools you can use to extract the music and convert it to midi files.
     
  9. Harsky

    Member Harsky Madmin

    Joined:
    Aug 2, 2004
    Messages:
    5,263
    Country:
    United Kingdom
    I could test it for you.... *nudge nudge wink wink*
     
  10. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    If I find out that it's working properly, I will put the sound_data.sdat file up somewhere for download. Probably won't be today though, I'm really pressed for time.
     
  11. Mucuna

    Member Mucuna GBAtemp Fan

    Joined:
    Jul 28, 2006
    Messages:
    363
    Location:
    Rio de Janeiro, Brazil
    Country:
    Brazil
    It's not NDS, but I will change the music of DBZ Tenkaichi 2 to the japanese version. Much better hearing the anime original music during the game!
     
  12. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    I was actually thinking about doing the same thing. Are you going to be updating the US version, or the European one?

    If you get it done, please do us the favor of posting a list of instructions as to exactly how you did it once you've got it working. I already have the Japanese version and don't mind it at all, but my buddies don't know any Japanese and don't like the English version of the show/games.
     
  13. Mucuna

    Member Mucuna GBAtemp Fan

    Joined:
    Jul 28, 2006
    Messages:
    363
    Location:
    Rio de Janeiro, Brazil
    Country:
    Brazil
    Sure!

    I've the european version. Gonna have the japanese on wednesday, so I start the thing. Hope it will be simple.

    The only thing in english that I want in the game is the text. The musics and voices, in japanese.:-)
     
  14. Elrinth

    Member Elrinth :Master beyond your imagination:

    Joined:
    Nov 6, 2002
    Messages:
    2,795
    Location:
    Home @ UMEÅ
    Country:
    Sweden
    but.. pheonix wright 2 for nds isn't out yet... in english language.. is it? or does the japanese version include english? :wtf:
     
  15. Mucuna

    Member Mucuna GBAtemp Fan

    Joined:
    Jul 28, 2006
    Messages:
    363
    Location:
    Rio de Janeiro, Brazil
    Country:
    Brazil

    Yeah, tha japanese version includes english. Before the game starts, choose english clicking in the bottom retangule. [​IMG]
     
  16. Elrinth

    Member Elrinth :Master beyond your imagination:

    Joined:
    Nov 6, 2002
    Messages:
    2,795
    Location:
    Home @ UMEÅ
    Country:
    Sweden
    oooooooooooooooo... [​IMG] Then I need to get this! [​IMG]
     
  17. Harsky

    Member Harsky Madmin

    Joined:
    Aug 2, 2004
    Messages:
    5,263
    Country:
    United Kingdom
    What's the news on the Phoenix Wright project?
     
  18. Sevael
    OP

    Member Sevael GBAtemp Regular

    Joined:
    Feb 16, 2003
    Messages:
    144
    Country:
    Canada
    Sorry, been busy as of late.

    It appears to be working perfectly. Great to have the original tunes back.

    I'll gladly upload the sound_data.sdat file for others to use. What is a good hosting site for files such as that?
     
  19. Harsky

    Member Harsky Madmin

    Joined:
    Aug 2, 2004
    Messages:
    5,263
    Country:
    United Kingdom
    rapidshare.de
    www.megaupload.com
     
  20. Harsky

    Member Harsky Madmin

    Joined:
    Aug 2, 2004
    Messages:
    5,263
    Country:
    United Kingdom
    Bumping this....
     

Share This Page