Death Routine Solidity Fix - RetroKoH/S1Fixed GitHub Wiki
(Based on a Sonic 2 guide by Esrael Neto)
(Adapted to Sonic 1 by RetroKoH)
Source: Sonic Retro thread
Flamewing alt fix here
Commit: In progress
This fix is based on a bug I pointed out in Sonic 2 many years ago, that can frequently occur when you die against the Chemical Plant Zone boss. If you or die by falling into the pit below the platform, and are under the solid floor, the character will hit the floor and just drop, instead of the proper behavior. This effect can occur in any place with solidity directly above Sonic, and it can even happen in Sonic 1! It's quite rare to see it in Sonic 1, due to the layouts being as they are, but if you are editing layouts, it is possible to encounter this bug.
(The code shown is for Sonic 2. I will provide a Sonic 1 equivalent soon) To fix this, you'll want to disable floor detection while dying. find:
; loc_1E596:
Floor_ChkTile:
move.w d2,d0
....
movea.l d1,a1
rts
; ===========================================================================
; precalculated values for Floor_ChkTile
; (Sonic 1 calculated it every time instead of using a table)
word_1E5D0:
And insert the following:
; loc_1E596:
Floor_ChkTile:
move.w d2,d0
....
movea.l d1,a1
cmpi.b #$06, $0024(A0)
bne.s Player_Not_Death
cmpi.b #$01, (A0) ; Is Sonic
beq.s Player_Death ;
cmpi.b #$02, (A0) ; Is Miles
bne.s Player_Not_Death ;
Player_Death: ;
move.l #$FFFF0000, A1
Player_Not_Death:
rts
; ===========================================================================
; precalculated values for Floor_ChkTile
; (Sonic 1 calculated it every time instead of using a table)
word_1E5D0:
It should be noted that making this fix in Sonic 2 caused a bug with Silver Sonic falling through the floor due to its initial animation sharing the same id as Sonic's dying animation. That's why we perform the ID check you see in the code. You'll want to pay close attention to ensure that this doesn't happen with any custom objects you insert into the game. To my knowledge, there are none in Sonic 1 that should exhibit such behavior.