Difference between revisions of "Add Spin Dash to Sonic 1/Part 4"
From Sonic Retro
Green Snake (talk | contribs) m (Added fix for annoying bug) |
m |
||
Line 1: | Line 1: | ||
{{GuideBy|Mercury}} | {{GuideBy|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: | 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 | ||
Line 14: | Line 15: | ||
<asm> move.w #0,($FFFFC904).w ; clear screen delay counter</asm> | <asm> move.w #0,($FFFFC904).w ; clear screen delay counter</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> | ||
+ | |||
+ | 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 17:51, 18 February 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>
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>
That's it!