Sign Up
Romhack.me connects you to ROM Hackers around the world.

pokemon_getattr / decryptpoke notes

by

Firstly, read the relevant section from here:

http://www.romhack.me/database/23/fire-red-commonl...

0x00 - Pokémon ID
0x01 - Trainer IDs
0x02 - Nickname Max Length 10 (r6 should be the nickname's address)
0x03 - Font / Language
0x04 - Sanity
0x05 - Sanity
0x06 - Sanity
0x07 - OT Name Max Length 7
0x08 - Marks
0x09 - Checksum
0x0A - Filler
0x0B - Species
0x0C - Held Item
0x0D - Attack 1
0x0E - Attack 2
0x0F - Attack 3
0x10 - Attack 4
0x11 - PP 1
0x12 - PP 2
0x13 - PP 3
0x14 - PP 4
0x15 - PP Bonuses
0x16 - Coolness
0x17 - Beauty
0x18 - Cuteness
0x19 - Exp. Points
0x1A - HP EV
0x1B - Attack EV
0x1C - Defence EV
0x1D - Speed EV
0x1E - Sp. Attack EV
0x1F - Sp. Defence EV
0x20 - Happiness
0x21 - Smartness
0x22 - Pokérus Status
0x23 - Catch Location
0x24 - Catch Level
0x25 - Game of Origin
0x26 - Hometown / Poké Ball / Trainer Gender
0x27 - HP IV
0x28 - Attack IV
0x29 - Defence IV
0x2A - Speed IV
0x2B - Sp. Attack IV
0x2C - Sp. Defence IV
0x2D - IsEgg
0x2E - Ability Bit
0x2F - Toughness
0x30 - Sheen
0x31 - Trainer Gender
0x32 - Cool Ribbons
0x33 - Beauty Ribbons
0x34 - Cute Ribbons
0x35 - Smart Ribbons
0x36 - Tough Ribbons
0x37 - Status Ailment
0x38 - Level
0x39 - Current HP
0x3A - Total HP
0x3B - Attack
0x3C - Defence
0x3D - Speed
0x3E - Sp. Attack
0x3F - Sp. Defence
0x40 - Pokerus Remaining Byte
0x41 - Species
0x42 - IVs
0x43 - Champion Ribbon
0x44 - Winning Ribbon
0x45 - Victory Ribbon
0x46 - Artist Ribbon
0x47 - Effort Ribbon
0x48 - Special0 Ribbon
0x49 - Special1 Ribbon
0x4a - Special2 Ribbon
0x4b - Special3 Ribbon
0x4c - Special4 Ribbon
0x4d - Special5 Ribbon
0x4e - Special6 Ribbon
0x4f - Unknown Ribbons
0x50 - Obedience bit
0x51 - ??? <requires an addition parameter on r2>
0x52 - Ribbon Sum
0x53 - Ribbons
0x54 - Attack
0x55 - Defense
0x56 - Speed
0x57 - Sp. Attack
0x58 - Sp. Defense


Some (all?) should also work with pokemon_setattr / encryptpoke, or with Emerald, but I haven't looked into that.

Here's some additional notes to describe how things are returned, for those that return multiple things.

pokemon_getattr 0x42
(spdef << 0x19) | (spatk << 0x14) | (speed << 0xf) | (defense << 0xa) | (attack << 0x5) | hp

pokemon_getattr 0x4f:
(unk_0x1e) | (unk_0x1d) | (unk_0x1c << 1) | unk_0x1b

pokemon_getattr 0x53:
(special << 0x14) | (effort << 0x13) | (artist << 0x12) | (victory << 0x11) | (win << 0x10) | (tough << 0xd) | (smart << 0xa) | (cute << 0x7) | (beauty << 0x4) | (cool << 0x1) | champ

pokemon_getattr 0x52:
special + effort + artist + victory + win + tough + smart + cute + beauty + cool + champ

pokemon_getattr 0x51:
requires: a third parameter (supplied in r2, available in r6)