Sonic 2 Hacking Guide
Machine Code - ROM Programming

To modify the ROM in detail, you have to use machine code. This section includes some of the most powerful ROM locations ever. You will be unlimited to what you will be able to do.

003CCE - If level select cheat is off, jump to 003CE4
003CD4 - If button A is pressed, jump to 003CE4
003CDC - Set screen mode to level select
003CE2 - Return

003FA8 - If level is CPZ2, jump to 003FC0 (load water)
003FB0 - If level is ARZ, jump to 003FC0 (load water)
003FB8 - If level is not HPZ, jump to 003FCC (don't load water)

For CPZ2:
0045FA - If screen X position is less than 1DE0, jump to 004608
004602 - Set water height to 0510
004608 - Return

For EHZ2:
00E67C - If screen X position is less than 2780, jump to 00E6A0
00E684 - Copy screen X position to screen X (left) size (player 1)
00E68A - Copy screen X position to screen X (left) size (player 2)
00E690 - Set screen Y size to 0390
00E696 - Set ??? to 0390
00E69C - Add 2 to EEDF (load boss)
00E6A0 - Return
00E6EE - If screen Y size (top) is less than 0388, jump to 00E702
00E6F6 - Set screen Y size (top) to 0388

For CPZ2:
00F396 - If screen X position is less than 2680, jump to 00F3BA
00F39E - Copy screen X position to screen X (left) size (player 1)
00F3A4 - Copy screen X position to screen X (left) size (player 2)
00F3AA - Set screen Y size to 0450
00F3B0 - Set ??? to 0450
00F3B6 - Add 2 to EEDF (load boss)
00F3BA - Return

For ARZ2:
00F4EE - If screen X position is less than 2810, jump to 00F51E
00F4F6 - Copy screen X position to screen X (left) size (player 1)
00F4FC - Copy screen X position to screen X (left) size (player 2)
00F502 - Set screen Y size to 0400
00F508 - Set ??? to 0400
00F50E - Add 2 to EEDF (load boss)
00F51E - Return

011FE0 - Add 1 to rings (when collecting a ring)
01200C - Add 1 to lives (when collecting 100 or 200 rings)
012010 - Add 1 to lives counter