Some Sonic 2 Sound/Music Questions
#1
Posted 09 April 2012 - 02:48 PM
Firstly, I wanna change the SEGA sound. I have a file that I want to use, but there seems to be no documentation around that explains how to make this happen.
Secondly, I have music I wish to recover. In the original STLL2, Wing Fortress' level music was replaced by Flying Battery 1's. I can't seem to locate the updated pointer to the music files, and this leaves me a bit confused as to how to bring it back. I'd simply have taken it from S3K using Esrael's tool, but again, Sonic 2 receives no love.
#2
Posted 09 April 2012 - 06:02 PM
That one is super easy. You can overwrite the segapcm sound file itself with a wav that is 8-bit pcm (not sure if it's stereo or mono). You can download sndrec32.exe to do this!Firstly, I wanna change the SEGA sound. I have a file that I want to use, but there seems to be no documentation around that explains how to make this happen.
When overwriting the segapcm file, make sure that you're saving it as a .bin file.
Try splitting your original version of the hack with a new disassembly, and see if you can recover the wing fortress .bin music file and replace it with the one in the new version of your hacks disassembly.Secondly, I have music I wish to recover. In the original STLL2, Wing Fortress' level music was replaced by Flying Battery 1's. I can't seem to locate the updated pointer to the music files, and this leaves me a bit confused as to how to bring it back. I'd simply have taken it from S3K using Esrael's tool, but again, Sonic 2 receives no love.
Edited by Tongara, 09 April 2012 - 06:04 PM.
#3
Posted 09 April 2012 - 07:40 PM
First one sorted, thanks Tongara. For the record, it is 8-bit PCM, 16,000 KHz, Mono that is needed. Figured that out through trial and error.That one is super easy. You can overwrite the segapcm sound file itself with a wav that is 8-bit pcm (not sure if it's stereo or mono). You can download sndrec32.exe to do this!
Firstly, I wanna change the SEGA sound. I have a file that I want to use, but there seems to be no documentation around that explains how to make this happen.
When overwriting the segapcm file, make sure that you're saving it as a .bin file.Try splitting your original version of the hack with a new disassembly, and see if you can recover the wing fortress .bin music file and replace it with the one in the new version of your hacks disassembly.Secondly, I have music I wish to recover. In the original STLL2, Wing Fortress' level music was replaced by Flying Battery 1's. I can't seem to locate the updated pointer to the music files, and this leaves me a bit confused as to how to bring it back. I'd simply have taken it from S3K using Esrael's tool, but again, Sonic 2 receives no love.
As for the FBZ music, I already tried that, but because the locations were altered, and I have no idea where to even begin looking (it seems the location for the pointers has changed also), I can't seem to grab it.
#4
Posted 09 April 2012 - 08:06 PM
First one sorted, thanks Tongara. For the record, it is 8-bit PCM, 16,000 KHz, Mono that is needed. Figured that out through trial and error.
That one is super easy. You can overwrite the segapcm sound file itself with a wav that is 8-bit pcm (not sure if it's stereo or mono). You can download sndrec32.exe to do this!
Firstly, I wanna change the SEGA sound. I have a file that I want to use, but there seems to be no documentation around that explains how to make this happen.
When overwriting the segapcm file, make sure that you're saving it as a .bin file.
I downloaded this application and it's in a different language so it's hard to get the hang of. But it seems it only saves as a WAV file. How do you convert it to .bin as I'm guessing it's not as simple as changing the extension from WAV to BIN?
#5
Posted 09 April 2012 - 09:17 PM
Generally where you select file type in any application, select all files and name it segapcm.bin or whatever the sega sound file is called. OR do what you said.First one sorted, thanks Tongara. For the record, it is 8-bit PCM, 16,000 KHz, Mono that is needed. Figured that out through trial and error.
That one is super easy. You can overwrite the segapcm sound file itself with a wav that is 8-bit pcm (not sure if it's stereo or mono). You can download sndrec32.exe to do this!
Firstly, I wanna change the SEGA sound. I have a file that I want to use, but there seems to be no documentation around that explains how to make this happen.
When overwriting the segapcm file, make sure that you're saving it as a .bin file.
I downloaded this application and it's in a different language so it's hard to get the hang of. But it seems it only saves as a WAV file. How do you convert it to .bin as I'm guessing it's not as simple as changing the extension from WAV to BIN?
#6
Posted 09 April 2012 - 09:22 PM
To open the SEGA sound, open the File menu and use Import -> Raw Data. The codec is "Unsigned 8-bit PCM".
To save it, chose File -> Export. Then select the file type "Other uncompressed files", click the Options button and chose "RAW (header-less)" as header type and "Unsigned 8-bit PCM" as codec.
Then save (ignore the metadata editor, it does nothing in this case) and you're done.
If you already have a wav-file in the correct format, open it in the hex-editor of your choice and search for "data". Then delete all bytes from offset 0 to the data-text + the 4 bytes after the data-text. (usually 2Ch bytes or 38h bytes if there is a "fact" block between the "fmt" and "data" ones) Done.
A last note: The size of the SEGA sound is hardcoded into the ROM, so you either need to find and fix this value or your new sound must have the exactly same size as the old one.
#7
Posted 09 April 2012 - 09:26 PM
Yes, because rather than just saving over a file, importing it as raw data, then editing it in a hex editor is so much easier.... right?Don't make it more complicated than it needs to be - use Audacity.
To open the SEGA sound, open the File menu and use Import -> Raw Data. The codec is "Unsigned 8-bit PCM".
To save it, chose File -> Export. Then select the file type "Other uncompressed files", click the Options button and chose "RAW (header-less)" as header type and "Unsigned 8-bit PCM" as codec.
Then save (ignore the metadata editor, it does nothing in this case) and you're done.
If you already have a wav-file in the correct format, open it in the hex-editor of your choice and search for "data". Then delete all bytes from offset 0 to the data-text + the 4 bytes after the data-text. (usually 2Ch bytes or 38h bytes if there is a "fact" block between the "fmt" and "data" ones) Done.
A last note: The size of the SEGA sound is hardcoded into the ROM, so you either need to find and fix this value or your new sound must have the exactly same size as the old one.
I'm sorry, but are you on drugs? o_O
Edited by Tongara, 09 April 2012 - 09:28 PM.
#8
Posted 09 April 2012 - 09:28 PM
Generally where you select file type in any application, select all files and name it segapcm.bin or whatever the sega sound file is called. OR do what you said.
I didn't know it was as simple as naming from WAV to BIN, cheers =P
A last note: The size of the SEGA sound is hardcoded into the ROM, so you either need to find and fix this value or your new sound must have the exactly same size as the old one.
That's a bummer. Anyway, I won't be changing the SEGA sound, just be adding some more PCM's. But is there a size limit for putting in PCMs?
#9
Posted 09 April 2012 - 09:30 PM
As long as it's exported with the right settings, you're good to go!Generally where you select file type in any application, select all files and name it segapcm.bin or whatever the sega sound file is called. OR do what you said.
I didn't know it was as simple as naming from WAV to BIN, cheers =P
As Shadow Fire said: " 8-bit PCM, 16,000 KHz, Mono".
#10
Posted 09 April 2012 - 09:38 PM
Sound: incbin "Sound.wav", $3A Sound_End: even
WAV files that are 8-bit unsigned mono have a header size of 3A, by placing 3A at the end of the include of the WAV file, I have included the RAW PCM data without the header into the ROM, and I can easily open the sample with a sound/media player to see what it sounds like. This eliminates the need to extract it to RAW.
#11
Posted 09 April 2012 - 09:57 PM
If the PCM sound is played by the 68000 (e.g. S2 Clone Driver), the limit should be the size of the ROM.But is there a size limit for putting in PCMs?
If it's played by the Z80 (plain Sonic 1/2/3), the limit is usually the size of a Z80 bank, i.e. 8000h bytes.
#12
Posted 09 April 2012 - 11:11 PM
#13
Posted 10 April 2012 - 04:08 AM
I wasn't aware that you could just include the .wav files. That is quite amazing!Generally what I do is:
Sound: incbin "Sound.wav", $3A Sound_End: even
WAV files that are 8-bit unsigned mono have a header size of 3A, by placing 3A at the end of the include of the WAV file, I have included the RAW PCM data without the header into the ROM, and I can easily open the sample with a sound/media player to see what it sounds like. This eliminates the need to extract it to RAW.
The thing is, it doesn't ever really seem to need the header... it just seems to work.
#14
Posted 10 April 2012 - 06:38 AM
I managed to (after a lot of hassle) port the clone driver, something I neglected, simply because I forgot to. =P However, this presents me with another problem. As you may or may not know, I have water loaded in MCZ, which I drew from HPZ, modifying its palette to fit with MCZ's already modded palette. The use of the clone driver has changed the underwater palette used, and I cannot for the life of me figure out how to change it to load from my altered palette.Shadow Fire, surely you could use the Clone Driver and port FBZ again, if you want the file grab it from flamewing's pack.
#15
Posted 10 April 2012 - 01:25 PM
Underwater_palette_2 = ramaddr( $FFFFF000 ) ; not sure what it's used for but it's only used when there's water Underwater_palette = ramaddr( $FFFFF080 ) ; main palette for underwater parts of the screen Underwater_palette_line4 = ramaddr( $FFFFF0E0 )
What you will need to do, is change that address to somewhere else, somewhere where there's 100 bytes free to use, Sonic 1 had it's underwater palettes stored at around FFFA00 - FFFAFF if I recall correctly, and from the looks of things, Sonic 2 doesn't use that space (even though they moved the palette), so you "might" get away with moving the underwater palette back to it's original Sonic 1 address:
Underwater_palette_2 = ramaddr( $FFFFFA00 ) ; not sure what it's used for but it's only used when there's water Underwater_palette = ramaddr( $FFFFFA80 ) ; main palette for underwater parts of the screen Underwater_palette_line4 = ramaddr( $FFFFFAE0 )
Although I know my way around the Mega Drive, I'm no expert on Sonic 2 specifically, so forgive me if this doesn't resolve your problem.
#16
Posted 10 April 2012 - 06:14 PM
Underwater_palette_2 = ramaddr( $FFFFF000 ) ; not sure what it's used for but it's only used when there's water Underwater_palette = ramaddr( $FFFFFA80 ) ; main palette for underwater parts of the screen Underwater_palette_line4 = ramaddr( $FFFFF0E0 )
And the underwater palette is still fine, and I have the S2Clonedriver. Although I will say ValleyBell has heavily modified mine or has changed it completely. The only problem I get (which is rare) is when lots of objects are underwater, the underwater palette fucks up (sprite-table spills over onto the palette).
Generally what I do is:
Sound: incbin "Sound.wav", $3A Sound_End: even
WAV files that are 8-bit unsigned mono have a header size of 3A, by placing 3A at the end of the include of the WAV file, I have included the RAW PCM data without the header into the ROM, and I can easily open the sample with a sound/media player to see what it sounds like. This eliminates the need to extract it to RAW.
The sound end is a little bit wierd. If I was to do more than 1 WAV, can I try this?
SoundA: incbin "Sound.wav", $3A SoundB: incbin "Sound2.wav", $3A MusicA: incbin "Music.wav", $3A Sound_End: even
or
SoundA: incbin "Sound.wav", $3A
even
SoundB: incbin "Sound2.wav", $3A
even
MusicA: incbin "Music.wav", $3A
evenIf the PCM sound is played by the 68000 (e.g. S2 Clone Driver), the limit should be the size of the ROM.But is there a size limit for putting in PCMs?
If it's played by the Z80 (plain Sonic 1/2/3), the limit is usually the size of a Z80 bank, i.e. 8000h bytes.
The size for the 68k sounds way too much, and the Z80 size sounds way too small =P
#17
Posted 10 April 2012 - 06:38 PM
I'm afraid that it hasn't resolved the problem...The problem is that the "Clone Driver" is Sonic 1's SMPS script player, and the address of where the sound driver stores its information is at FFF000+. Now, when Sonic Team changed their sound driver to use Z80 when working on Sonic 2, they decided to move the underwater palettes to where the sound driver space used to be:
Underwater_palette_2 = ramaddr( $FFFFF000 ) ; not sure what it's used for but it's only used when there's water Underwater_palette = ramaddr( $FFFFF080 ) ; main palette for underwater parts of the screen Underwater_palette_line4 = ramaddr( $FFFFF0E0 )
What you will need to do, is change that address to somewhere else, somewhere where there's 100 bytes free to use, Sonic 1 had it's underwater palettes stored at around FFFA00 - FFFAFF if I recall correctly, and from the looks of things, Sonic 2 doesn't use that space (even though they moved the palette), so you "might" get away with moving the underwater palette back to it's original Sonic 1 address:Underwater_palette_2 = ramaddr( $FFFFFA00 ) ; not sure what it's used for but it's only used when there's water Underwater_palette = ramaddr( $FFFFFA80 ) ; main palette for underwater parts of the screen Underwater_palette_line4 = ramaddr( $FFFFFAE0 )
Although I know my way around the Mega Drive, I'm no expert on Sonic 2 specifically, so forgive me if this doesn't resolve your problem.
I'd like to point out that ARZ and CPZ's underwater palettes are fine, but MCZ isn't. Here is what the palette currently looks like:
STLL2_031.gif 17.19K
15 downloadsIt is meant to look like this:
STLL2_009.gif 11.65K
13 downloadsIt was working fine up until I ported the clone driver. When I look at the palette area for the water, it seems to be correct.
Level_LoadPal: moveq #3,d0 bsr.w PalLoad2 ; load Sonic's palette line tst.b (Water_flag).w ; does level have water? beq.s Level_GetBgm ; if not, branch moveq #$15,d0 ; palette number $15 cmpi.b #$B,(Current_Zone).w beq.s Level_WaterPal ; branch if level is HPZ (modified for MCZ) moveq #$16,d0 ; palette number $16 cmpi.b #$D,(Current_Zone).w beq.s Level_WaterPal ; branch if level is CPZ moveq #$17,d0 ; palette number $17
#18
Posted 10 April 2012 - 06:49 PM
Edited by DrHackMan, 10 April 2012 - 07:44 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users



This topic is locked








