Jump to content

Pokémon Red and Blue: Difference between revisions

m (Text replacement - "(\bld(?:|i|l|d|h) (?:.+, ?)?)\((.+)\)" to "$1[$2]")
 
(10 intermediate revisions by 2 users not shown)
Line 1:
{{bulbapedia}}
[[File:Getmew3.png|thumb|Executing the [[Trainer escape glitch]] by Flying away from a Gambler on Route 8.]]
 
'''Pokémon Red and Blue''' is the first Pokémon game released outside Japan. The two versions are [[bp:Core series#Release model|paired]] and mainly differ in the wild Pokémon available and the [[bp:Celadon Game Corner|Game Corner]] prizes. They use the game engine of [[Pokémon Blue (Japanese)|Japanese Pokémon Blue]], but the aforementioned version differences are carried over from [[Pokémon Red and Green|Japanese Pokémon Red and Green]].
 
Line 14 ⟶ 16:
depending on the player's name (notably, at least one of them could be encountered, regardless of the player's name: If the player entered a non-default name then 'M (00) is always available, while all three default names on either version make at least one MissingNo. available). Both those glitch Pokémon [[Glitch Pokédex flag#Via "seen" flags|duplicates the player's 6th item]], allowing the player to perform the [[dry underflow glitch]] ([[Item underflow glitch (event method)|the other method of item underflow]] is also possible, but almost always less convenient) to obtain an [[expanded item pack]]. The expanded item pack allows the player to modify a wide range of memory addresses, as well as to acquire various [[glitch items]], up to and including ACE items.
 
[[Brock through walls]] is also a major memory corruption glitch that can be performed early. However, since the range of memory corrupted consists mostly of temporary variables, the best known utility of it is, as its name suggests, walking through walls. It is commonly used to skip to a late-game area where the player can perform the aforementioned trainer escape glitch or old man glitch to encounter MissingNo. or 'M (00). Walking through walls also allows the player to access the [[out of bounds]] area of maps, in particular [[Out of bounds Glitch City (Generation I)|out of bounds Glitch Cities]], where [[Glitch City RAM manipulation (Cut abuse)]] can be exploited as an alternative gateway to break the game, although this is generally less convenient than the MissingNo. route in Red and Blue.
 
The [[Safari Zone exit glitch]] is yet another glitch with major applications. It can directly put the player in a Glitch City, from where a limited form of [[Glitch City RAM manipulation (Cut abuse)]] can be performed. Alternatively, it leads to two forms of walk through wall glitches, namely the [[Walk through walls glitch (ledge method)|ledge method]] and the [[Walk through walls glitch (museum guy method)|museum guy method]], both of which can be exploited as described above.
 
== Glitch Pokémon ==
[[Image:Wild MissingNo.png|thumb|[[MissingNo.]] is one of the most characteristic glitch Pokémon in Pokémon Red and Blue.]]
{{main|GlitchDex#Pokémon Red and Blue English GlitchDex}}
 
In Generation I games, there are 151 valid Pokémon species, while the species ID of a Pokémon is a byte that can take any of its 256 values. Therefore, there are 105 possible species of [[glitch Pokémon]]. Furthermore, the values of the internal IDs of valid Pokémon species are not contiguous, and instead ranges from 1 (Rhydon) to 190 (Victreebel), skipping over 39 invalid values in this range. In various data lists indexed by internal IDs, those 39 invalid IDs share the same placeholder data, including the name "[[MissingNo.]]" (meaning "missing number"; this was translated from the Japanese string "けつばん" which means the same). Three of those IDs actually have a valid front sprite, that of a Kabutops fossil (ID 182), an Aerodactyl fossil (ID 183) or Pokémon Tower ghost (ID 184), and they behave a little differently from other IDs. Otherwise, MissingNo. with different IDs behave largely the same. Therefore, all IDs of MissingNo. are commonly regarded as the same species.
 
The other 66 invalid IDs are out of the range for any data lists indexed by internal IDs, so they take data from unrelated memory regions, and are generally more different from each other. However, for each of those glitch Pokémon species, one value that is particularly important is the ''Pokédex number''. Valid Pokémon have Pokédex numbers ranging from 1 to 151, and MissingNo. has Pokédex number 0, but glitch Pokémon other than MissingNo. can have Pokédex numbers in either or neither of those ranges. Pokémon species sharing the same Pokédex number will also share certain traits, and are known as a [[glitch Pokémon family]]. The Pokédex numbers for valid Pokémon and MissingNo. are stored in a contiguous table, and in R/B, that table is followed by some functions related to trading<ref>[https://github.com/pret/pokered/blob/1dcaede8b5e41dbec9bf3f2b18c77d1b7d2de708/main.asm#L212-L213 The relevant section of ROM layout], and [https://github.com/pret/pokered/blob/1dcaede8b5e41dbec9bf3f2b18c77d1b7d2de708/engine/movie/trade.asm the piece of assembly code following the <code>PokedexOrder</code> table]</ref>, from which glitch Pokémon other than MissingNo. get their Pokédex numbers.
 
=== Obtaining ===
Line 32 ⟶ 37:
{{main|ItemDex#English versions}}
Similar to Pokémon species, in Generation I games the ID of an item can take any of its 256 values, while valid item IDs range either from 1 (Master Ball) to 83 (Max Elixer), or from 196 (HM01) to 250 (TM50). Furthermore, some IDs in the "valid" range do not correspond to items intended to appear in the game. However, most of them have distinct names and/or effects, and some of them are designed to play a role in gameplay:
* [[????? (0x07 glitch item)ItemDex/RGBY:007|?????]] (ID 7) is usually known as the "Surfboard", because it acts identically to the move [[bp:Surf|Surf]] outside of battle. In fact, the field move Surf internally "uses" this item (i.e. calls the "item use" subroutine with this item's ID), just like the field move [[bp:Dig|Dig]] does with [[bp:Escape Rope|Escape Rope]].
* [[Safari Ball (glitch item)ItemDex/RGBY:008|Safari Ball]] (ID 8) exists as an item, even though it is never supposed to appear in the player's inventory. Again, throwing a ball in a Safari Zone battle actually "uses" this item.
* [[Pokédex (glitch item)ItemDex/RGBY:009|Pokédex]] (ID 9) exists as an item, even though it is never supposed to appear in the player's inventory. It is functional, but not actually "used" when the player accesses the Pokédex from the Start menu.
* Items with ID 21–28 have the names of the Gym Badges, from "BoulderBadge" to "EarthBadge". Those names are used to display a list of all badges when the player talks to Cerulean City's badge describer.
** Furthermore, the first two of those, [[BoulderBadge (glitch item)ItemDex/RGBY:021|BoulderBadge]] and [[CascadeBadge (glitch item)ItemDex/RGBY:022|CascadeBadge]], are also "used" in a Safari Zone battle when throwing some bait or throwing a rock, respectively. Those glitch items are also functional in normal wild battles.
** The rest of those items are designed to be unusable anywhere, just like some valid items that are supposed to be checked rather than directly used from the menu (e.g. the [[bp:Helix Fossil|Helix Fossil]]), or exist just to be sold (i.e. the [[bp:Nugget|Nugget]]).
* [[????? (0x2C glitch item)ItemDex/RGBY:044|?????]] (ID 44) is an unusable glitch item.
* [[PP Up (useless)ItemDex/RGBY:050|PP Up]] (ID 50) is an unusable glitch item; the actual [[bp:PP Up|PP Up]] has ID 79.
* [[ItemDex/RGBY:059|Coin]] (ID 59) is an unusable glitch item.
 
In addition, all items with IDs greater or equal to 196 are considered HMs or TMs, and are handled in a special way. This means that the items with ID 251–255 are named TM51–TM55, and act as TMs. They actually teach exactly the same moves as HM01–HM05, to exactly the same Pokémon, because even though the valid HM items have IDs before the TM items, for all other purposes, the HM moves come after the TM moves in the game's internal data. However, since TM51–TM55 are considered as TMs rather than HMs, they are not key items (i.e. their quantities are displayed in the inventory, and they can be tossed or sold), and are consumed when used. ([[Cancel (Generation I 0xFF glitch item)ItemDex/RGBY:255|TM55]] has some further quirks because it has ID 255, which is also used as the terminator of item lists. Most notably, its name is rendered as "Cancel" in the inventory, and while on-screen it hides the items below it, although it can still be used, tossed, or sold because in those cases the game uses the item count byte to determine whether the player chose the Cancel button.)
 
Apart from the above glitch items, other glitch items have IDs outside of the valid range, i.e. either 0 or 84–195. They take data from mostly unrelated memory regions, as detailed below.
Line 62 ⟶ 67:
When finding the address of the effect pointer, the game computes (item ID - 1) * 2 to find out the byte offset first, and makes an assumption that this calculation does not underflow or overflow the byte. This assumption is sound for valid non-TM, non-HM items, but not for glitch items with ID 0 or 129–195. This has the effect of "wrapping" the item ID to the 1–128 range by adding or subtracting 128, for the purpose of finding the effect pointer only. As a result, the glitch items with ID 129–195 have the same effect pointers, and thus similar effects, as the corresponding items with ID 1–67. The effects may not be completely the same because they may check the exact item ID, or the Rival's effect (see below) may happen.
 
As for glitch items with ID 84–128, their effect pointers are actually the code of the function <code>ItemUseBall</code><ref>[https://github.com/pret/pokered/blob/fbbade2becdbbbaad787ec4ad957b8b5253498c0/engine/items/item_effects.asm#L104 The function <code>ItemUseBall</code>], which appears just below the effect pointer table</ref>, split into 2-byte words and interpreted as pointers. Some of those 2-byte words are actually pointers: They are the operand of a 3-byte instruction, such as <code>ld a, [$xxyy]</code>, <code>ld hl, $xxyy</code>, or <code>jp z, $xxyy</code>. This is why the aforementioned [[ItemDex/RB:093|8F]] and [[ItemDex/RB:106|-gm]] always jump to the party count and the Safari Ball count respectively, even on various European versions of the game where the RAM layout is slightly different, as well as why [[ItemDex/RB:099|ws m]] in Red and Blue always print the "box is full" message.
 
Other glitch items' effect pointers consist of two separate bytes with usually different meanings in assembly. For example, the effect pointer of [[ItemDex/RB:089|4F]] is $FA65, which comes from two assembly instructions <code>jp nz, $658B</code> and <code>ld a, [$D05A]</code>, encoded as the byte sequence "C2 8B '''65 FA''' 5A D0", and the middle two bytes decoded as a 2-byte pointer in little-endian. This address happens to be in the Echo RAM, and "echos" the WRAM address $DA65, leading to another relatively popular ACE exploit.
Line 72 ⟶ 77:
 
Certain glitch items will also open the party menu when used, usually because they share the effect pointer of one of the abovementioned items (since the item IDs differ by 128). However, since they are not in the hardcoded list, when the party menu is closed, the overworld sprites are not properly loaded. This glitched game state can be exploited, giving the player a limited ability to walk through walls.
 
==== In battle ====
When using any item, the variable <code>wActionResultOrTookBattleTurn</code> is set to 1 by default<ref>[https://github.com/pret/pokered/blob/53805947c3bc30c491b4f2a820c27e152dfa4b89/engine/items/item_effects.asm#L3 The line of code setting <code>wActionResultOrTookBattleTurn</code> to 1 by default]</ref>, indicating that the item use is successful, and if it is in battle it will consume the player's turn. For valid items, if they cannot be used currently (e.g. trying to use the Town Map in battle), or the player canceled the item use (e.g. using a Potion but backing out on the party menu), this value is manually set back to 0 so that it would not consume the player's turn in battle. (For some items this value can also be set to 2 to indicate that the item use failed without displaying the party menu, but this cannot happen in battle<ref>Specifically, this happens when the player [https://github.com/pret/pokered/blob/53805947c3bc30c491b4f2a820c27e152dfa4b89/engine/items/item_effects.asm#L1637-L1638 tries to use an X item out of battle] or [https://github.com/pret/pokered/blob/53805947c3bc30c491b4f2a820c27e152dfa4b89/engine/items/item_effects.asm#L2181-L2182 boots up a TM or HM but chooses not to teach the move after just seeing the move name].</ref>.) Since many glitch items do not modify <code>wActionResultOrTookBattleTurn</code>, those items will take a turn to use in battle even if they do not do anything significant.
 
=== Obtaining ===
In most cases, glitch items are obtained from the [[expanded item pack]]. Putting the game into certain states will cause certain items to appear in the expanded item pack, which can either be used from there or switched into valid item slots to preserve them, although care must be taken because modifying the expanded item pack also changes the game state. The [[Celadon looping map trick]] can help the player obtain any item, except [[Cancel (Generation I 0xFF glitch item)ItemDex/RGBY:255|Cancel/TM55]], as long as the player knows its internal ID. Alternatively, in both Red and Blue, it is possible to find all glitch items in the game as [[roaming items]], although it is not a trivial task to find out which map has a specific roaming item.
 
Other methods to obtain glitch items include item mutation through certain [[glitch Pokédex flags]], as well as arbitrary code execution, which, once set up, may again be the most convenient method to manipulate the player's inventory, including item types and item quantities.
Line 80 ⟶ 88:
== References ==
<references />
 
[[Category:Games]]
182

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.