Spike Bug - RetroKoH/S1Fixed GitHub Wiki
(Original guide by FraGag)
Source: SCHG Page
Commit: f0961b7
This mod can be toggled in S1Fixed by setting SpikeBugFix to 0 or 1.
In Sonic 1, spike damage behavior differs from any other Sonic game: when Sonic touches spikes, the game doesn't check if Sonic is invulnerable (he is invulnerable when he flashes). So, if Sonic hits spikes and falls back on spikes again, he dies immediately instead of being temporarily invulnerable.
However, in Sonic 2, this behavior was altered; instead of hurting Sonic regardless of invulnerability status, the game would allow the flashing invulnerability to protect Sonic from further spike damage. This change in behavior is very easy to apply to Sonic 1. I made this a toggleable mod in S1Fixed due to the fact that newer versions of the game that fix this behavior allow the original behavior as an option.
Open _incObj\36 Spikes.asm and find Spik_Hurt. We are going to add a check for invulnerability:
Spik_Hurt:
tst.b (v_invinc).w ; is Sonic invincible?
bne.s Spik_Display ; if yes, branch
+ tst.w (v_player+flashtime).w ; is Sonic invulnerable?
+ bne.s Spik_Display ; if yes, branch
;...