Sign Up connects you to ROM Hackers around the world.

Fire Red Commonly Used ASM ROM Offsets


Pokémon Decrypter (Takes Pokémon's Address in R0 and R1 as an Index; Returns decrypted values to R0): 0x3FBE8
Pokémon Encrypter (Takes Pokémon's Address in R0 and R1 as an Index and the RAM Offset where you stored the value in R2): 0x4037C

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 - 
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 - 
0x32 - 
0x33 - 
0x34 - 
0x35 - 
0x36 - 
0x37 - Status Ailment
0x38 - Level
0x39 - Current HP
0x3A - Total HP
0x3B - Attack
0x3C - Defence
0x3D - Speed
0x3E - Sp. Attack
0x3F - Sp. Defence
0x40 - 
0x41 - Species

Wild Pokémon Generator: (Takes pokémon's Address in R0, Species in R1, Level in R2 and an Unknown Number in R3 (Usually 0x19 or 0x20): 0x3DD98

Flag Decrypter (Takes Flag ID in R0; Returns status of flag to R0): 0x6E6D0
Flag Setter (Takes Flag ID in R0; Returns nothing): 0x6E680
Flag Clearer (Takes Flag ID in R0; Returns nothing): 0x6E6A8

Variable Decrypter (Takes Variable ID in R0; Returns RAM Address of Variable to R0): 0x6E454

Random (Takes no parameters; Returns random 16-bit number to R0): 0x44EC8

DivMod1 (Takes in R0 as Numerator and R1 as Denominator; Returns INTEGER DIVISION (9/2 = 4 r 1) result to R0): 0x1E4018
DivMod2 (Takes in R0 as Numerator and R1 as Denominator; Returns REMAINDER OF INTEGER DIVISION (23/4 = 5 r 3 to R0): 0x1E4684

Pokémon Seen/Caught Flag Decryption/Setting (Takes species ID in R0 and R1 as an index (0: Check seen, 1: Check Caught, 2: Set Seen, 3: Set Caught); Returns result (If required) to R0): 0x104AB0

Credit to darthatron for the following offsets:

Playsong (Takes R0 as parameter, song to play; No Return value): 0x71A74

Playsound (Takes R0 as sound to play; No return value): 0x722CC

ChangeWeather (takes R0 as weather effect to start; No return value): 0x7B100

SetWeather (Actually implements the change in weather; Uses the value you gave "ChangeWeather" as the weather to change to): 0x7B1A4

Givepokemon Pokémon Generator: 0xA011C

GetTileAttribute (Takes x-coordinate in R0, y-coordinate in R1 and an index in R2): 0x58F48

GetWeather (No parameters, returns weather to R0): 0x7AF98
Hmm, when I try '0x26 - Hometown / Poké Ball / Trainer Gender' it returns only the pokeball. And when I track the place where it's used down in vba-sdl-h it also sets only the pokeball. So where's hometown and trainer gender?
daniilS I'm not sure on the specifics of it, I copied the list from HackMew. Maybe what it returns is dependent on context?
Could be. Also seems like hometown should be game of origin, since that is stored together with trainer gender, pokeball and level met. Or maybe it uses one of the unnamed indexes.
Nope, ida tells me level met, game of origin, pokeball, and trainer gender are each different entries in the table. Do you want the indexes?
Okay, 0x24 is catch level as stated, 0x25 is game of origin, 0x26 is pokeball, and 0x31 is trainer gender.
I will try to find some more.
All those are a single 16 bit value. Are you sure it doesn't return that 16 bit value?
Yes, I checked the code. It cuts off the other bits (in a quite inefficient way sometimes.)
Fair enough.