Sonic Jam/Animations
From Sonic Retro
SCHG: Sonic Jam |
---|
Main Article |
Sonic World |
Animation Data starts at $25F7C in MUSEUM.MUS.
Animation Format
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.
Animation Frames
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:
Bit | Description |
---|---|
$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 |
$0200 | Unused? |
$0400 | Unused? |
$0800 | Unused? |
$1000 | Unused? |
$2000 | Unused? |
$4000 | Unused? |
$8000 | Unused? |
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:
- 3D Vector defining the model's global position.
- Euler Rotation defining the model's global rotation.
Each subsequent element is an Euler Rotation 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 rotation), and then the next sub-model's rotations immediately after.
Jump Table
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.
Animation List
Here's the list of animations that are currently known. Addresses are to the start of the jump table for each.
Name | Address |
---|---|
Falling | $2692C |
Front-Flip Dive | $27046 |
Diagonal Spring Launch | $27368 |
Curl | $275B0 |
Sprinting | $277D0 |
Running | $$27BFE |
Uncurl | $27D56 |
Jump | $27F92 |
Start Idle | $28882 |
Idle | $28E1A |
Skid | $290AC |
Walking | $298FA |
Start Push | $29AD8 |
Push | $2A3A6 |
Open Door? | $2A728 |
Pick Up Item 1 | $2AC66 |
Push Button? | $2B0A2 |
Hang | $2BF22 |
Balancing | $2C924 |
Start Enter Building | $2D6C8 |
Enter Building | $2E5A8 |
Pick Up Item 2 | $2F2F6 |
Put Item Away 1 | $2FE42 |
Put Item Away 2 | $3008E |
Start Examine | $30860 |
Finish Examine | $30D3C |
Vertical Spring | $31162 |
Start Spring Fall | $3127C |
Spring Fall | $31666 |
Flying | $324CA |