The current URL is datacrystal.tcrf.net.
Pokémon 3rd Generation: Difference between revisions
(Correction for false information.) |
Lelegofrog (talk | contribs) mNo edit summary |
||
(26 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
{{Needswork|note=The content is on this page needs to be moved, organized, and/or standardized.}} | |||
[[Category:Game Boy Advance games]] | |||
The third generation Pokémon games are comprised of Ruby, Sapphire, Emerald, FireRed and LeafGreen. Since all five share a common set of data structures with only some offsets and minor details in difference, it seems more effective to consider them one single "game" and note the differences where applicable. | |||
== Subpages == | |||
{{subpage|Pokémon FireRed and LeafGreen|text=}} | |||
{{subpage|Pokémon Ruby Sapphire and Emerald|text=7.8/10 too much water}} | |||
==Notable ROM data offsets== | |||
<div align="center"> | |||
{| class="wikitable" width="90%" height="auto" style="text-align: center;" cellspacing="1" cellpadding="3" border="1" | |||
{| style=" | |||
|- | |- | ||
| | ! colspan="2" width="25%" style="text-align: right;" | Description | ||
| | ! colspan="1" width="12.5%" | <span style="color: #FF7327;">'''Fire Red'''</span> | ||
| | ! colspan="1" width="12.5%" | <span style="color: #A00000;">'''Ruby'''</span> | ||
| | ! colspan="4" width="50%" style="text-align: left;" | Notes | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Battle sprites | ||
| | | colspan="1" width="12.5%" | <tt>$2350AC</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1E8354</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | Pointer tables are in system order. | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Monster heights | ||
| | | colspan="1" width="12.5%" | <tt>$235E6C</tt> | ||
| | | colspan="1" width="12.5%" | <tt>Unknown</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Battle back sprites | ||
| | | colspan="1" width="12.5%" | <tt>$23654C</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1E97F4</tt> | ||
| colspan="4" width="50%" style="text-align: left;" style="text-align: right;" | Pointer tables are in system order. | |||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Battle sprite palettes | ||
| | | colspan="1" width="12.5%" | <tt>$23730C</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1EA5b4</tt> | ||
| colspan="4" width="50%" style="text-align: left;" | ''N/A'' | |||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Battle sprite shiny palettes | ||
| | | colspan="1" width="12.5%" | <tt>$2380CC</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1EB374</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| Trainer | | colspan="2" width="25%" style="text-align: right;" | Trainer sprites | ||
| | | colspan="1" width="12.5%" | <tt>$23957C</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1EC53C</tt> | ||
| colspan="4" width="50%" style="text-align: left;" | Offset is a pointer table. | |||
|- | |- | ||
| Trainer | | colspan="2" width="25%" style="text-align: right;" | Trainer palettes | ||
| | | colspan="1" width="12.5%" | <tt>$239A1C</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1EC7D4</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| Trainer | | colspan="2" width="25%" style="text-align: right;" | Trainer Class names | ||
| | | colspan="1" width="12.5%" | <tt>$23E558</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1F0208</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Trainer data | ||
| | | colspan="1" width="12.5%" | <tt>$23EAF1</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1F0525</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Pokémon Species names | ||
| | | colspan="1" width="12.5%" | <tt>$245EE0</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1F7184</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | Names are listed in system order. | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Move names | ||
| | | colspan="1" width="12.5%" | <tt>$247094</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1F8320</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Ability names | ||
| | | colspan="1" width="12.5%" | <tt>$24FC4D</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1FA26D</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Move data | ||
| | | colspan="1" width="12.5%" | <tt>$250C04</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1FB12C</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | Data is stored in the same order as the move names. | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | TM allowance sets | ||
| | | colspan="1" width="12.5%" | <tt>$252BC8</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1FD0F0</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Pokémon base stats | ||
| | | colspan="1" width="12.5%" | <tt>$254784</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$1FEC30</tt> | ||
| colspan="4" width="50%" style="text-align: left;" | Stats are listed in system order. | |||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Move sets | ||
| | | colspan="1" width="12.5%" | <tt>$257496</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$20192A</tt> | ||
| colspan="4" width="50%" style="text-align: left;" | ''N/A'' | |||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Evolution chains | ||
| | | colspan="1" width="12.5%" | <tt>$25977C</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$203B90</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| Party | | colspan="2" width="25%" style="text-align: right;" | Pokémon Party/box sprites | ||
| | | colspan="1" width="12.5%" | <tt>$3D37A0</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$3BBD20</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | | ||
Offset points to a pointer table. | |||
Data is in system order. | |||
|- | |- | ||
| Party icon palette | | colspan="2" width="25%" style="text-align: right;" | Party icon palette | ||
| | | colspan="1" width="12.5%" | <tt>$3D3740</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$E966D8</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Party icon palette LUT | ||
| | | colspan="1" width="12.5%" | <tt>$3D3E80</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$3BC400</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | Simple byte array | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Item data | ||
| | | colspan="1" width="12.5%" | <tt>$3DB028</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$3C5580</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | TM-to-Move table | ||
| | | colspan="1" width="12.5%" | <tt>$45A5A4</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$376504</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | Maps TM numbers to moves | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Pokédex data | ||
| | | colspan="1" width="12.5%" | <tt>$44E850</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$3B1874</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | Pokédex data is in National Dex order. | ||
|- | |- | ||
| | | colspan="2" width="25%" style="text-align: right;" | Footprints | ||
| | | colspan="1" width="12.5%" | <tt>$43FAB0</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$3B4EE4</tt> | ||
| | | colspan="4" width="50%" style="text-align: left;" | Offset points to a pointer table | ||
|- | |- | ||
| Cries | | colspan="2" width="25%" style="text-align: right;" | Contest data | ||
| | | colspan="1" width="12.5%" | <tt>N/A</tt> | ||
| | | colspan="1" width="12.5%" | <tt>$3C9408</tt> | ||
| M4A Voice Group-style pointer list. In system order? | | colspan="4" width="50%" style="text-align: left;" | ''N/A'' | ||
|- | |||
| colspan="2" width="25%" style="text-align: right;" | Cries | |||
| colspan="1" width="12.5%" | <tt>$48C914</tt> | |||
| colspan="1" width="12.5%" | <tt>$452590</tt> | |||
| colspan="4" width="50%" style="text-align: left;" | M4A Voice Group-style pointer list. In system order? | |||
|} | |} | ||
</div> | |||
Following the Pokémon image pointers, you may notice that each species has all its image data in one chunk. | Following the Pokémon image pointers, you may notice that each species has all its image data in one chunk. | ||
More information on the data structures can be found at Bulbapedia: [http://bulbapedia.bulbagarden.net/wiki/Category:Structures Category:Structures] | More information on the data structures can be found at Bulbapedia: [http://bulbapedia.bulbagarden.net/wiki/Category:Structures Category:Structures] | ||
=== Images === | ===Images=== | ||
Trainer and monster images are LZ77-compressed 64 by 64 pixels, 16 colors. Trainers' back-facing images are much taller and (in | Trainer and monster images are LZ77-compressed 64 by 64 pixels, 16 colors. Trainers' back-facing images are much taller and (in FireRed/LeafGreen) uncompressed. Monster front images in Emerald are 128 pixels tall to allow animation. In all games, certain monsters always have nonstandard heights (i.e. Castform). Alternate colors (aka shiny) are usually represented by the back-facing images since it makes an intuitive kind of sense. | ||
===Maps=== | |||
Maps are split among banks, each bank roughly being one location. For example, there is a bank with all the cities and routes and several banks with each city's interiors. Generally, a map can be defined by a Doom-like "bank X, map Y" scheme. In FireRed, the bank pointer list is at $3526A8. Following one of the pointers found there yields that bank's map pointer list, which can be followed to a given map's header. Here is the map header format, including example data from Pallet Town (B3M0, 0x350618): | |||
=== Maps === | |||
Maps are split among banks, each bank roughly being one location. For example, there | |||
{| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1 | {| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1 | ||
|- style="background: #ccf;" | |- style="background: #ccf;" | ||
! Byte order | |||
! Data type | ! Data type | ||
! Description | ! Description | ||
! Example | ! Example | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| Map data | | Map data | ||
| 0x082DD4C0 | | 0x082DD4C0 | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| Event data | | Event data | ||
| 0x083B4E50 | | 0x083B4E50 | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| Map scripts | | Map scripts | ||
| 0x0816545A | | 0x0816545A | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| Connections | | Connections | ||
| 0x0835276C | | 0x0835276C | ||
|- | |- | ||
| Little endian | |||
| Short | | Short | ||
| Music index | | Music index | ||
| 0x012C (Pallet Town) | | 0x012C (Pallet Town) | ||
|- | |- | ||
| Little endian | |||
| Short | | Short | ||
| ''Map pointer index?'' | | ''Map pointer index?'' | ||
| 0x004E | | 0x004E | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| Label index | | Label index | ||
| 0x58 ("Pallet Town") | | 0x58 ("Pallet Town") | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| | | Visibility (i.e HM Flash) | ||
| 0x00 | | 0x00 | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| Weather | | Weather | ||
| 0x02 | | 0x02 | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| | | Map type (City? Village? etc) | ||
| 0x01 | | 0x01 | ||
|- | |- | ||
| Little endian | |||
| Short | | Short | ||
| ''???'' | | ''???'' | ||
| 0x0601 | | 0x0601 | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| Show label on entry | | Show label on entry | ||
| 0 | | 0 | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| | | In-battle field model id | ||
| 0 | | 0 | ||
|} | |} | ||
The map layout data is another header: | The map layout data is another header: | ||
{| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1 | {| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1 | ||
|- style="background: #ccf;" | |- style="background: #ccf;" | ||
! Byte order | |||
! Data type | ! Data type | ||
! Description | ! Description | ||
! Example | ! Example | ||
|- | |- | ||
| | | Little endian | ||
| Integer | |||
| Width in tiles | | Width in tiles | ||
| 24 | | 24 | ||
|- | |- | ||
| | | Little endian | ||
| Integer | |||
| Height in tiles | | Height in tiles | ||
| 20 | | 20 | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| Border | | Border | ||
| 0x082DD0F8 | | 0x082DD0F8 | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| | | Map data / Tile structure | ||
| | | 0x082DD100 | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| Global tileset | | Global tileset | ||
| 0x082D4A94 (outside) | | 0x082D4A94 (outside) | ||
|- | |- | ||
| | |||
| Pointer | | Pointer | ||
| Local tileset | | Local tileset | ||
| 0x082D4AAC | | 0x082D4AAC | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| Border width | | Border width | ||
| 2 | | 2 | ||
|- | |- | ||
| | |||
| Byte | | Byte | ||
| Border height | | Border height | ||
Line 250: | Line 283: | ||
Border size is only in FireRed/LeafGreen. In R/S/E it is missing and borders are always 2x2 squares. | Border size is only in FireRed/LeafGreen. In R/S/E it is missing and borders are always 2x2 squares. | ||
Map data is quite straightforward: each 16-bit entry encodes the tile number and attribute. The trick is that there are only 64 attributes and 512 tiles, so the 16-bit entry is split up | Map data is quite straightforward: each 16-bit entry encodes the tile number and attribute. The trick is that there are only 64 attributes and 512 tiles, so the 16-bit entry is split up 6:10 instead of 8:8 for Ruby, Fire Red, and additionally Emerald. The border data is the same format and includes data although it may or may not be used by the game. | ||
TilesetHeader is stored in the following format: | |||
{| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1 | |||
|- style="background: #ccf;" | |||
! Byte order | |||
! Data type | |||
! Description | |||
! Example | |||
|- | |||
| | |||
| Byte | |||
| Compressed 0/1 | |||
| 0x1 | |||
|- | |||
| | |||
| Byte | |||
| Is primary 0/1 | |||
| 0x0 | |||
|- | |||
| | |||
| Byte | |||
| Unknown | |||
| ? | |||
|- | |||
| | |||
| Byte | |||
| Unknown | |||
| ? | |||
|- | |||
| Little endian | |||
| Integer | |||
| Pointer to tileset image | |||
| 0x08EA1D68 | |||
|- | |||
| Little endian | |||
| Integer | |||
| Pointer to color palettes | |||
| 0x08EA1B68 | |||
|- | |||
| Little endian | |||
| Integer | |||
| Pointer to blocks | |||
| 0x0829F6C8 | |||
|- | |||
| Little endian | |||
| Integer | |||
| Pointer to animation routine (only if exist, else null) | |||
| 0x08070155 | |||
|- | |||
| Little endian | |||
| Integer | |||
| Pointer to behavior and background bytes | |||
| 0x082A1EC8 | |||
|} | |||
Connection data is stored in the following format: | |||
{| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1 | |||
|- style="background: #ccf;" | |||
! Byte order | |||
! Data type | |||
! Description | |||
! Example | |||
|- | |||
| Little endian | |||
| Integer | |||
| Amount of map connections | |||
| 0x2 | |||
|- | |||
| Little endian | |||
| Integer | |||
| Pointer to connection data | |||
| 0x0835276C | |||
|} | |||
The actual connection data is formatted in sequence in this format for each connection: | |||
{| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1 | |||
|- style="background: #ccf;" | |||
! Byte order | |||
! Data type | |||
! Description | |||
! Example | |||
|- | |||
| Little endian | |||
| Integer | |||
| Connection direction | |||
| 0x2 | |||
|- | |||
| Little endian | |||
| Integer | |||
| Offset (In reference to connecting map) | |||
| 0x0 | |||
|- | |||
| | |||
| Byte | |||
| Map Bank | |||
| 0x3 | |||
|- | |||
| | |||
| Byte | |||
| Map Number | |||
| 0x14 | |||
|- | |||
| Little endian | |||
| Short | |||
| Filler | |||
| 0x0000 | |||
|} | |||
Connection directions are either 0x0 for '''no connection''', 0x1 for '''Down''', 0x2 for '''Up''', 0x3 for '''Left''', 0x4 for '''Right''', 0x5 for '''Dive''', or 0x6 for '''Emerge'''. Dive and Emerge connections are valid in Fire Red but do not work without custom ASM for the proper tiles. |
Latest revision as of 22:03, 26 May 2024
The content is on this page needs to be moved, organized, and/or standardized.
See the Talk Page for discussion. |
The third generation Pokémon games are comprised of Ruby, Sapphire, Emerald, FireRed and LeafGreen. Since all five share a common set of data structures with only some offsets and minor details in difference, it seems more effective to consider them one single "game" and note the differences where applicable.
Subpages
Pokémon FireRed and LeafGreen |
Pokémon Ruby Sapphire and Emerald 7.8/10 too much water |
Notable ROM data offsets
Description | Fire Red | Ruby | Notes | ||||
---|---|---|---|---|---|---|---|
Battle sprites | $2350AC | $1E8354 | Pointer tables are in system order. | ||||
Monster heights | $235E6C | Unknown | N/A | ||||
Battle back sprites | $23654C | $1E97F4 | Pointer tables are in system order. | ||||
Battle sprite palettes | $23730C | $1EA5b4 | N/A | ||||
Battle sprite shiny palettes | $2380CC | $1EB374 | N/A | ||||
Trainer sprites | $23957C | $1EC53C | Offset is a pointer table. | ||||
Trainer palettes | $239A1C | $1EC7D4 | N/A | ||||
Trainer Class names | $23E558 | $1F0208 | N/A | ||||
Trainer data | $23EAF1 | $1F0525 | N/A | ||||
Pokémon Species names | $245EE0 | $1F7184 | Names are listed in system order. | ||||
Move names | $247094 | $1F8320 | N/A | ||||
Ability names | $24FC4D | $1FA26D | |||||
Move data | $250C04 | $1FB12C | Data is stored in the same order as the move names. | ||||
TM allowance sets | $252BC8 | $1FD0F0 | N/A | ||||
Pokémon base stats | $254784 | $1FEC30 | Stats are listed in system order. | ||||
Move sets | $257496 | $20192A | N/A | ||||
Evolution chains | $25977C | $203B90 | N/A | ||||
Pokémon Party/box sprites | $3D37A0 | $3BBD20 |
Offset points to a pointer table. Data is in system order. | ||||
Party icon palette | $3D3740 | $E966D8 | N/A | ||||
Party icon palette LUT | $3D3E80 | $3BC400 | Simple byte array | ||||
Item data | $3DB028 | $3C5580 | N/A | ||||
TM-to-Move table | $45A5A4 | $376504 | Maps TM numbers to moves | ||||
Pokédex data | $44E850 | $3B1874 | Pokédex data is in National Dex order. | ||||
Footprints | $43FAB0 | $3B4EE4 | Offset points to a pointer table | ||||
Contest data | N/A | $3C9408 | N/A | ||||
Cries | $48C914 | $452590 | M4A Voice Group-style pointer list. In system order? |
Following the Pokémon image pointers, you may notice that each species has all its image data in one chunk.
More information on the data structures can be found at Bulbapedia: Category:Structures
Images
Trainer and monster images are LZ77-compressed 64 by 64 pixels, 16 colors. Trainers' back-facing images are much taller and (in FireRed/LeafGreen) uncompressed. Monster front images in Emerald are 128 pixels tall to allow animation. In all games, certain monsters always have nonstandard heights (i.e. Castform). Alternate colors (aka shiny) are usually represented by the back-facing images since it makes an intuitive kind of sense.
Maps
Maps are split among banks, each bank roughly being one location. For example, there is a bank with all the cities and routes and several banks with each city's interiors. Generally, a map can be defined by a Doom-like "bank X, map Y" scheme. In FireRed, the bank pointer list is at $3526A8. Following one of the pointers found there yields that bank's map pointer list, which can be followed to a given map's header. Here is the map header format, including example data from Pallet Town (B3M0, 0x350618):
Byte order | Data type | Description | Example |
---|---|---|---|
Pointer | Map data | 0x082DD4C0 | |
Pointer | Event data | 0x083B4E50 | |
Pointer | Map scripts | 0x0816545A | |
Pointer | Connections | 0x0835276C | |
Little endian | Short | Music index | 0x012C (Pallet Town) |
Little endian | Short | Map pointer index? | 0x004E |
Byte | Label index | 0x58 ("Pallet Town") | |
Byte | Visibility (i.e HM Flash) | 0x00 | |
Byte | Weather | 0x02 | |
Byte | Map type (City? Village? etc) | 0x01 | |
Little endian | Short | ??? | 0x0601 |
Byte | Show label on entry | 0 | |
Byte | In-battle field model id | 0 |
The map layout data is another header:
Byte order | Data type | Description | Example |
---|---|---|---|
Little endian | Integer | Width in tiles | 24 |
Little endian | Integer | Height in tiles | 20 |
Pointer | Border | 0x082DD0F8 | |
Pointer | Map data / Tile structure | 0x082DD100 | |
Pointer | Global tileset | 0x082D4A94 (outside) | |
Pointer | Local tileset | 0x082D4AAC | |
Byte | Border width | 2 | |
Byte | Border height | 2 |
Border size is only in FireRed/LeafGreen. In R/S/E it is missing and borders are always 2x2 squares.
Map data is quite straightforward: each 16-bit entry encodes the tile number and attribute. The trick is that there are only 64 attributes and 512 tiles, so the 16-bit entry is split up 6:10 instead of 8:8 for Ruby, Fire Red, and additionally Emerald. The border data is the same format and includes data although it may or may not be used by the game.
TilesetHeader is stored in the following format:
Byte order | Data type | Description | Example |
---|---|---|---|
Byte | Compressed 0/1 | 0x1 | |
Byte | Is primary 0/1 | 0x0 | |
Byte | Unknown | ? | |
Byte | Unknown | ? | |
Little endian | Integer | Pointer to tileset image | 0x08EA1D68 |
Little endian | Integer | Pointer to color palettes | 0x08EA1B68 |
Little endian | Integer | Pointer to blocks | 0x0829F6C8 |
Little endian | Integer | Pointer to animation routine (only if exist, else null) | 0x08070155 |
Little endian | Integer | Pointer to behavior and background bytes | 0x082A1EC8 |
Connection data is stored in the following format:
Byte order | Data type | Description | Example |
---|---|---|---|
Little endian | Integer | Amount of map connections | 0x2 |
Little endian | Integer | Pointer to connection data | 0x0835276C |
The actual connection data is formatted in sequence in this format for each connection:
Byte order | Data type | Description | Example |
---|---|---|---|
Little endian | Integer | Connection direction | 0x2 |
Little endian | Integer | Offset (In reference to connecting map) | 0x0 |
Byte | Map Bank | 0x3 | |
Byte | Map Number | 0x14 | |
Little endian | Short | Filler | 0x0000 |
Connection directions are either 0x0 for no connection, 0x1 for Down, 0x2 for Up, 0x3 for Left, 0x4 for Right, 0x5 for Dive, or 0x6 for Emerge. Dive and Emerge connections are valid in Fire Red but do not work without custom ASM for the proper tiles.