Retain Rings when returning at a Star Post
From Sonic Retro
(Original guide by Mercury)
When Sonic & Knuckles is locked on to Sonic 2, if Knuckles returns from a Special Stage, he'll still have the number of rings he had when he entered it. In addition, if he dies and respawns at a Star Post, he'll have the number of rings he did when he first hit it. This simple guide explains how to activate this in Sonic 2 alone.
(This guide refers to the Xenowhirl 2007 disassembly)
Go to Obj79_LoadData, and remove or comment out this line: <asm> clr.w (Ring_count).w </asm> (This command is 4278 FE20 in hex, at an offset of $1F37C in the ROM, if you wish to make the change in raw hex.)
Now the player's rings won't be cleared out when respawning at a Star Post.
There is a way to perform this also in Sonic 1. If using the SVN Disassembly, go to Lamp_LoadInfo in _incObj\79 Lamppost.asm and remove the following line (or change it to a comment): <asm> clr.w (v_rings).w </asm>