[ Home ] :: [ Utilities ] :: [ Sonic 2 MP3 Tool ] :: [ S2AST Downloads ]

Welcome to this small corner of the SRZ, where I provide information and utilities that help you edit music in Sonic 2, as well as the latest version of my ROM hack, Sonic2 Alternative Soundtrack and Music Porter, a program that ports music from Sonic 2 Beta to Sonic 2 Final.

Updates
New Revision of the Sonic QX manual released! Check the utilities page!
Sonic QX Build 15 is now avaliable at the utilities page!
Music Porter v1.0 released! Now with a Windows Interface! *NOW FIXED* - A library problem stopped this working on system's other than mine.
Voicexhg.txt guide added to the utilities page.
Currently, Sonic Music editing isn't as common as graphics or level editing, however it's popularity is increasing since the release of Sonic QX, a fully fledged music editor written by Damian Grove, a.k.a. Saxman.

Sonic QX however, isn't perfect, and can only edit music in the Sonic 2 Beta rom. What I really wanted to do next however was to replace the entire soundtrack to the final Sonic 2 with my own score, which meant I somehow had to port the music from Sonic 2 Beta to the Final. This is my progress so far.

After posting a message on the Sonic 2 beta messageboard, I was told by Hivebrain that I had to port offset 0EC000 to 0FFFFF from the BETA to the Final. He commented that it said this in Saxman's Sonic 2 Hacking Guide...

   "Music is a great interest to many people. This is one of the difficult areas of the Sonic 2 ROM. The reason is due to the compression used. This doesn't mean that you can't put your own midis into Sonic 2, but you will need to port the Sonic 2 beta music into the ROM instead since that doesn't use compression. So, to port the Sonic 2 beta music into the final ROM, simply copy everything from 0EC000 to 0FFFFF. Once this information is put into the final ROM, you can begin modifying the music"

So I downloaded Hex Workshop (which .hack//zero had suggested using) and tried copying the data across. And it worked!
Well sort of... Emerald Hill, Hill Top, and Metropolis all crashed when you selected them in the level select.
Hivebrain had also pointed out that copying the data would cause some compressed graphics to be overwritten, so this is what had caused the problem. To fix it he suggested that pointers from the palette load cues should be removed. At the time I didn't understand what this meant, so I blagged my way through and simply used Nemesis' guide to find that the overwritten data was between F0160 and F1E06.
With this info I simply copied that block from the Beta to the Final. And this time Emerald Hill worked, but the Intro and End of Act music had been corrupted.
The next thing I did was work out the lengths of the bits of art replaced, simply by decompressing them with nemdec (one with enidec) and noting the "Compressed Size" number down. Below are my results:

Offset  Size in Bytes
0F0160: 375
0F02D6: 263
0F03DC: 334
0F052A: 216
0F0602: 757
0F08F6: 120
0F096E: 409
0F0B06: 271
0F0C14: 311
0F0D4A: 109
0F0DB6: 1113
0F120E: 169
0F12B6: 206
0F1384: 266
0F148E: 194
0F1550: 118
0F15C6: 183
0F167C: 112
0F16EC: 162
0F178E: 226
0F1870: 12
(Enigma) 0F187E: 327
0F1ABA: 426
0F1C64: 249
0F1D5C: 249
I then wrote a small program to copy the music region and then replace only these bits of art, hoping it wouldn't effect the music quite so much, but it yeilded the same results.
The next plan is to either move the graphics to another place in the ROM and edit the game to look there, or compress
the Music from Sonic 2 beta to fit into the space.

If I wanted to edit the game to look somewhere else I would have to modify the palette load cues, which are quite hard to understand, and Nemesis' guide (in my opinion) doesn't explain it too well. Anyhow, I've had an attempt at explaining it myself below:
Let's use this HTZ Palette Load Cue as an example:
4289A: 0009 000F 0160 73C0 000F 0C14 7640 000F 096E

With Highlighting:
4289A: 0009 000F 0160 73C0 000F 0C14 7640 000F 096E
Blue = Palette Load Cue Offset (which you typed in Edit/Goto)
Red = Number of Objects in Hex

Green = 0F0160 :: This looks like an offset, and it is! Matches this entry in Nemesis' Address Listing:
F0160 - Fireball from EHZ - Art compression 20 blocks

Orange = 0F0C14 :: Another object! Matches this entry:
F0C14 - Rock from HTZ - Art compression 20 blocks

Yellow = You get the idea...

Anyhow, now I understand the format I have added this feature to Music Porter! So it's now avaliable for download!
Like this tune? Download it in high quality here!
Website and Music Copyright (c) James Hansen / QJimbo
Note, some music in s2ast is not replaced and is still copyrighted by Dreams Come True (who did an amazing job)