Actions

SCHG How-to

Difference between revisions of "Expand the music index from $94 to $9F"

From Sonic Retro

m
m (fixed the error (ID 9F not playing) in a proper way)
Line 10: Line 10:
 
<asm>        cmpi.w    #$94,d0    ; is sound $80-$94 being played?</asm>
 
<asm>        cmpi.w    #$94,d0    ; is sound $80-$94 being played?</asm>
 
So it reads:
 
So it reads:
<asm>        cmpi.w    #$9F,d0    ; is sound $80-$9F being played?</asm>
+
<asm>        cmpi.w    #$A0,d0    ; is sound $80-$9F being played?</asm>
 
Then rebuild the ROM.
 
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.
 
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.
  
''(Addition by [[User:Vanya|Vanya]])''
+
Note: The disassembly's comments are incorrect. The correct ID ranges are $80-$93 and $94-$9F.
 
 
One last thing to note is that song 9F won't play unless one more change is made.
 
 
 
<asm>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</asm>
 
Change the line:
 
<asm>        bcs.s    LevSel_PlaySnd; if yes, branch</asm>
 
So it reads:
 
<asm>        ble.s    LevSel_PlaySnd; if yes, branch</asm>
 
  
 
{{S1Howtos}}
 
{{S1Howtos}}
 
[[Category:SCHG_How-tos|{{PAGENAME}}]]
 
[[Category:SCHG_How-tos|{{PAGENAME}}]]

Revision as of 16:36, 8 November 2014

(Original guide by lukeusher123)

To add more music slots to the sound test, search for this code in the level select routine: <asm>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</asm>

Change the line: <asm> cmpi.w #$94,d0  ; is sound $80-$94 being played?</asm> So it reads: <asm> cmpi.w #$A0,d0  ; is sound $80-$9F being played?</asm> 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.

SCHG How-To Guide: Sonic the Hedgehog (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix the SEGA Sound | Display the Press Start Button Text | Fix the Level Select Menu | Fix the Hidden Points Bug | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix the Walk-Jump Bug | Correct Drowning Bugs | Fix the Death Boundary Bug | Fix the Camera Follow Bug | Fix Song Restoration Bugs | Fix the HUD Blinking | Fix the Level Select Graphics Bug | Fix a remember sprite related bug
Changing Design Choices
Change Spike Behavior | Collide with Water After Being Hurt | Fix Special Stage Jumping Physics | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Remove the Speed Cap | Port the REV01 Background Effects | Port Sonic 2's Level Art Loader | Retain Rings Between Acts | Add Sonic 2 (Simon Wai Prototype) Level Select | Improve ObjectMove Subroutines | Port Sonic 2 Level Select
Adding Features
Add Spin Dash ( Part 1 / Part 2 / Part 3 / Part 4 ) | Add Eggman Monitor | Add Super Sonic | Add the Air Roll
Sound Features
Expand the Sound Index | Play Different Songs Per Act | Port Sonic 2 Final Sound Driver | Port Sonic 3's Sound Driver | Port Flamewing's Sonic 3 & Knuckles Sound Driver | Change The SEGA Sound
Extending the Game
Load Chunks From ROM | Add Extra Characters | Make an Alternative Title Screen | Use Dynamic Tilesets | Make GHZ Load Alternate Art | Make Ending Load Alternate Art | Add a New Zone | Set Up the Goggle Monitor | Add New Moves | Add a Dynamic Collision System | Dynamic Special Stage Walls System | Extend Sprite Mappings and Art Limit | Enigma Credits | Use Dynamic Palettes
Miscellaneous
Convert the Hivebrain 2005 Disassembly to ASM68K
Split Disassembly Guides
Set Up a Split Disassembly | Basic Level Editing | Basic Art Editing | Basic ASM Editing (Spin Dash)