Rolling Turn Around Fix - RetroKoH/S1Fixed GitHub Wiki
(Original guide by Mercury)
Source: ReadySonic
Commit: 9542219
In Sonic 1, Sonic can turn around while rolling. When the player holds the D-pad in the opposite direction than Sonic is moving, when Sonic should come to a stop from deceleration he instead gets a tiny boost of speed in the opposite direction. This makes it harder to stop rolling than it should. It can also be abused to roll in place forever, if the player is quick enough. Seeing as how this is fixed in Sonic 3, it makes sense to fix it here, too.
To fix this, open _incObj\Sonic RollSpeed.asm. We are going to go to two specific labels: loc_13218 and loc_1323A.
At both labels, we are going to find move.w #-$80,d0
or move.w #$80,d0
. Change both of these to clr.w d0
.
This bug happens because Sonic's animation system checks his speed in order to determine which animation he should use; "stand", "walk", "run", etc. If his speed is equal to 0, he'll use the "stand" animation. The trouble is, his speed could be equal to 0 while he's turning around. Sometimes the math would even out and his speed would be exactly null for one frame. By hard-setting his speed to $80 or $-80 when he turns around, Sonic Team was able to prevent the animation system from accidently using his "stand" animation when he should still be using his "walk" animation.
The trouble is that this wasn't removed for the "roll" routine, where it wasn't needed because Sonic shouldn't even be able to turn around while rolling.