Pokémon 3rd Generation: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Correction for false information.)
No edit summary
Line 1: Line 1:
''This is a work in progress by [[User:Kawa|Kawa]]. I'm keeping it all on this page for later splitting and standardizing if that's okay with you guys.''
<div align="center" style="padding-left: 10%; padding-right: 10%;"><big>''This is a work in progress by [[User:Kawa|Kawa]]. The content is being kept on this page to later be split and standardized.''</big></div>


The third generation Pokémon games comprise Pokémon Ruby, Sapphire, Emerald, Fire Red and Leaf Green. 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.
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.


=== Interesting locations in ROM ===
==Notable ROM data offsets==
{| style="border: #88a 1px solid; background: #fff; margin: auto; border-collapse: collapse;" cellspacing=1 cellpadding=3 border=1
<div align="center">
|- style="background: #ccf;"
{| class="wikitable" width="90%" height="auto" style="text-align: center;" cellspacing="1" cellpadding="3" border="1"
! Name
|-
! Fire Red
! colspan="2" width="25%" style="text-align: right;" | Description
! Ruby
! colspan="1" width="12.5%" | <span style="color: #FF7327;">'''FR'''</span>
! Notes
! colspan="1" width="12.5%" | <span style="color: #A00000;">'''R'''</span>
! colspan="4" width="50%" style="text-align: left;" | Notes
|-
|-
| Pokémon images
| colspan="2" width="25%" style="text-align: right;" | Battle sprites
| 0x2350AC
| colspan="1" width="12.5%" | <tt>$2350AC</tt>
| 0x1E8354
| colspan="1" width="12.5%" | <tt>$1E8354</tt>
| Pointer tables in system order
| colspan="4" width="50%" style="text-align: left;" | Pointer tables are in system order.
|-
|-
| Monster heights
| colspan="2" width="25%" style="text-align: right;" | Monster heights
| 0x235E6C
| 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''
|-
|-
| Pokémon images from the back
| colspan="2" width="25%" style="text-align: right;" | Battle back sprites
| 0x23654C
| colspan="1" width="12.5%" | <tt>$23654C</tt>
| 0x1E97F4
| colspan="1" width="12.5%" | <tt>$1E97F4</tt>
| rowspan="2" | Pointer tables in system order
| colspan="4" width="50%" style="text-align: left;" style="text-align: right;" | Pointer tables are in system order.
|-
|-
| Pokémon image palettes
| colspan="2" width="25%" style="text-align: right;" | Battle sprite palettes
| 0x23730C
| colspan="1" width="12.5%" | <tt>$23730C</tt>
| 0x1EA5b4
| colspan="1" width="12.5%" | <tt>$1EA5b4</tt>
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Pokémon alternate colors
| colspan="2" width="25%" style="text-align: right;" | Battle sprite shiny palettes
| 0x2380CC
| colspan="1" width="12.5%" | <tt>$2380CC</tt>
| 0x1EB374
| colspan="1" width="12.5%" | <tt>$1EB374</tt>
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Trainer images
| colspan="2" width="25%" style="text-align: right;" | Trainer sprites
| 0x23957C
| colspan="1" width="12.5%" | <tt>$23957C</tt>
| 0x1EC53C
| colspan="1" width="12.5%" | <tt>$1EC53C</tt>
| rowspan="2" | Pointer tables
| colspan="4" width="50%" style="text-align: left;" | Offset is a pointer table.
|-
|-
| Trainer palettes
| colspan="2" width="25%" style="text-align: right;" | Trainer palettes
| 0x239A1C
| colspan="1" width="12.5%" | <tt>$239A1C</tt>
| 0x1EC7D4
| colspan="1" width="12.5%" | <tt>$1EC7D4</tt>
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Trainer class names
| colspan="2" width="25%" style="text-align: right;" | Trainer Class names
| 0x23E558
| colspan="1" width="12.5%" | <tt>$23E558</tt>
| 0x1F0208
| colspan="1" width="12.5%" | <tt>$1F0208</tt>
|  
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Trainer data
| colspan="2" width="25%" style="text-align: right;" | Trainer data
| 0x23EAF1
| colspan="1" width="12.5%" | <tt>$23EAF1</tt>
| 0x1F0525
| colspan="1" width="12.5%" | <tt>$1F0525</tt>
| [http://helmet.kafuka.org/opwiki/Trainer_structure Trainer structure at the OpenPoké wiki]
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Pokémon species names
| colspan="2" width="25%" style="text-align: right;" | Pokémon Species names
| 0x245EE0
| colspan="1" width="12.5%" | <tt>$245EE0</tt>
| 0x1F7184
| colspan="1" width="12.5%" | <tt>$1F7184</tt>
| Listed in system order
| colspan="4" width="50%" style="text-align: left;" | Names are listed in system order.
|-
|-
| Move names
| colspan="2" width="25%" style="text-align: right;" | Move names
| 0x247094
| colspan="1" width="12.5%" | <tt>$247094</tt>
| 0x1F8320
| colspan="1" width="12.5%" | <tt>$1F8320</tt>
|  
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Ability names
| colspan="2" width="25%" style="text-align: right;" | Ability names
| 0x24FC4D
| colspan="1" width="12.5%" | <tt>$24FC4D</tt>
| 0x1FA26D
| colspan="1" width="12.5%" | <tt>$1FA26D</tt>
|  
| colspan="4" width="50%" style="text-align: left;" |  
|-
|-
| Move data
| colspan="2" width="25%" style="text-align: right;" | Move data
| 0x250C04
| colspan="1" width="12.5%" | <tt>$250C04</tt>
| 0x1FB12C
| colspan="1" width="12.5%" | <tt>$1FB12C</tt>
| Same order as their names
| colspan="4" width="50%" style="text-align: left;" | Data is stored in the same order as the move names.
|-
|-
| TM allowance sets
| colspan="2" width="25%" style="text-align: right;" | TM allowance sets
| 0x252BC8
| colspan="1" width="12.5%" | <tt>$252BC8</tt>
| 0x1FD0F0
| colspan="1" width="12.5%" | <tt>$1FD0F0</tt>
|  
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Pokémon base stats
| colspan="2" width="25%" style="text-align: right;" | Pokémon base stats
| 0x254784
| colspan="1" width="12.5%" | <tt>$254784</tt>
| 0x1FEC30
| colspan="1" width="12.5%" | <tt>$1FEC30</tt>
| rowspan="3" | Listed in system order
| colspan="4" width="50%" style="text-align: left;" | Stats are listed in system order.
|-
|-
| Move sets
| colspan="2" width="25%" style="text-align: right;" | Move sets
| 0x257496
| colspan="1" width="12.5%" | <tt>$257496</tt>
| 0x20192A
| colspan="1" width="12.5%" | <tt>$20192A</tt>
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Evolution chains
| colspan="2" width="25%" style="text-align: right;" | Evolution chains
| 0x25977C
| colspan="1" width="12.5%" | <tt>$25977C</tt>
| 0x203B90
| colspan="1" width="12.5%" | <tt>$203B90</tt>
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Party icons
| colspan="2" width="25%" style="text-align: right;" | Pokémon Party/box sprites
| 0x3D37A0
| colspan="1" width="12.5%" | <tt>$3D37A0</tt>
| 0x3BBD20
| colspan="1" width="12.5%" | <tt>$3BBD20</tt>
| Pointer table again, in system order
| 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
| 0x3D3740
| colspan="1" width="12.5%" | <tt>$3D3740</tt>
| 0xE966D8
| colspan="1" width="12.5%" | <tt>$E966D8</tt>
|  
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Party icon palette LUT
| colspan="2" width="25%" style="text-align: right;" | Party icon palette LUT
| 0x3D3E80
| colspan="1" width="12.5%" | <tt>$3D3E80</tt>
| 0x3BC400
| colspan="1" width="12.5%" | <tt>$3BC400</tt>
| Simple byte array
| colspan="4" width="50%" style="text-align: left;" | Simple byte array
|-
|-
| Item data
| colspan="2" width="25%" style="text-align: right;" | Item data
| 0x3DB028
| colspan="1" width="12.5%" | <tt>$3DB028</tt>
| 0x3C5580
| colspan="1" width="12.5%" | <tt>$3C5580</tt>
| [http://helmet.kafuka.org/opwiki/Item_structure Item structure at the OpenPoké wiki]
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| TM table
| colspan="2" width="25%" style="text-align: right;" | TM-to-Move table
| 0x45A5A4
| colspan="1" width="12.5%" | <tt>$45A5A4</tt>
| 0x376504
| colspan="1" width="12.5%" | <tt>$376504</tt>
| Maps TM numbers to moves
| colspan="4" width="50%" style="text-align: left;" | Maps TM numbers to moves
|-
|-
| Pokédex data
| colspan="2" width="25%" style="text-align: right;" | Pokédex data
| 0x44E850
| colspan="1" width="12.5%" | <tt>$44E850</tt>
| 0x3B1874
| colspan="1" width="12.5%" | <tt>$3B1874</tt>
| Confusingly, this is in national dex order. [http://helmet.kafuka.org/opwiki/Pokédex_entry_structure Pokédex entry structure at the OpenPoké wiki]
| colspan="4" width="50%" style="text-align: left;" | Pokédex data is in National Dex order.
|-
|-
| Footprints
| colspan="2" width="25%" style="text-align: right;" | Footprints
| 0x43FAB0
| colspan="1" width="12.5%" | <tt>$43FAB0</tt>
| 0x3B4EE4
| colspan="1" width="12.5%" | <tt>$3B4EE4</tt>
| Pointer table
| colspan="4" width="50%" style="text-align: left;" | Offset points to a pointer table
|-
|-
| Contest data
| colspan="2" width="25%" style="text-align: right;" | Contest data
| N/A
| colspan="1" width="12.5%" | <tt>N/A</tt>
| 0x3C9408
| colspan="1" width="12.5%" | <tt>$3C9408</tt>
|  
| colspan="4" width="50%" style="text-align: left;" | ''N/A''
|-
|-
| Cries
| colspan="2" width="25%" style="text-align: right;" | Cries
| 0x48C914
| colspan="1" width="12.5%" | <tt>$48C914</tt>
| 0x452590
| colspan="1" width="12.5%" | <tt>$452590</tt>
| M4A Voice Group-style pointer list. In system order?
| 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 Fire Red/Leaf Green) uncompressed. Monster front images in Emerald are 128 pixels tall to allow animation. In all games, certain monsters always have nonstandard heights (ie. Castform). Alternate colors (aka Shiny) are usually represented by the back-facing images since it makes an intuitive kind of sense.
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.
 
=== Text ===
A full lookup table can be found at the OpenPoké wiki: [http://helmet.kafuka.org/opwiki/Pokémon_Character_Set Pokémon Character Set]. That page does not include Thingy tables, but they can be produced.


=== Maps ===
===Maps===
Maps are split among banks, each bank roughly being one location. For example, there's 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 Pokémon Fire Red, the bank pointer list is at 0x3526A8. 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's the map header format, including example data from Pallet Town (B3M0, 0x350618):
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):
{| 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;"
Line 206: Line 214:
| 0
| 0
|}
|}
''[[User:Kawa|Kawa]] is not sure why there is both a pointer and an index to the same data (the map). Further studies will show.''


The map layout data is another header:
The map layout data is another header:

Revision as of 19:01, 1 December 2013

This is a work in progress by Kawa. The content is being kept on this page to later be split and standardized.

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.

Notable ROM data offsets

Description FR R 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):

Data type Description Example
Pointer Map data 0x082DD4C0
Pointer Event data 0x083B4E50
Pointer Map scripts 0x0816545A
Pointer Connections 0x0835276C
Short Music index 0x012C (Pallet Town)
Short Map pointer index? 0x004E
Byte Label index 0x58 ("Pallet Town")
Byte Something with Flash? 0x00
Byte Weather 0x02
Byte Type 0x01
Short ??? 0x0601
Byte Show label on entry 0
Byte Battle type? 0

The map layout data is another header:

Data type Description Example
Long Width in tiles 24
Long Height in tiles 20
Pointer Border 0x082DD0F8
Pointer Actual map data 0x082D1D00
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 7:9 instead of 8:8. The border data is technically the same format, but does not use attributes[check this].

Important Notice: The above statement is not accurate, at least not for Ruby. Tiles and attributes are broken up 6:10, not 7:9. For example, a map tile in Advance Map that shows as "block 1D4" with a movement permission of "01" will be represented in a hex editor as "D405", which is "1101 0100 0000 0101" in binary. To extract the tile you take the last 2 bits "01" and prepend that to the first 8 bits. This gives you "01 1101 0100", which is "1D4". Bits 9-14 are "000001" which gives a hex value of "1". - Joncom

Kawa is now left to ponder what to add next.