Pokémon FireRed/LeafGreen predefined functions list

From Glitch City Wiki
Jump to navigation Jump to search
This article or section is a stub. You can help Glitch City Wiki by expanding it.


All function and variable numbers in this article are hexadecimal.

All functions technically have a return value (which is ignored of they are called with the special (0x25) script opcode, or stored in a variable like LASTRESULT if called with special2 (0x26)), although not all of them return a meaningful value and output instead 0x9F69 (or 0xADC1 for stubbed out ones); for the purpose of this article they will be segregated.

Regardless of how they are called, all functions are unsandboxed and can freely read or write memory; indeed, a fair number of them does accept and/or return parameters at a fixed location (usually a subset of temporary variables, chiefly the 8004-8006 range). It's also not uncommon for them to directly read or write the game's state.

Void functions

  • 000 heals the entire team
  • 01F used immediately before 199 to cancel multiplayer link setup
  • 077 load Heracross's size record in the 3rd string buffer
  • 0C4 display Trainer Tower records (with 8004 = 1)
  • 0F6 check for DLC trainer availability?
  • 110 start ending sequence (saving and displaying current team into Hall of Fame, player/rival/Oak walking out of League, credits, soft reset)
  • 163 register Pokémon with index number stored in 8004 as seen
  • 173 unlock information in Fame Checker (variable 8004: character [0-?]; 8005: fact number [0-5?])
  • 174 unlock character in Fame Checker (variable 8004: character [0-?]; 8005: "seen" = hearsay [1] or "caught" = interacted with [2])
  • 182 unknown, used in Saffron Pokémon Center map script
  • 187 unknown, used by {the imitating girl in Saffron}, Pokémart workers, etc
  • 195 display Pokémon Jump minigame records
  • 199 used after 01F to cancel multiplayer link setup
  • 1A6 display Dodrio's Berry Picking minigame records
  • 1B9 clear a range of flags (A4 up to AC), all initially enabled and used as the hide/show status of Lorelei's dolls, proportionally to 1/20th rounded down of the number of Hall of Fame entries; used in Lorelei's house map script.

Int functions

  • 084 get number of Pokémon in party
  • 0D4 stores number of caught species in variable 8006
  • 1AE check for illegal Pokémon?
  • 153 check for Pokémon holding DLC berries (illegal to trade)
  • 165 check whether current Box is full
  • 16A check whether wireless adapter is ready
  • 17C check whether Pokémon with index number equal to variable 8004 is in team
  • 180 check whether Mystery Gift deliveryman should be visible

See also

Article on PokeCommunity