Actions

SCHG How-to

Difference between revisions of "Add Spin Dash to Sonic 1/Part 4"

From Sonic Retro

m
(Caterkiller bug (Since this was such a small thing, I did it here instead of making a fifth part.))
Line 3: Line 3:
 
==2005 HiveBrain's disassembly==
 
==2005 HiveBrain's disassembly==
 
This will fix the issue which causes weird camera movements if the player performs a Spin Dash at the very beginning of a level since the camera will try to follow bad data from the array of Sonic's previous positions. The following code therefore clears the aforementioned array and should be added right after the loc_60D0 label:
 
This will fix the issue which causes weird camera movements if the player performs a Spin Dash at the very beginning of a level since the camera will try to follow bad data from the array of Sonic's previous positions. The following code therefore clears the aforementioned array and should be added right after the loc_60D0 label:
<asm> clr.w ($FFFFF7A8).w ; reset Sonic's position tracking index
+
<asm> clr.w ($FFFFF7A8).w ; reset Sonic's position tracking index
lea ($FFFFCB00).w,a2 ; load the tracking array into a2
+
lea ($FFFFCB00).w,a2 ; load the tracking array into a2
moveq #63,d2 ; begin a 64-step loop
+
moveq #63,d2 ; begin a 64-step loop
 
@looppoint:
 
@looppoint:
move.w d1,(a2)+ ; fill in X
+
move.w d1,(a2)+ ; fill in X
move.w d0,(a2)+ ; fill in Y
+
move.w d0,(a2)+ ; fill in Y
dbf d2,@looppoint ; loop</asm>
+
dbf d2,@looppoint ; loop</asm>
  
  
 
There is one stupid bug we haven't looked at: Going through objects. This is rather annoying bug, and can be used to glitch the game. So why not fix this. Obviously it wont fix all the problems, but using springs to make screen delay like crazy is easiest way to do this glitch. So, add following just before Obj41_AniLR: label:
 
There is one stupid bug we haven't looked at: Going through objects. This is rather annoying bug, and can be used to glitch the game. So why not fix this. Obviously it wont fix all the problems, but using springs to make screen delay like crazy is easiest way to do this glitch. So, add following just before Obj41_AniLR: label:
<asm> move.w #0,($FFFFC904).w ; clear screen delay counter</asm>
+
<asm> move.w #0,($FFFFC904).w ; clear screen delay counter</asm>
 +
 
 +
 
 +
And finally, there's an annoying bug that occurs when rolling into a [[Caterkiller]] too fast, which will result Sonic in taking damage despite the head being destroyed already. This happens because the spiked body segments are actually not getting deleted immediately after destroying the head, but rather one frame later. To fix this, go to loc_16C7C: and right below the label add:
 +
<asm> clr.b $20(a1) ; immediately remove all touch response values when destroying the head to avoid taking damage</asm>
  
  
Line 27: Line 31:
 
move.w d0,(a2)+ ; fill in Y  
 
move.w d0,(a2)+ ; fill in Y  
 
dbf d2,@looppoint ; loop</asm>
 
dbf d2,@looppoint ; loop</asm>
 +
  
 
There is one little bug we haven't looked at: Going through objects. This is rather annoying bug, and can be used to glitch the game, so why not fix this. Obviously it wont fix all the problems, but using springs to make screen delay like crazy is easiest way to do this glitch. So, add following just before '''Spring_AniLR''' label:
 
There is one little bug we haven't looked at: Going through objects. This is rather annoying bug, and can be used to glitch the game, so why not fix this. Obviously it wont fix all the problems, but using springs to make screen delay like crazy is easiest way to do this glitch. So, add following just before '''Spring_AniLR''' label:
  
<asm>
+
<asm> move.w #0,($FFFFC904).w ; clear screen delay counter</asm>
move.w #0,($FFFFC904).w ; clear screen delay counter</asm>
+
 
 +
 
 +
And finally, there's an annoying bug that occurs when rolling into a [[Caterkiller]] too fast, which will result Sonic in taking damage despite the head being destroyed already. This happens because the spiked body segments are actually not getting deleted immediately after destroying the head, but rather one frame later. To fix this, go to loc_16C7C: and right below the label add:
 +
<asm> clr.b obColType(a1) ; immediately remove all touch response values when destroying the head to avoid taking damage</asm>
 +
 
  
 
That's it!
 
That's it!
 
{{S1Howtos}}
 
{{S1Howtos}}
 
[[Category:SCHG How-tos|Add Spin Dash to Sonic 1/Part 4]]
 
[[Category:SCHG How-tos|Add Spin Dash to Sonic 1/Part 4]]

Revision as of 19:36, 9 October 2015

(Original guide by Mercury)

2005 HiveBrain's disassembly

This will fix the issue which causes weird camera movements if the player performs a Spin Dash at the very beginning of a level since the camera will try to follow bad data from the array of Sonic's previous positions. The following code therefore clears the aforementioned array and should be added right after the loc_60D0 label: <asm> clr.w ($FFFFF7A8).w ; reset Sonic's position tracking index lea ($FFFFCB00).w,a2 ; load the tracking array into a2 moveq #63,d2 ; begin a 64-step loop @looppoint: move.w d1,(a2)+ ; fill in X move.w d0,(a2)+ ; fill in Y dbf d2,@looppoint ; loop</asm>


There is one stupid bug we haven't looked at: Going through objects. This is rather annoying bug, and can be used to glitch the game. So why not fix this. Obviously it wont fix all the problems, but using springs to make screen delay like crazy is easiest way to do this glitch. So, add following just before Obj41_AniLR: label: <asm> move.w #0,($FFFFC904).w ; clear screen delay counter</asm>


And finally, there's an annoying bug that occurs when rolling into a Caterkiller too fast, which will result Sonic in taking damage despite the head being destroyed already. This happens because the spiked body segments are actually not getting deleted immediately after destroying the head, but rather one frame later. To fix this, go to loc_16C7C: and right below the label add: <asm> clr.b $20(a1) ; immediately remove all touch response values when destroying the head to avoid taking damage</asm>


GitHub disassembly

This will fix the issue which causes weird camera movements if the player performs a Spin Dash at the very beginning of a level since the camera will try to follow bad data from the array of Sonic's previous positions. The following code therefore clears the aforementioned array. Open _inc\LevelSizeLoad & BgScrollSpeed.asm (or its JP1 counterpart if you have the JP1 revision enabled), and add theese lines at the beggining or the LevSz_SkipStartPos label:

<asm> clr.w (v_trackpos).w ; reset Sonic's position tracking index lea (v_tracksonic).w,a2 ; load the tracking array into a2 moveq #63,d2 ; begin a 64-step loop @looppoint: move.w d1,(a2)+ ; fill in X move.w d0,(a2)+ ; fill in Y dbf d2,@looppoint ; loop</asm>


There is one little bug we haven't looked at: Going through objects. This is rather annoying bug, and can be used to glitch the game, so why not fix this. Obviously it wont fix all the problems, but using springs to make screen delay like crazy is easiest way to do this glitch. So, add following just before Spring_AniLR label:

<asm> move.w #0,($FFFFC904).w ; clear screen delay counter</asm>


And finally, there's an annoying bug that occurs when rolling into a Caterkiller too fast, which will result Sonic in taking damage despite the head being destroyed already. This happens because the spiked body segments are actually not getting deleted immediately after destroying the head, but rather one frame later. To fix this, go to loc_16C7C: and right below the label add: <asm> clr.b obColType(a1) ; immediately remove all touch response values when destroying the head to avoid taking damage</asm>


That's it!

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)