Sonic 2 Hacking Guide
Binary - Demo Recording

To show off a game, developers record demo's. Many other people like to record their own demo's too when it's possible. This is one of the fun things you can do in the Sonic 2 ROM.

003D4E - Number of demo's to play
003DAC - Levels that are played during demo sequence
0042AA
- Number of frames that a demo plays (16-bit)
004948
- 32-bit address pointers for each level
004CA8 - Demo for EHZ (Sonic)
004D08 - Demo for EHZ (Tails)
004D68 - Demo for CNZ
004DD8 - Demo for CPZ
004E38 - Demo for ARZ

FORMAT:
#1 #2

1 - Keys pressed
2 - Frame count

For keys pressed, you simply need to know the Motorolla key format:

1 2 3 4 5 6 7 8 (this is a byte represented in bits)
S A C B U D L R (these are the bits translated to show what each key is)

With a 1, that means the button is being used (on) and with a 0, the button isn't being used.