View Other Content
Here is a disassembly of Sonic 1 that has been altered to read the location of music rather than an ID:
Here's how it works, originally, if you wanted to play a music track, you would do this:
Music move.b #$81,d0 bsr PlaySound
That ID can only be from 80 to 7F, that leaves you with 100 slots for music, sfx and control. In the one above, you would do this instead:
Music move.l #Music81,d0 bsr PlayMusic
Here, you simply move the location of the music (no matter where it is) to d0, and call the routine, There are 4 types to use:
Music move.l #Music81,d0 bsr PlayMusic move.l #SoundA0,d0 bsr PlaySound move.l #SoundD0,d0 bsr PlayAdvance move.l #Sound_E0,d0 bsr PlayControl
PlayMusic for BGM music, PlaySound for SFX, PlayAdvance for advance SFX of ID D0 and higher, and PlayControl for the special E0 - E4 software sound manipulation (fading, stopping, speed change, SEGA sound, etc).
There are now no ID limits, only the limit of the ROM, if you wish to apply it to your disassembly rather than having to build off of the one above, search for "; MJ:" I have tagged all of the changes made.
There SHOULD be no bugs, but even the best of us make mistakes, good luck and enjoy.