Actions

Music Pointer Fixer

From Sonic Retro

Revision as of 19:01, 3 September 2007 by Scarred Sun (talk | contribs) (New page: The '''Music Pointer Fixer''' by ErikJS helps music porting between two Sonic games by fixing pointers from coordination flags. Furthermore, voice conversion is possible if you're deal...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Music Pointer Fixer by ErikJS helps music porting between two Sonic games by fixing pointers from coordination flags. Furthermore, voice conversion is possible if you're dealing with S2 format, as well as having a Ristar song ready to be put in S1 (though you'll need to fix PSG and other things on your own, header and coordination flags will be arranged to work within S1 engine).


First, you need to have a copy of the desired music as a bin or dat file and open it on the program. You can get music locations at: SCHG:Music Hacking.

Next, you'll need to choose which kind of conversion you want to do. All five options there should be self-explanatory (S2B/S2F/S3K fix has such name just because pointers for those engines are in the same format).

The last step would be filling the list of addresses with locations of pointers pertaining to coordination flags F6, F7 and F8. You can use the buttons ADD and REMOVE for this, or you can load and save text files with the respective buttons. When you use SCAN, the program attempts to recognize valid coordination flags by itself, but the results CAN be inaccurate. Once this step is done, you're ready to click the FIX button; then choose a filename for saving.

Supported Games

  • S1: Sonic 1 (any region, any version)
  • S2B: Sonic 2 Beta
  • S2F: Sonic 2 Final (any version)
  • S3K: Sonic 3 or Sonic & Knuckles, and Sonic 3 & Knuckles
  • SC: Sonic Crackers
  • S3D: Sonic 3D Blast

Where it's applicable, you can consider S3K as S3D or SC.

S1 to S2F and S2F to S1

Select "S2F voice conversion" to convert the voice from one format to another. If you don't do this, you'll still get the music working, but it won't be sounding like it sounds in its original game. If you want new voices, you'll have to do them yourself.

If you select "Tempo fix", the program will fix tempo in order to have the music playing at its original speed in the new engine. However you can do manual editing through an hex editor (byte 5) to suit your taste.


S1 to S2B/S3K and S2B/S3K to S1

You'll be asked for the location where you want to put the music in (when S1 is source), or the location where you got the music from (when S1 is destination). The program will calculate Z80 bank position for the location you typed, and change S1 relative pointers to S2B/S3K absolute pointers, or vice-versa.

The program will ask you for flag conversion if the music is from/for S3K. It'll replace flags E3 and E9 (S1, S2B, S2F) with F9 and FB (SC, S3K, S3D, Ristar). It seems to be some kind of rule for games released after 1993, to stop music porting 10 years later or whatever. =P


S2B/S2F/S3K fix

Everything here is nothing but "adjustment for little endians". Big change here, guys. Now you have SEVEN types of conversions for all your needs (I hope). Let's split'em up:

S2B to S2F and S2F to S2B

Put the value corresponding to S2B original or intended location, and the program will assign 1380 to the one that is S2F.

The program will calculate Z80 bank position for the location you typed for S2B, as well as the difference between S2B and S2F positions in Z80.

With the difference, the program will be adding it to the pointers (S2F to S2B), or subtracting (S2B to S2F). The "S2F voice conversion" works just like as explained in S1 to S2F.

S2F to S3K and S3K to S2F

It works just like what was said above, just replace S2B with S3K. It saves me some copy & paste. =P

S3K flag fix will be available, for the same purpose which was explained for S1 to S3K. When using S3K to S2F, you'll also have the option of converting S3K DAC notes to their nearest matches with S2F's. The program will ask you for alternate DAC conversion. Only reply YES if the music is SC instead of S3K.

S2B to S3K and S3K to S2B

Insert original and intended locations. The program will calculate Z80 bank positions for the locations you typed, as well as the difference between them. It'll add to or subtract from the pointers in order to make the music fit the new location.

Just like as explained with S2F, the flag conversion will be available, and DAC conversion just for S3K to S2B.

S3K to S3K

As explained for S2B, S3K uses the same pointer format, so nothing that big but adding or subtracting to them in order to make the music fit the new location. No special options available.

The "Only fix the header" option will ignore the address list; it's supposed to be used with musics which haven't any coordination flag that holds pointers. It is valid even on S2B/S2F/S3K fix.


The "Ristar to S1" won't produce a fully working port. It'll only convert the header, fix the pointers from coordinations flags F6/F7/F8 and replace coordination flags F9 and FB with E3 and E9 respectively. You are supposed to change manually PSG data and other segments in order to have it sounding like it sounds in Ristar. Or else bizarre things like repeated SEGA sound may occur, so be wise. =P


Only musics with channel setup defined as 0603 or 0703 are supported.

SPECIAL THANKS TO:

R. Solaris
Tweaker
M Kusanagi

And everyone from SWS2B who supports game hacking in some way or other

Please give a credit when using this tool for your hacks. Thanks.

Download.svg Download Music Pointer Fixer
File: Music Pointer Fixer v1.0.0.1.zip (26 kB) (info)
Current version: v.1.0.0.1