Difference between revisions of "Sonic Advance/Animation Format"
From Sonic Retro
MainMemory (talk | contribs) (Created page with "{{WIP}} The Sonic Advance animation format consists primarily of five pointers, in the following order: *[[#Palette, Tile, and Animation data|Palette, Tile, and Animation data...") |
MainMemory (talk | contribs) m |
||
Line 1: | Line 1: | ||
− | |||
The Sonic Advance animation format consists primarily of five pointers, in the following order: | The Sonic Advance animation format consists primarily of five pointers, in the following order: | ||
*[[#Palette, Tile, and Animation data|Palette, Tile, and Animation data]] | *[[#Palette, Tile, and Animation data|Palette, Tile, and Animation data]] | ||
− | *Mapping Frames data | + | *[[#Mapping Frames data|Mapping Frames data]] |
− | *Sprite Attribute data | + | *[[#Sprite Attribute data|Sprite Attribute data]] |
*Sprite palettes | *Sprite palettes | ||
*Sprite tiles | *Sprite tiles | ||
− | Sonic Advance 2 has one additional pointer of unknown purpose, and Sonic Advance 3 has two additional unknown pointers.<br /> | + | ''Sonic Advance 2'' has one additional pointer of unknown purpose, and ''Sonic Advance 3'' has two additional unknown pointers.<br /> |
The first three sections all begin with a list of pointers with length equal to the number of animations in the game (see below). | 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== | ||
+ | {| class="prettytable" | ||
+ | !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== | ==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.<br /> | 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.<br /> | ||
Line 28: | Line 37: | ||
|8||The time to display the frame (0..128) | |8||The time to display the frame (0..128) | ||
|- | |- | ||
− | |C||An index to the mapping | + | |C||An index to the [[#Mapping Frames data|mapping frames data]] array |
|- | |- | ||
|10 | |10 | ||
Line 37: | Line 46: | ||
|} | |} | ||
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. | 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|Palette, Tile, and Animation data]]: | ||
+ | {| class="prettytable" | ||
+ | !Offset!!Description | ||
+ | |- | ||
+ | |0||An index to the [[#Sprite Attribute data|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|Mapping Frames data]]: | ||
+ | {| class="prettytable" | ||
+ | !Offset!!Description | ||
+ | |- | ||
+ | |0||Attribute 0 | ||
+ | |- | ||
+ | |2||Attribute 1 | ||
+ | |- | ||
+ | |4||Attribute 2 | ||
+ | |} | ||
+ | For more information on the attributes, see [http://nocash.emubase.de/gbatek.htm#lcdobjoamattributes this document]. | ||
{{SCHGuides}} | {{SCHGuides}} | ||
[[Category:Sonic Community Hacking Guide|{{PAGENAME}}]] | [[Category:Sonic Community Hacking Guide|{{PAGENAME}}]] |
Revision as of 11:38, 6 September 2013
The Sonic Advance animation format consists primarily of five pointers, in the following order:
- Palette, Tile, and Animation data
- Mapping Frames data
- Sprite Attribute data
- Sprite palettes
- Sprite tiles
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).
Contents
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:
|
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.