Actions

SCHG

Sonic Advance/Animation Format

From Sonic Retro

The Sonic Advance animation format consists primarily of five pointers, in the following order:

Sonic Advance 2 has one additional pointer of unknown purpose, and Sonic Advance 3 has two additional unknown pointers.
The first three sections all begin with a list of pointers with length equal to the number of animations in the game (see below).

Locations

Name Code Address Animation Count (dec.)
Sonic Advance US ASOE D868C 906
Sonic Advance 2 US A2NE F40D4 1133
Sonic Advance 3 US B3SE 3314F0 1524

Palette, Tile, and Animation data

Each animation's data begins with a list of pointers "sub-animations". I do not know how multiple sub-animations are used or how the game knows the number of sub-animations in each animation.
Each sub-animation begins with the following sequence of 32-bit integers:

  • -2 (probably a data type indicator)
  • The index in the sprite palettes to begin copying from
  • The number of entries to copy into the GBA's sprite palette
  • -1 (probably a data type indicator)
  • The index in the sprite tiles to begin copying from
  • The number of tiles to copy into the GBA's VRAM
  • -6 (probably a data type indicator)
  • An array of the following structure:
Offset Description
0 The index in the sprite tiles to begin copying from
4 The number of tiles to copy into the GBA's VRAM
8 The time to display the frame (0..128)
C An index to the mapping frames data array
10 Some kind of flag, possible values include:
  • -1: Normal
  • -3: End of animation, followed by some unknown value
  • -4: End of animation

The tile data in the first frame seems to be ignored in favor of the data in the header. Instead, the "number of tiles to copy" contains some weird value like 0x1006F0FA.

Mapping Frames data

Each animation's data consists of an array of the following structure of 16-bit integers, the length of which can be deduced from the indexes used by the Palette, Tile, and Animation data:

Offset Description
0 An index to the sprite attribute data array
4 The number of sprites in the frame
8 Probably the frame's width, doesn't seem to do anything
C Probably the frame's height, doesn't seem to do anything
10 X offset of frame relative to object's position
14 Y offset of frame relative to object's position

Sprite Attribute data

Each animation's data consists of an array of the following structure of 16-bit integers, the length of which can be deduced from the indexes used by the Mapping Frames data:

Offset Description
0 Attribute 0
2 Attribute 1
4 Attribute 2

For more information on the attributes, see this document.

Sonic Community Hacking Guide
General
Sonic Music Hacking Guide | SonED2 Manual
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic Eraser | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic 2 (Nick Arcade prototype) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (8-bit) | Sonic 2 & Knuckles | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Sonic 3 | Sonic & Knuckles | Sonic 3 & Knuckles | Sonic & Knuckles Collection | Sonic Crackers | Sonic 3D: Flickies' Island | Chaotix | Sonic R PC | Sonic Jam 6 | Sonic Advance | Sonic Advance 2 | Sonic Advance 3 | Sonic Battle | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Shadow the Hedgehog | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Generations
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | Subroutine Equivalency List | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | VDP Documentation | Official Sega 32X Documentation | Official Mega-CD Documentation | Official Sega Mega Drive Documentation