Pokémon Mystery Dungeon: Red Rescue Team/Pokémon Graphics/Overworld Animations

From Data Crystal
Jump to navigation Jump to search

This is a sub-page of Pokémon Mystery Dungeon: Red Rescue Team/Pokémon Graphics.

Pokémon Graphics: Overworld Animations
Game Pokémon Mystery Dungeon: Red Rescue Team
Start Address 0x0511F30
End Address 0x167FE77
# of Entries 423
Entry Length varies
Total Length 18276168 bytes (0x116DF48)
Back to the ROM map

There are 423 SIRO files pointed to by the Pokémon Graphics Pointer Table. Each one represents a different Pokemon graphics file. The structure of these individual files is as follows.

Header

  • Note - all pointers are stored in little-endian format.
Address   Size     Description
--------  ----   ----------------
0000      0004    SIRO Header - Spells out SIRO and begins file.
0004      0004    Pointer to footer - Points to main data structure in each Pokemon

Animation Data Before Sprites

There are two sections before the sprites begin.

Animation Frame

Comes in 0x14 byte increments which each represent a frame of the animation.

Address   Size     Description
--------  ----   ----------------
0000      0001    The index of the sprite to be displayed.
0001      0001    Values less than 0x07 crash the game
0002      0001    Does Palette Effects - Use unknown
0003      0001    Unknown
0004      0001    Vertical Displacement
0005      0001    Tile Byte - Tells how many tiles wide to write the sprite.
                      01 - 4 wide
                      81 - 2 wide
0006      0001    Horizontal Displacement
0007      0001    Flip byte - Tells which direction the sprite is flipped 
                  80 Normal
                  90 Horizontal Flip
                  A0 makes a vertical flip.
                  B0 makes vertical and horizontal
                  Other options may be used for different Pokemon sizes
0008      0002    Little endian offset to tell where to start reading sprite in VRAM - Usually 00 3C
000A      000A    Allows VRAM to be cleared. Usually all FFs

Animation Timing

The next section deals with animation timing in the following format:

Total Size: 0x0C

Address   Size     Description
--------  ----   ----------------
0000      0001   Number of frames to display sprite.
0001      0001   Unknown; Usually only 0x00
0002      0002   Index of sprite to be displayed.
0004      0002   Horizontal Displacement    -Signed Short
0006      0002   Vertical Displacement      -Signed Short
0008      0002   Shadow Horizontal Displacement    -Signed Short
000A      0002   Shadow Vertical Displacement      -Signed Short

Overworld Sprites

Every Sprite has data associated with it.

The sprite data pointers in the data after the sprites point to each individual sprite's data.

When the sprite data pointer points at the individual sprite pointer, this is the format:

Address   Size     Description
--------  ----   ----------------
0000      0004   Pointer to individual sprite
0004      0002   Number of bytes to read (little endian)

When the sprite pointer points at 4 bytes with the value 00, this is the format:

Address   Size     Description
--------  ----   ----------------
{
  0000      0004   0x00
  0004      0004   Amount of blank space written before sub sprite.
  0008      0004   Pointer to individual sprite
  000C      0004   Number of bytes to be read (little endian)
}
Repeats until every sub sprite has been pointed to.

After every sub sprite has been pointed to, sometimes there is an additional blank space offset without a sprite attached:

Address   Size     Description
--------  ----   ----------------
{
  0000      0004   0x00
  0004      0004   Amount of blank space written before sub sprite.
  0008      0008   0x00
}
Visual representation of sprite layout.

Data After Sprites

Following the sprites are six sections with different information:

  1. Table of pointers to the animation data.
  2. Unknown data
  3. Pointers to directional animation timing data.
  4. Pointers to (#3) each set of directional animations
  5. Pointers to Sprite Data
  6. The Footer

Unknown Data(Section 2)

Seems to have an effect on the emotional icons that appear over characters' heads. Made up of repeating one byte units of 0xF or 0x0 followed by any number.

Animation Data (Section 3)

A repeating set of little-endian pointers that will point to an animation for any direction.

Index Direction Pointed to
----- --------------------
0x00:  S, SE, E, NE,
0x10:  N, NW, W, SW

Footer (Section 6)

The header points to another set of pointers starting here and ending at the next SIRO file.

Address   Size     Description
--------  ----   ----------------
0000      0004   Section 1 after sprites: Pointer to animation timing table.
0004      0004   Pointer to Section 3 After Sprites - Animations - Different animations can be chosen based upon direction.
0008      0004   Unknown
000C      0004   Sprite Data Pointer (Section 5 After Sprites)
0010      0004   Pointer to (Section 2 After Sprites) Unknown Data
0014      0004   SIRO Header of next Pokemon