If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Pokémon Red and Blue/Debug Functions

From The Cutting Room Floor
Jump to navigation Jump to search

This is a sub-page of Pokémon Red and Blue.

Debug Battle

This unusual functionality was used for battle debugging purposes as seen in the Pokémon Blue debug ROM. It can be accessed by running the code at 01:4DA6, which requires a bank switch to be performed using the bank switch function at $35D6. This sets the bank to whatever register b.

  • The "badges" value is set to $80, which gives you the Earth Badge and nothing else.
  • Your current location is set to Pallet Town and your current Pokémon party is removed.
  • You are prompted to nickname a level 20 Rhydon.
  • A battle against another level 20 Rhydon will begin.
  • All four of your moves will act like Pound, though this doesn't apply to the opposing Rhydon.
  • Whatever the outcome of the battle ends up being, once the fight is over the nickname prompt will appear again, and the entire process repeats.

According to an interview with Ken Sugimori, Rhydon was the first Pokémon ever created, as well as the first valid index number for Pokémon, which may be why Rhydon are used in this battle. Pound is likely used as it is the first valid index number for Moves. This battle is used when selecting the fight option in the main menu on the Pokémon Blue debug ROM.

The same setup also exists in the Japanese Red and Green, at 01:4B8D, where it appears to work in an identical manner, while in contrast it was removed in Yellow. Please refer to this post for the location of the bank switch function in other regions & revisions.

(Source: Pokémon Red Disassembly Project)

Debug Cable Club Messages

This behavior is only present in Rev 0 (v1.0) of Japanese Red/Green. It was removed in Rev A (v1.1), and every other version/language of Red/Green/Blue/Yellow.

It causes the game to print one of two error messages if byte 60 (full width "A") is present as the first character in either player 1 or player 2's name.

Text Translation (unofficial)
「じぶんの データがこわれています! でんげんを きって やリなおしてください。」 ("My data is corrupted! Please turn off the power and try again.")
「あいての データがこわれています! でんげんを きって やリなおしてください。」 ("The partner's data is corrupted! Please turn off the power and try again.")

The error messages are bugged, because the text box border tiles at the Trade Center/Colosseum are not meant for a regular sized text box. Furthermore, only the first sentence ("My data is corrupted!" or "The partner's data is corrupted!" gets printed with that sentence looping indefinitely for two v1.0 Red/Green games).

This is usually impossible to do; no English characters (halfwidth or fullwidth) can be input on the new name screen, and only very few exist in the character maps. It is worth stressing that while this is "A" on the overworld, it is the "G" from "GAME FREAK PRESENTS" on the title screen; so this may have been intended for names using that character map instead (e.g. 60 61 62 63 64 65 63 61 66 "GAME FREAK").


(Source: Pokémon Red JP disassembly by Yama Arashi (dead link), Háčky (analysis), ChickasaurusGL (video/further analysis))

11 Character Player Name Failsafe

Player names (stored at D158 (wPlayerName)) can normally be a maximum of 7 characters long, plus a 50 byte indicating the end of the name.

However, due to a design flaw the retrieval of default names like the preset "RED" extrapolates more bytes than necessary, as if filling in an 11 character name (although this would be ideal for a Pokémon name which is usually a maximum of 10 characters long plus a terminator byte).

For example "RED" is actually "RED[50]ASH[50]JAC". The same applies to the default player name "NINTEN" (debug mode name) which is actually stored as "NINTEN[50]SONY" and the bytes which fill in D34A (W_RIVALNAME) for debug mode after "SONY[50]" are FA 5F DA EA 91 CF (the first six bytes of the routine 01:45B6 LoadMonData_).

Game Freak included a failsafe function to erase the save file if none of the first 11 characters in the player's name contain a 50 byte. If the player saves the game and resets it, the Continue option will be removed but there will be no error message. This is different to an error message which is displayed if the player has a terminated name but the checksum is incorrect; "The file data is destroyed!".

There is an infamous bug known as ZZAZZ glitch which corrupts the player's name with "Z" characters and gives the player lots of Level 153 Bulbasaur with Explosion while ignoring every third byte. The cause is related to how: i. the glitch Trainer's base money payout multiplied by their last Pokémon's level is very large and ii. how the way multiplication is handled as consecutive additions and the payout money pointer has to be moved three bytes forward; hence the third byte is not corrupted. iii. The maximum money byte is 99 (binary encoded decimal for 99) as in 9999 Pokédollars but technically it can hold 999999 Pokédollars); so corrupted bytes are replaced with 99 ("Z", the Pokémon Bulbasaur, Level 153, the move Explosion, etc.). This bug can be used to obtain a player name over 11 characters long provided that the player's name isn't 2 or 5 or 9 characters long (ignoring the terminator byte).


(Source: Pokémon Red disassembly, TheZZAZZGlitch)

Debug Mode

Setting bit 1 of RAM address D732 enables a debug mode with the following features:

  • When starting a new game, most of Oak's intro speech is skipped, including the player and rival name selections. This results in the player and rival's names being automatically set to the version's defaults. (See the chart below.)
  • The player begins the game outside their house, rather than inside their bedroom.
  • Holding the B button prevents wild Pokémon encounters.

The RAM address can be set using the GameShark code 010332D7. However, this code also changes other unrelated bits of the same address, causing incidental side effects, such as not forcing the player to use a bicycle on Cycling Road, and incorrectly-functioning warps. In the debug ROM this is used when the debug option is selected, also giving you the debug Pokémon Party.

Default Names by Version

Version Player Rival Notes
Red (J)
Green (J)
やまぐち
(Yamaguchi)
いしはら
(Ishihara)
Named for Wataru Yamaguchi, listed in the games' credits under "Special Thanks", and Tsunekazu Ishihara, then director of Creatures Inc.
Blue (J) ゲーフリ
(Gēfuri)
クリチャ
(Kuricha)
Named for Game Freak and Creatures Inc., two of the companies that worked on Pokémon.
Red (U)
Blue (U)
NINTEN SONY A tongue-in-cheek reference to the rivalry between Nintendo and Sony.
(Source: IIMarckus - Default Names, Pokémon Red Disassembly Project - Debug Flag)

Error Codes

PokemonRed ERROR code.png

Error code messages are displayed when a 00 character appears in the middle of a text string. When an error message is printed on the screen, all text after the 00 character is ignored. The messages' formatting differs between versions:

  • Red & Green: "[x] エラー"
  • Red & Blue: "[x] ERROR."
  • Yellow: "[x] error."

[x] is a number that represents the identifier of the text string. However, it is possible for other text, including numbers, to precede the error code, which can potentially result in confusing messages. Take "54 error," for example, which could be read as both "5[4 error]" and "[54 error]".

You can cause an error code to appear by using the Trainer-Fly glitch in the English versions of Pokémon Red and Blue. This glitch is enabled by flying away from the long-range trainer on Route 6, re-enabling the start menu using a Trainer in another location, and then reading the PokéMart sign in Vermilion City and return to Route 6. An error message reading "9 ERROR" will now appear, as seen in the picture at right. This is because Vermilion's PokéMart sign has a text identifier of 09, stored at the memory address CF13, and the game is attempting to load the last text box ID in memory. There is no such corresponding text for Route 6, and the information at that address is, presumably, a single 00 character, so the game prints a "9 ERROR."

The PokéMart sign in Yellow, meanwhile, has a text identifier of 0B, which, coincidentally, does not result in an error message. However, the sign that says "VERMILION CITY - The Port of Exquisite Sunsets" has an identifier of 08, so reading it and returning to Route 6 will bring up an "8 ERROR."

Debug Pokémon Party

In the Japanese Red and Green, an unused function exists that adds three Pokémon to the player's party:

  • Exeggutor (Level 90)
  • Ekans (Level 90)
  • Rhydon (Level 5)
Version Offset
Red (J) 1.0 01:645C
Red (J) 1.1 01:6401
Green 1.0 01:645D
Green 1.1 01:6402

In Japanese Blue, the function adds three slightly different party members:

  • Exeggutor (Level 90)
  • Chansey (Level 100)
  • Rhydon (Level 5)
Version Offset
Blue (J) 01:656F

In English Red and Blue, the function adds five Pokémon. Notably, with the exception of a missing Level 5 Pikachu, this is the exact team given to you when creating a Debug save in the Debug Blue ROM:

  • Exeggutor (Level 90) (Debug Rom: Level 90, Moves: Fly, Cut, Surf, Strength)
  • Mew (Level 20) (Debug Rom: Level 5, Moves: Pound)
  • Jolteon (Level 56) (Debug Rom: Level 56, Moves: Double Kick, Agility, Pin Missile, Thunderbolt)
  • Dugtrio (Level 56) (Debug Rom: Level 56, Moves: Dig, Sand-Attack, Slash, Earthquake)
  • Articuno (Level 57) (Debug Rom: Level 57, Moves: Fly, Ice Beam, Blizzard, Agility)
Version Offset
Red & Blue (U) 01:64CA

In a 2000 ABC News interview with Pokémon developer Tsunekazu Ishihara, he states that Exeggutor is his favourite Pokémon, since he used it while debugging the game. This may explain the inclusion of Exeggutor.

(Source: Glitch City Laboratories Forums and Pokémon Red Disassembly Project)