Thread: [Tutorial] Music Hacking WITHOUT Sappy
View Single Post
  #1    
Old February 2nd, 2011 (11:04 PM). Edited February 4th, 2011 by timaeus222.
timaeus222's Avatar
timaeus222
MegaMan/Pokemon ROM Hacker
 
Join Date: Aug 2010
Gender: Male
Nature: Relaxed
For those who do not have the capability of opening Sappy, here is a guide to hack music in any GBA game without Sappy. Those who cannot use it are:

- Windows Non-XP Users
- MAC users

Materials:
HxD(easily google-able)
Visualboy Advance(easily google-able)
FireRed ROM or some other ROM to import music FROM
ROM to import music INTO

Quote:
Originally Posted by Offsets people can use
FireRed Title Song is first offset in 32-bit at: 084A3B7C
Emerald Title Song is first offset in 32-bit at: 086B56D8
The above offsets are how I like to test songs if I don't know where a song is and I need to find it. Each song has its own Voicegroup.

Open HxD and your soon-to-be-hacked GBA rom in it. In this guide I will use FireRed.

Open that same GBA rom (in this guide, FireRed) in VisualBoy Advance. When it reaches the title screen, go to Tools > Memory Viewer and view in 32-bit. Go to 084A3B7C. Right here is the list of songs in the game. Sort of. It's where the title screen song is, so you can replace that offset temporarily to figure out which offset is which song. Actual songs are generally longer than 100(hex) bytes.

Once you find what you want, go there. Afterwards I will mention a header. By that, I mean something like:



If you don't see an image it showed:
B200000A 08491990 086C4B10 086C4BEF
086C4CD6 086C4EB7 086C50E3 086C52F9
086C5594 086C57A8 086C59BD 086C5AC3

Copy from the beginning of the FIRST channel's offset to the END of the header. Remember, it goes "amount of instruments", voicegroup, channels A-Z.

Open a new file in HxD with Ctrl+N. Paste with Ctrl+B(get into the habit of Ctrl+B when using HxD; Ctrl+V at the wrong times can insert bytes and corrupt the rom; Ctrl+B is just overwrite instead of insert).

Don't save it, we'll use it later anyway. It's probably called Untitled-1. REMEMBER THIS FOR LATER!

Next up, making the song audible. In the same file, Untitled-1, start by replacing the voicegroup with the new one. EX: If FireRed, replace it with the voicegroup of your choice; it's up to you what instruments you want to use for your song. For example, in the title screen song it is 08491990.

Go to a spot where you want your new song to be, in your game. I;d suggest you label it or make a note (in HxD it is 31 for 1, 41 for A, 21 for "!", A0 for a blank space), but you don't have to. If you do, maybe put something like, "NEW ELITE FOUR SONG HERE!". Next, select all of Untitled-1 with Ctrl+A and copy with Ctrl+C. Paste it in the new game in a blank spot (Ctrl+B).

Afterwards, compare the channel offsets from your game with the ones from the game you're importing from. In this guide, FireRed. What you do is open Calculator, go to scientific mode, and then find the difference between the first channel offset in FireRed and the first channel offset in the new game. Write down the difference because you'll reuse it for a while. Then, add that difference to the second channel's offset for the song you're importing into the new game. Repeat until you edited all the pointers.

A (fake) example:

Emerald offset: 08578339
FireRed offset: 08930294

08930294 - 08578339 = 3B7F5B

From FireRed to Emerald, subtract 3B7F5B. From Emerald to FireRed, add 3B7F5B. Remember to subtract with your calculator in hex mode.



Then, use Ctrl+F in HxD to find all the B2's at the end of each channel you pasted in(within the new game!), and use "the difference you found between offsets" from earlier and change the pointer offsets. ALL of them. Be sure to be very careful on this. Making mistakes is hard to spot, unless you're willing to use HxD's File Compare and you have a sharp eye. After you're done, continue reading.

...REPEAT THIS! Do the same for all B3's within the channels you pasted in(within the new game!). Yes, tedious work. That is why we have Sappy. But if we can't use it(i.e. all MAC users/all non XP users), this will help a lot.

Now that the hard work is done, the fun work is coming up! Although some people might have known this, I doubt anyone's ever tried since this community's so used to using Sappy. Here is a basic format in instrument swapping.

Quote:
Originally Posted by Instrument Swapping
BC VV BB WW BD XX BE YY BF ZZ
VV = Pitch increment
WW = Speed measurement
XX = choice of instrument
YY = Volume
ZZ = Panning(which speaker is it playing out of? What percent?)
Quote:
Originally Posted by Basic Commands/Values
B1 = Ends Song
B2 = Loops song using the upcoming offset
B3 = Jumps to another part of the song, but continues the song there.
B4 = Return to last 0xB3 command.
BB = Set Tempo
BC = Set Pitch offset
BD = Set instrument
BE = Set Volume
BF = Set Panning
CF - 0xFF = Play notes of varying lengths.
Once you're done, save of course. But how do we test it? How do we draw from the new offset? What we talked about at the beginning, except you now need the new offset for the new game. So if you're using FireRed, this is the (real) offset for the song list:

084A3B04

Otherwise, simply search for the offset using HxD. What you do is type this into the Ctrl+F box in HxD:

Quote:
Originally Posted by Values in 8-bit
BC 00 BB*

*Depending on the game, trying BC 00 BB may not always work, but it's reliable. If you're playing Fire Emblem, careful. Search for BC 00 BB that is followed by an XX BD YY set. There are copies of BC 00 BB that aren't part of the beginning of a channel, unlike how it usually is.
Stop when you find the spot where you see:

Quote:
BC 00 BB 46 BD 3C C2 2C C1 0C BF 60 BE 43*

*Could be this or something similar
Then, take the offset you get when you put the text cursor right before BC, like this:

Quote:
|BC VV BB

| = cursor
The offset is at the lower left of HxD, minus the 08 at the beginning. When you go to that offset you should see the pattern of offset, 4 byte separation, offset, 4 byte separation on each line. That is where the list of songs is for that game. An example:



If you can't see the image, it showed:

8-bit:
02 00 02 00 28 D6 6B 08 02 00 02 00 98 DB 6B 08

32-bit:
00020002 086BD628 00020002 086BDB98

Then just replace the correct offset with the offset that leads to the new song's header, aka where B200000A or similar starts. You wrote that down earlier.

Use the trick I mentioned at the beginning to figure out which song is which.

Now, you're done! :D Thanks for reading.

Copyright (c) Timaeus, All Rights Reserved.
Only for PokeCommunity, MPCR, and TREZ.

---------

If anyone needs more pictures, ask me and I will make those screenshots.
If anyone has any questions, feel free to ask them.
__________________
~Timaeus.EXE

http://m-pcr.co.cc/
http://youtube.com/timaeus22222

Working on FireRed eXtreme Patch [hard mode with tile edits and extras]

Reply With Quote