Pokémon data structure (Generation III): Difference between revisions
Tiddlywinks (talk | contribs) m (direct link) |
m (→Data Location) |
||
Line 123: | Line 123: | ||
The three sleep bits are used to indicate turns of sleep. So 111<sub>2</sub> = 7 turns of sleep, 101<sub>2</sub> = 5 turns, et cetera. | The three sleep bits are used to indicate turns of sleep. So 111<sub>2</sub> = 7 turns of sleep, 101<sub>2</sub> = 5 turns, et cetera. | ||
==Data | ==Data location== | ||
{{incomplete|section|Are the addresses below only for US games?}} | {{incomplete|section|Are the addresses below only for US games?}} | ||
A Trainer's [[party]] starts at the following addresses in the GBA's RAM. | A Trainer's [[party]] starts at the following addresses in the GBA's RAM. |
Revision as of 17:44, 17 November 2014
Pokémon in the Pokémon Ruby and Sapphire, FireRed and LeafGreen, and Emerald Versions are all stored the same way in a 100-byte structure.
Notes
Pokémon | ||
---|---|---|
type | offset | |
Personality value | dword | 0 |
OT ID | dword | 4 |
Nickname | 10 bytes | 8 |
Language | word | 18 |
OT name | 7 bytes | 20 |
Markings | byte | 27 |
Checksum | word | 28 |
???? | word | 30 |
Data | 48 bytes | 32 |
Status condition | dword | 80 |
Level | byte | 84 |
Pokérus remaining | byte | 85 |
Current HP | word | 86 |
Total HP | word | 88 |
Attack | word | 90 |
Defense | word | 92 |
Speed | word | 94 |
Sp. Attack | word | 96 |
Sp. Defense | word | 98 |
Personality value
The personality value controls many things, including gender, Unown's letter, Spinda's dots, any Pokémon's Nature, and more.
OT ID
The Original Trainer's ID number. This number is part of the XOR encryption key for the data section, and is also used in Shiny determination and the lottery.
Nickname
The Pokémon's nickname, limited to 10 characters. The characters represented by each byte are determined by the proprietary character set.
Language
The language of the game the Pokémon comes from. Valid values are:
Hex | Language |
---|---|
0x0201 | Japanese |
0x0202 | English |
0x0203 | French |
0x0204 | Italian |
0x0205 | German |
0x0206 | Korean* |
0x0207 | Spanish |
OT name
The name of the Pokémon's Original Trainer. The characters represented by each byte are determined by the proprietary character set.
Markings
The markings seen in the storage Box. These markings serve only to aid in organizing large collections of Pokémon.
Bit | Mark |
---|---|
0 | ● |
1 | ■ |
2 | ▲ |
3 | ♥ |
Checksum
The checksum for the 48-byte data section of this structure. It is computed by adding all of the unencrypted values of that section one word at a time. If the computed sum and the stored checksum do not match, the Pokémon is interpreted as a Bad Egg.
????
Unknown, possibly simply padding (not used and usually set to either 0 or -1, depending on the data type).
Data
Certain data pertaining to the Pokémon that is stored in a special and encrypted format.
Status condition
The Pokémon's status condition is stored as follows:
Bit | Status | |
---|---|---|
0-2 | SLP | Sleep |
3 | PSN | Poison |
4 | BRN | Burn |
5 | FRZ | Freeze |
6 | PAR | Paralysis |
7 | PSN | Bad Poison |
The three sleep bits are used to indicate turns of sleep. So 1112 = 7 turns of sleep, 1012 = 5 turns, et cetera.
Data location
This section is incomplete. Please feel free to edit this section to add missing information and complete it. Reason: Are the addresses below only for US games? |
A Trainer's party starts at the following addresses in the GBA's RAM.
Game | Address |
---|---|
Ruby | 0x03004360 |
Sapphire | |
Emerald | 0x02024190 0x020244ECUS |
FireRed | 0x02024284 |
LeafGreen | 0x020241e4 |
An opponent's party, or a wild Pokémon, starts at the following addresses.
Game | Address |
---|---|
Emerald | 0x02024744 |
FireRed | 0x0202402C |
The 600 bytes following these addresses describe a whole team of 6 Pokémon.
The full 100-byte structure for a Pokémon is only used to describe Pokémon being held in the player's party. When Pokémon are stored in the PC, their data is recorded using only the first 80 bytes of this structure, stopping after the data field. The last 20 bytes (excepting status condition) can all be recalculated from data in the data substructure when a Pokémon is withdrawn (level being derived from experience). This also explains why Pokémon suffering a status condition are "cured" when put in the PC.
This means there are also 33,600 bytes (80 bytes * 30 per Box * 14 Boxes) elsewhere in the GBA's RAM describing Pokémon in the PC. When the GBA's saved state (including memory contents) is unzipped into a 740,000+ byte file and viewed, the 14 Boxes of 420 Pokémon are stored in the general region of $038000 and $040000.
See also
Links
|
This data structure article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games. |