From Sonic Retro
|SCHG: Sonic Jam|
Animation Data starts at $1F7A0 in MUSEUM.MUS.
Animations consist of two distinct parts. The first part is the frames that make up the animation. The second part is a jump table, containing a list of offsets to the start of each frame, relative to the table.
The first word of a frame is a set of bit flags that define how much data is specified in the frame. If all the bits are set, the frame is empty. Here's its layout:
|$0001||No X rotations|
|$0002||No Y rotations|
|$0004||No Z rotations|
|$0008||No Global X positioning|
|$0010||No Global Y positioning|
|$0020||No Global Z positioning|
|$0040||No Global X rotation|
|$0080||No Global Y rotation|
|$0100||No Global Z rotation|
The rest of the frame consists of any elements that weren't culled by the flags. These first two elements will always be here, assuming a flag of $0000:
- Fixed point vector defining the model's global position.
- Set of 3 words defining the model's global rotation via euler angles.
Each subsequent element is 3 words defining the euler angles for each sub-model in the model this animation belongs to. For Sonic or Tails, this means:
- Body Rotation
- Head Rotation
- Right Thigh Rotation
- Right Calf Rotation
- Right Foot Rotation
- Left Thigh Rotation
- Left Calf Rotation
- Left Foot Rotation
- Right Bicep Rotation
- Right Forearm Rotation
- Right Hand Rotation
- Left Bicep Rotation
- Left Forearm Rotation
- Left Hand Rotation
- Tail Rotation
For any flags that are set, that part of the frame will be skipped. If, say, the No Y Rotations flag is set, all sub-model rotations will consist of two words in a row (an X and a Z angle), and then the next sub-model's rotations immediately after.
The jump table consists of a series of words. There will be one word for each frame in the animation, plus one $0000 word to mark the end of the table.
Each frame's word is the signed offset from the start of the table to get to the start of the frame in question. For example, the offset for the first frame of the falling animation is $F650. The offset for the last frame of the falling animation is $FFC2.
Here's the list of animations that are currently known. Addresses are to the start of the jump table for each.
Note: More research is needed for the Flicky and Monkey's animation frames. The information given on animation frames was gathered by studying Sonic's animations, and therefore likely doesn't directly apply to them because of different model layouts. Their animation frames are likely similarly formatted, but probably have different models attached to each flag/value.
|Diagonal Spring Launch||$27368|
|Pick Up Item 1||$2AC66|
|Start Enter Building||$2D6C8|
|Pick Up Item 2||$2F2F6|
|Put Item Away 1||$2FE42|
|Put Item Away 2||$3008E|
|Start Spring Fall||$3127C|