Adding Titles to Custom Sound Engine Music: Manual Tutorial

For clarification, the following is a guide on getting Music Titles to appear for music added with Dantarion's Custom Sound Engine code. By "Music Title" I mean the name of the song that appears on the top-left of the screen when a battle starts. This guide will not modify anything on My Music, to avoid corrupting Save Files. As far as I have tested, this guide does not corrupt save files. Occasionally, I run Vanilla Brawl and mess with My Music to make sure nothing's messing up. Nothing has yet, but if you are worried back up your save beforehand. This method has only been tested on the US (RSBE) version of the game, and is not guaranteed to work in other regions.

This is the manual  method of inserting Song Title slots. For the purpose of this tutorial, I am going to assume that you are comfortable using both Brawlbox and a Hex Editor of your choice. But trust me, this is pretty simple.

Step 1: Preparation
First, acquire two fresh copies of info.pac and common2.pac. I assume you know where to acquire these files. Now, open Common2.pac in Brawlbox, and export MiscData[13] to a file. Then, open MiscData[13] in your Hex Editor.

Select the block from 0xB0 to 0xDF. Copy and paste this data onto a new file and save it. This is the slot data for the song "Battlefield" on Battlefield. We'll be using it as a template for our own slots, as its settings seem to work fine for me.

Now, select the block from 0x31D0 to 0x3217 (assuming you're starting from a fresh MiscData[13]). Copy and paste this data onto a new file and save it. This data contains the footer of the file, which will be pasted back on after we make our changes, so you can delete this block after saving it to file.

Step 2: Adding Title Slots
First, open the file containing "Battlefield"'s data if it is not still open. We're going to make some changes. Replace the first four bytes ($000026FC) with the name of the song that you want to add a Title Slot for. For example: 0000C010.BRSTM is the first song for my first Stage Expansion slot, so I would put $0000C010 as the first four bytes.

Then, jump to 0x10. Replace these next four bytes ($000000C7) with the slot ID you want to give the song title. This is the line number that will be read from info.pac. The last slot used is $00000108 for "The Hidden Village", so use $00000109 for this with each consecutive slot added going further up in this fashion.

Now, copy the entire file and paste it onto the end of MiscData[13] (assuming you deleted the footer). There you go. You just added a Title Slot! Now repeat this step for any other tracks that you want to add Title Slots for, but keep track of which line number links to which track.

Step 3: Finishing MiscData[13]
Now that you have all of your desired slots, we just need to clean up MiscData[13] a bit. First, paste the footer back onto the end of the file. We don't need to change anything on it, thankfully.

Go back to the start of the file (0x0). The first four bytes ($00003218) need to be changed. They represent the total filesize, so figure that out and replace the value. The second four bytes represent the size of the slot data. For simplicity's sake, the value always ends up being (filesize - $38).

Save and close MiscData[13]. Now, reimport it back into Common2.pac. I am not too certain about Common2.pac's size limit, but you can set it's compression from LZ77 to ExtendedLZ77 to reduce its filesize and keep it working on Gecko, which is much more picky than Riivolution.

Step 4: Adding Titles
Open info.pac in Brawlbox and go to MiscData[140]. Hit the + button to add a new line. This new line is ID $0109, the slot we added in MiscData[13]. Now, type in the title of the track you assigned to slot $0109. Keep adding lines until you have a title for every slot you added. Set info.pac's compression from LZ77 to ExtendedLZ77 to reduce filesize, and you're done! See? I told you this was simple!

Place info.pac in /pf/info2/ and Common2.pac in /pf/system/. If you are using Riivolution, don't forget to name the files info_en.pac and Common2_en.pac. I heard that previous File Replacement Codes have trouble replacing Common2, so I suggest using the File Patch Code v3.5.1b if you use Gecko (you should already have this if you are using BrawlEx).

No comments:

Post a Comment