Discussion in 'Engineering & Reverse Engineering' started by Chimera, Aug 29, 2017.
Those models are adorable. I wish they could be ported into Sonic R.
Or I hope they're ported into Generations at least.
Finally, the game is playable.
I wonder what Tax and Stealth may be thinking with all this lunacy going on...
They probably did this months ago :specialed:
Or at least they did something like this unintentionally
So, can you edit the pallete, and, if so, would you provide an example of the pallete editing?
Glad I'm not the only one who missed this.
We could call it... the "Spin Drop". =P
Actually yea, now that the drop dash is a thing that should be a feature, even if it was a glitch :specialed:
This might have already been discovered, but I'm going to post it here just in case.
While making music mods, it was easy to replace the stage themes' loops since they're right there in SceneXX.bin, but there were some things notably missing, such as the boss themes and invincibility, etc. I tried replacing them in the Level Select and DA Garden files to see if it reads them from there, but no dice. But lo and behold, I have found them! Like the BlueSpheresSPD loop, they are hardcoded into the game's exe. They're very easy to find if you search for a little-endian 32-bit unsigned integer using the values you get from the level select file, but I'm going to post the addresses of the ones I could find here:
Invincible is notably missing, not sure what's going on with that. Additionally, HBHMischief and Sneakers appear multiple times in the exe; HBH appears twice and Sneakers appears SEVEN times. I'm not sure if there are just coincidentally other fields that have the same value as the loop point or if they're all used in different situations since I don't know what the surrounding code is for. If someone more well-versed in looking through exe files wants to have a go, be my guest :P
Note that both BossFinal and both of the Egg Reverie loop points are not stored here; they can be found in the normal scene files of their respective zones.
So since Super's theme is hardcoded into the exe, is there any way to prevent the game from loading it?
EDIT: Quoted for new page.
Unfortunately, all that function is doing is loading data for several songs into some structure. The code for playing the music is somewhere else entirely, and presumably it would be just referencing the music by the slot number it's loaded to, so searching for the song's name won't help.
Here's the rest of the stuff from that function:
The "triggers," if that's the right word, for switching to the super/sneakers/invincible music are almost definitely in the exe, but I don't know if they're nearby the loop point or not since I don't really know what any of the code in the exe is actually doing. I think if you just removed it, it would probably play silence or something; you'd need to change a bit more to get it to keep playing the level music while super. At least I think, I can't say anything for sure.
For reference, this is the function where most of the loop points are located:
void __cdecl sub_D90B30()
sub_4013A0("Invincible.ogg", 1, 139263);
sub_4013A0("Sneakers.ogg", 2, 120960);
sub_4013A0("BossMini.ogg", 3, 276105);
sub_4013A0("BossHBH.ogg", 4, 70560);
sub_4013A0("BossEggman1.ogg", 5, 282240);
sub_4013A0("BossEggman2.ogg", 6, 264600);
sub_4013A0("ActClear.ogg", 7, 0);
sub_4013A0("Drowning.ogg", 8, 0);
sub_4013A0("GameOver.ogg", 9, 0);
sub_4013A0("Super.ogg", 10, 165375);
sub_4013A0("HBHMischief.ogg", 12, 381405);
sub_4013A0("1up.ogg", 13, 0);
if ( !*(_DWORD *)(dword_D84670 + 200880) )
*(_DWORD *)(dword_D84524 + 588) = 0;
*(_DWORD *)(dword_D84524 + 592) = -1;
*(_DWORD *)(dword_D84524 + 600) = -1;
*(_DWORD *)(dword_D84524 + 612) = 0;
*(_DWORD *)(dword_D84524 + 604) = 0;
*(_DWORD *)(dword_D84524 + 608) = 0;
Good find, thanks for completing my incomplete research :P
EDIT: I just realized, the BossPuyo file is also referenced in its own Stage.bin file, so I'm not sure what the use of the address I found was. It seems unlikely that it's another value that just happened to be the loop point, but I don't know.
Maybe this is a leftover of the Power Sneakers using sped-up versions of the level music at one point?
So, someone was nice enough to put the HUEHUEHUEs back into Stardust Speedway:
I'm more tempted than ever to jump in and try to figure out how to replace songs, haha. Haven't done that since the Generations days, but I recall it involved using a Street Fighter IV file converter and a bunch of steps.
EDIT: Or I might instead go with S0LV0's version.
☝️Sorry, but this first few seconds of that is pretty bad. The samples thrown on top of don't match the pace of the music very well at all. Didn't bother to hear the rest
Replacing songs in Mania is really simple. Mania uses completely normal OGG Vorbis files, so if you encode anything to that, name the file properly, replace and repack it, it'll work perfectly. The only things you need to worry about are that the audio must be 44100Hz or the game will play it too fast/slow depending on its actual samplerate. The other thing is that unless you edit the loop points in the stage file or exe, your loop will likely be wonky. But if you just want to have the song in, it's simple.
Just thought I'd share two mods I just finished
True Blue Sonic & Rad Red Knuckles: https://youtu.be/S1Tngy-TM2Q
Sonic 3 Palette: https://youtu.be/GmgYq_xl8JI
Separate names with a comma.