Go to the sound test (not the one on the level select) and put in 19, 65, 09, 17, 01, 01, 02, 04 (press A after each one). There won't be a confirmation sound. Start the game by pressing Start on the first option (character select) and you should have 14 continues.
This code only works for Sonic. First, do the Level Select cheat. In the Level Select menu, go to Sound Test and hear the sounds 04, 01, 02, 06 in this order. If done correctly, you'll hear a Chao Emerald sound effect. Now, select any stage from this menu and not only you'll be able to turn into Super Sonic with 50 rings but also you'll get Sonic's second ending after beating Death Egg Zone.
Enter at soundtest ''19, 65, 09, 17'', then press A + start, then when sonic and tails pop up, press A + Start to go to the level select screen. On the sound test area, enter ''01 09 09 02 01 01 02 04'' and then press A + Start. This is an alternate debug to the others.
For all those who like to play honest instead of cheating all those Chaos Emeralds together, there's an alternate - yet simple - way to become Super Sonic in Emerald Hill Zone 1. It involves some serious work, however:
1. Complete the special stages as you would usually do and collect as many emeralds as you want.
2. Press RESET.
3. Start a new game USING THE OPTIONS MENU! This is crucial! Otherwise your emeralds are gone for good!
4. Continue collecting the emeralds, if you don't have them all, yet and repeat point two and three until you got them all.
If you did everything correctly, after your last reset you should have all the emeralds from the very beginning and without using any code ever thus making Super Sonic available from the very beginning.
This has been tested and confirmed with the PAL version of Sonic 2 playing on a PAL Megadrive II.
Press up, up, up, down, down, down, up at the title screen