Proper Push Sensors While Rolling - RetroKoH/S1Fixed GitHub Wiki
(Original guide by Devon)
Source: Sonic Retro thread
Commit: 0c1e5e6
There is a possible slight oversight with how the push sensor is positioned. So, if Sonic is moving along a flat enough ground (not a wall or ceiling), then Sonic's push sensor will be moved down 8 pixels. This is so that snapping on top of steeper steps can only really be done is you're walking up a slope, and not on flat ground, which would look strange.
The problem is that this lowering of the push sensor doesn't account for when Sonic's smaller hitbox when he starts rolling. As a result, the threshold for the largest step that Sonic can snap on top of lowers.
This is particularly not ideal, because it increases the likelihood of Sonic getting stopped by a decently shallow slope while rolling, due to how low that threshold is.
If you want the push sensor's position to be consistent with the normal hitbox height when on flat ground, the fix is easy! In sonic.asm, go to loc_14D24 and add this at the end:
loc_14D24:
andi.b #$C0,d0
beq.w loc_14DF0
cmpi.b #$80,d0
beq.w loc_14F7C
andi.b #$38,d1
bne.s loc_14D3C
addq.w #8,d2
+ btst #staSpin,obStatus(a0) ; Is Sonic rolling?
+ beq.s loc_14D3C ; If not, branch
+ subq.w #5,d2 ; If so, move push sensor up a bit
And you'll get this:
You can adjust the numbers to your liking if you please. I will also note that if you make it so that the push sensor is enabled for other directions (like Sonic 3K does when running straight up/down on a wall or running on a flat ceiling), then modifications to account for that will need to be made.