How to change the Music in PhoenixWright ?

Discussion in 'NDS - ROM Hacking and Translations' started by kawlex, Mar 16, 2007.

  1. kawlex

    kawlex Member

    Nov 21, 2006
    Gambia, The
    Hi there,

    some time ago I read something about changing the cross examination music in PW Justice for All
    into the old one.

    Can someone tell me how to do so? : )

    I hate this new song,
    the old one rocked! [​IMG]
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    Apologies if you are familiar with hex editing already and I come off badly, I try and post this sort of thing so others who may not be quite so familiar can use it.

    You will need to deconstuct the DS file back into the individual components to get the soundfile, there are a couple of ways to do this but I favour ndstool and some batch files. I will copy and paste here if you prefer but this thread has all the info:

    Once you get the rom disassembled you will have to get the sound file, I can not remember exactly what it was called but sound_data.sdat is the standard name.

    You will then need a hex editor, XVII32 is a good freeware one and x-ways forensics winhex is another nicer apayware one:

    The sound files of DS games go as follows (I will only list the stuff you are interested in for this hack)
    Start of file (bytes 8 through 12 are the length of the file if you do 32bit byte flip)
    Next is a list of names in ASCII, copy this into another file, replace the 00's with 0d0a and save as {name}.txt
    Search for FAT (in ASCII) or alternatively flip bytes 20 (hex) through 24 (hex) with a 32bit flip and you will come up with a list of hex numbers. These are the locations in the file of all the subfiles and the individual file lengths (they are not the same as the differences between offsets), these correspond to the list you just saved. Once again you will need to flip them. Check the results out against the original file (you will probably get a couple of ASCII characters like SSEQ or SWAR).

    Alter these numbers as you would a standard pointer system (I made an example file a couple of months back where tetris DS (Euro release) sounds were made to be the classic tetris music always rather than a few select levels if you are interested: ).

    If you add files from another game make sure to change the file length at the start, this should not require it though as the sounds in question should already be in there (they are used in flashbacks).

    Hope this is useful.
  3. Sevael

    Sevael GBAtemp Regular

    Feb 16, 2003
    I can save you about six hours' worth of time. I've already done this for the Japanese version, Gyakuten Saiban 2 (which has the full English text and voices, so it's fully playable by English speakers). You can download the modified sound_data.sdat file for it here.

    Just use NDSTool to replace the sound_data.sdat file in the Gyakuten Saiban 2 rom, then recompile the rom and you're good to go.

  4. kawlex

    kawlex Member

    Nov 21, 2006
    Gambia, The
    I didnt thought that this would take so long. [​IMG]
    So thx for the tutorial,
    but i think i will use Sevaels Version.
    Thx to you guys.