Item underflow: Difference between revisions

→‎Method: iirc includes map script pointer, etc.
No edit summary
(→‎Method: iirc includes map script pointer, etc.)
Line 7: Line 7:
Keeping the drink in the Bag, the player must repeatedly perform the 255-stack item duplication glitch until the topmost item becomes the acting Cancel button. As mentioned in the item duplication glitch article, at this point the number of items in the Bag and the actual items in the Bag are out of sync; the game believes that the player has 0 items in the [[Bag]], but it also believes that the player has a drink in their Bag. At this point, the player can go to any one of the Saffron City guards and give them the drink to unlock passage to the city (as the game believes that the player has a drink in their Bag to give), but as this is the only drink in their Bag, it will also attempt to decrease the total number of item stacks in the Bag by 1. This will cause the number of items in the Bag to become -1, which underflows to 255 (hence the name of glitch).
Keeping the drink in the Bag, the player must repeatedly perform the 255-stack item duplication glitch until the topmost item becomes the acting Cancel button. As mentioned in the item duplication glitch article, at this point the number of items in the Bag and the actual items in the Bag are out of sync; the game believes that the player has 0 items in the [[Bag]], but it also believes that the player has a drink in their Bag. At this point, the player can go to any one of the Saffron City guards and give them the drink to unlock passage to the city (as the game believes that the player has a drink in their Bag to give), but as this is the only drink in their Bag, it will also attempt to decrease the total number of item stacks in the Bag by 1. This will cause the number of items in the Bag to become -1, which underflows to 255 (hence the name of glitch).


As the game now believes that the player has 255 item slots to scroll through, the player is able to access several important regions of memory that happen to be stored just beyond the items in RAM, and manipulate these memory areas as if they were items (by swapping, tossing, etc). This effectively gives the player arbitrary read and write access to these regions of memory. This perhaps most notably includes the player's current map and coordinates, and so for example it is possible to instantly complete the game by warping to the [[Hall of Fame]]. Manipulating coordinates is also a relatively easy way to access glitch items such as [[List of unobtainable items#8F|8F]], by standing on a particular tile (such that the player's coordinates are interpreted as the item 8F) and then swapping that item to a normal Bag slot.
As the game now believes that the player has 255 item slots to scroll through, the player is able to access several important regions of memory that happen to be stored just beyond the items in RAM, and manipulate these memory areas as if they were items (by swapping, tossing, etc). This effectively gives the player arbitrary read and write access to these regions of memory. This perhaps most notably includes the player's current map data and coordinates, and so for example it is possible to instantly complete the game by warping to the [[Hall of Fame]]. Manipulating coordinates is also a relatively easy way to access glitch items such as [[List of unobtainable items#8F|8F]], by standing on a particular tile (such that the player's coordinates are interpreted as the item 8F) and then swapping that item to a normal Bag slot.


This item underflow method can also be performed in a nearly identical manner using a [[Fossil]] and the scientist in the [[Pokémon Lab]] on [[Cinnabar Island]] who revives it and thus removes it from the inventory.
This item underflow method can also be performed in a nearly identical manner using a [[Fossil]] and the scientist in the [[Pokémon Lab]] on [[Cinnabar Island]] who revives it and thus removes it from the inventory.
2,613

edits