Difference between revisions of "Expand the music index from $94 to $9F"
From Sonic Retro
Scarred Sun (talk | contribs) m (Text replacement - "</asm>" to "</syntaxhighlight>") |
(Guide has been deprecated due to a newer method being released) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{GuideBy|SoullessSentinel}} | {{GuideBy|SoullessSentinel}} | ||
+ | |||
+ | '' '''NOTE:''' If you want to extend more music slots starting from $00 to $FF, see this guide [http://info.sonicretro.org/SCHG_How-to:Expand_the_music_index_to_start_at_$00_instead_of_$80 here]. Also see this guide [https://info.sonicretro.org/SCHG_How-to:Expand_the_Sonic_1_sound_index here] for a newer method.'' - JGMR | ||
To add more music slots to the sound test, search for this code in the level select routine: | To add more music slots to the sound test, search for this code in the level select routine: | ||
− | <asm>LevSel_NoCheat: | + | <syntaxhighlight lang="asm">LevSel_NoCheat: |
cmpi.w #$94,d0 ; is sound $80-$94 being played? | cmpi.w #$94,d0 ; is sound $80-$94 being played? | ||
bcs.s LevSel_PlaySnd; if yes, branch | bcs.s LevSel_PlaySnd; if yes, branch | ||
Line 8: | Line 10: | ||
bcs.s LevelSelect; if yes, branch</syntaxhighlight> | bcs.s LevelSelect; if yes, branch</syntaxhighlight> | ||
Change the line: | Change the line: | ||
− | <asm> cmpi.w #$94,d0 ; is sound $80-$94 being played?</syntaxhighlight> | + | <syntaxhighlight lang="asm"> cmpi.w #$94,d0 ; is sound $80-$94 being played?</syntaxhighlight> |
So it reads: | So it reads: | ||
− | <asm> cmpi.w #$A0,d0 ; is sound $80-$9F being played?</syntaxhighlight> | + | <syntaxhighlight lang="asm"> cmpi.w #$A0,d0 ; is sound $80-$9F being played?</syntaxhighlight> |
Then rebuild the ROM. | Then rebuild the ROM. | ||
Latest revision as of 22:42, 10 July 2023
(Original guide by SoullessSentinel)
NOTE: If you want to extend more music slots starting from $00 to $FF, see this guide here. Also see this guide here for a newer method. - JGMR
To add more music slots to the sound test, search for this code in the level select routine:
LevSel_NoCheat:
cmpi.w #$94,d0 ; is sound $80-$94 being played?
bcs.s LevSel_PlaySnd; if yes, branch
cmpi.w #$A0,d0 ; is sound $95-$A0 being played?
bcs.s LevelSelect; if yes, branch
Change the line:
cmpi.w #$94,d0 ; is sound $80-$94 being played?
So it reads:
cmpi.w #$A0,d0 ; is sound $80-$9F being played?
Then rebuild the ROM.
And now the sound test will have the music slots going up to $9F, instead of $94, however attempts to play empty music slots will crash the sound driver, and possibly lock up the emulator. So, make sure you include a song in every slot.
Note: The disassembly's comments are incorrect. The correct ID ranges are $80-$93 and $94-$9F.