Pokémon Yellow

From Glitch City Wiki
Jump to navigationJump to search
Bulbapedia also has an article about Pokémon Yellow.

Pokémon Yellow is the "third game" of Generation I released worldwide, i.e. the upper version of Pokémon Red and Blue. It uses the same game engine as its corresponding version in Japan, which is also usually known as "Japanese Pokémon Yellow" in English. However, this version is not named after a color in Japanese, but rather as "Pocket Monster Pikachu" (Japanese: ポケットモンスター ピカチュウ). In Japan, it is the fourth version in Generation I, the paired versions being Japanese Pokémon Red and Green and the third version being Japanese Pokémon Blue.

Compared to Pokémon Red and Blue, the game engine of Pokémon Yellow is slightly updated to support various special features of the starter Pikachu (most notably, following the player on the overworld), and for Western releases also to support color palette changes on the Game Boy Color. Several glitches are fixed, but the game remains easily breakable, mostly thanks to the trainer escape glitch and the save corruption glitch. A new major glitch introduced by Pokémon Yellow is the Pikachu off-screen glitch, which can be used to achieve arbitrary code execution (ACE), but this is generally less convenient than starting from the trainer escape glitch and doing arbitrary code execution with a glitch item, like in Pokémon Red and Blue.

Glitch Pokémon, glitch items, etc. can be accessed in Pokémon Yellow just like in Pokémon Red and Blue, but due to various changes in the game shifting bytes around, their behaviors are often different from their Red and Blue counterparts.

Game-breaking glitches

Despite the developers' attempt to fix glitches, some of the most powerful game-breaking glitches in Red and Blue remain in Pokémon Yellow. Save corruption remains the fastest way to break the game, with the same downsides of relying on a very precise timing (for hard resetting) and being hard to exploit cleanly.

The earliest point a trainer escape could be performed is still in front of the last trainer in Viridian Forest, and again this early in the game it is impossible to encounter a MissingNo. (or any other glitch Pokémon) with the Special stat encounter to break the game. The speedrun method for Red and Blue relies on very fine details of the game engine, and will not work on Yellow. Instead, speedrun routes of Yellow usually exploits the text box ID matching aspect of the trainer escape glitch, displaying a glitch text box that reads its contents from the OAM buffer, which can be manipulated to have a 0xFE byte as the first byte of the glitch text box, which becomes a glitch mart. Various glitch items, including the ACE glitch item 4F, can be purchased from this glitch mart. To access this glitched mart in RTA, runners would perform a carefully designed sequence of actions consisting of both luck manipulation and glitch setup, collectively known as "THE Manip"[1]. One advantage of "THE Manip" is that, since it does not execute arbitrary code from the RAM per se, it can also be used in speedrun categories that do not allow ACE (where glitch items can be bought to enable non-ACE glitches like the Rival's effect or the LOL glitch).

For casual players, the most common gateway to breaking the game is still MissingNo., encountered by using the trainer escape glitch later in the game (notably, the old man glitch is fixed in Yellow). Since the front sprite of regular MissingNo. in Yellow may freeze the game, usually a "special" MissingNo. with a fossil or ghost front sprite is used. The sequence of glitches that allow the player to get an expanded item pack from here is the same as in Red and Blue.

Brock through walls is technically possible in Pokémon Yellow, but the Pewter Gym skip glitch is fixed, so the player would need to have broken the game already in order to set it up, making it significantly less useful.

Glitch Pokémon

Main article: GlitchDex#Pokémon Yellow English GlitchDex

The data structures for storing Pokémon data in Pokémon Yellow are the same as those in Red and Blue, so glitch Pokémon in Yellow are overall similar to glitch Pokémon in Red and Blue: There are 105 species of glitch Pokémon, 39 being MissingNo.; Pokémon sharing the same Pokédex number form a glitch Pokémon family; etc. In fact, since all valid Pokémon have the same internal ID in Red/Blue and in Yellow, any ID that corresponds to a glitch Pokémon in Red/Blue must also correspond to a glitch Pokémon in Yellow, and vice versa. However, specific data taken from out-of-bound memory regions are often different between Red/Blue and Yellow. This includes MissingNo. (as well as other glitch Pokémon with Pokédex number 0): Although there are a few pieces of placeholder data for MissingNo., most data for it are still invalid out-of-bound data.

One particularly important difference is that, on Yellow, MissingNo.'s decompressed front sprite has 32×32 tiles[2] (whereas valid sprites have 5×5, 6×6 or 7×7 tiles), as opposed to 13x13 tiles on Red and Blue. Therefore, whereas on Red and Blue MissingNo.'s front sprite will corrupt part of the Hall of Fame data, on Yellow its corruption extends to the WRAM, causing complicated behaviors that usually freezes the game, although this freeze could be prevented by manipulating a certain unused chunk in the SRAM[3]. "Special" Missingno. are not affected by this problem because they are hardcoded to use their respective valid sprites.

Despite the difference in behavior, glitch Pokémon with the same internal ID in Red/Blue and in Yellow are "equivalent in a trade": Trading a glitch Pokémon from Red/Blue to Yellow will turn it into the glitch Pokémon with the same ID in Yellow, and vice versa.

Glitch items

Main article: ItemDex#English versions

Glitch items in Yellow are also overall similar to glitch items in Red and Blue. In fact, glitch items in the valid ID range, as well as TM51–TM55 (ID 251–255), have exactly the same names and behaviors in Red/Blue and Yellow.

Some other glitch items in Yellow also have the same names as glitch items in Red/Blue. In particular, all the "floor name" items have the same IDs in Red/Blue and Yellow, as well as the "untranslated Japanese name" items (even though they usually have different effects; see below). However, in general, having the same name does not mean that the items also have the same ID. In fact, starting from ItemDex/Y:154 ("POKéTRAINER"), most glitch items in Yellow have names that are similar to the name of the "previous" glitch item in Red/Blue (e.g. ItemDex/RB:153 is also named "POKéTRAINER"). This is because this part of the ROMs have similar layouts between Red/Blue and Yellow, but the part before this (and after the item names) have different layouts, as well as different "accidental" 0x50 bytes.

Even though Yellow glitch items with ID 84–128 also take their effect pointers from the code of the function ItemUseBall[4], most of them have very different effect pointers and very different behaviors. The main reason is that the function ItemUseBall differs between Red/Blue and Yellow in a subtle way: The game needs to handle not only the special case of the old man catching tutorial, but also the Prof. Oak battle with Pikachu. This happens very early in the function, when the game makes a check to avoid the old man full box glitch; this check takes 5 more bytes to perform in Yellow than in Red[5]. As a result, not only are the effect pointers of glitch items with ID 91–128 taken from different instructions than that of the corresponding Red/Blue glitch items, but those two-byte pointers also align with the code in a different way, so they never "match up" with any Red/Blue effect pointers again[6]. For example, there is no glitch item in Yellow that executes code from the player's party count like Red/Blue's 8F, or from the player's Safari Ball count like Red/Blue's -gm. Instead, Yellow has ws m, which executes code from the player's Pokémon count in the current box, while a similar glitch item does not exist in Red/Blue.

RAM layout

The RAM layout of Pokémon Yellow is almost the same as that of Pokémon Red and Blue. Some variables that only exists in Yellow, such as the starter Pikachu's happiness ($D46F), are stored in a RAM region that is unused in Red/Blue, and thus do not change the overall RAM map. However, there is a single difference that does change the RAM map: The variable wGBC, at WRAM address $CF1A in Red/Blue[7], is moved to the HRAM in Yellow, and becomes hGBC at $FFFE[8], presumably for the faster access speed that the HRAM provides. Therefore, all WRAM variables after $CF1A are shifted up a byte (i.e. have 1 subtracted from the address) in Yellow. For example, the address of the third item in the bag (a popular location for ACE payloads) is $D322 in Red/Blue, but $D321 in Yellow.

References

  1. Video demonstration of "THE Manip"
  2. In other words, it has 256×256 pixels. In fact, the byte for its size is 0x00, which means 0×0 tiles, but this is first translated into 0×0 pixels. When the game checks whether the sprite decompression is complete, it does not handle the case of 0 pixels in either dimension correctly, so the pixel count has to reach 256 and overflow the byte before the game thinks the current column or current sprite is complete.
  3. Pokémon Yellow — Encountering Yellow-form MissingNo. without crashing (video by TheZZAZZGlitch)
  4. The function ItemUseBall in Yellow
  5. The check to avoid the old man full box glitch in Yellow, and the same check in Red/Blue. It is not entirely clear why this check was changed, since normally in the Prof. Oak battle the player does not even have any party, let alone a full party and a full box; the change may just be for consistency.
  6. There is a second check for the old man battle and the Prof. Oak battle, but the effect pointer of ItemDex/Y:128 falls in the middle of that check, and the next glitch item starts from the beginning of the effect pointer table again. Code below that check would "align" with Red/Blue again, but those bytes are never used as effect pointers.
  7. Declaration of wGBC in Red/Blue (compare with the lack of it in Yellow)
  8. Declaration of hGBC in Yellow