Main Menu

Glitches

References/Resources

Affiliates

Technical

Search Wiki

Toolbox

Difference between revisions of "99 item stack glitch"
 Page | Discussion | View source | History

From Glitch City Laboratories

Jump to: navigation, search
[checked revision][checked revision]
m (→‎Description: Say, doesn't anyone else feel "due to a glitch" is pretty dumb, since this entire page literally is the glitch? Guess we will see if "due to an oversight" is any better.)
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Major glitches}}
 
 
[[File:99 item stack glitch.png|thumb|160px|Corrupting the screen palette after purchasing Ultra Balls.]]
 
[[File:99 item stack glitch.png|thumb|160px|Corrupting the screen palette after purchasing Ultra Balls.]]
 
The '''99 item stack glitch''' is a memory corruption [[glitch]] and [[natural glitch]] which occurs in {{RB}} and {{JY}}. It does not work in English Yellow.
 
The '''99 item stack glitch''' is a memory corruption [[glitch]] and [[natural glitch]] which occurs in {{RB}} and {{JY}}. It does not work in English Yellow.
Line 6: Line 5:
 
If the player performs a task which adds to the number of items in a list (purchasing an item from a Poké Mart, depositing it via the PC or withdrawing it via the PC) while they have an existing stack of that item ×99 in the last slot of the inventory (e.g. Ultra Ball ×99), the game will try to add to an item quantity of the same item from beyond that slot in an attempt to contain the items in an existing stack without creating a new one.
 
If the player performs a task which adds to the number of items in a list (purchasing an item from a Poké Mart, depositing it via the PC or withdrawing it via the PC) while they have an existing stack of that item ×99 in the last slot of the inventory (e.g. Ultra Ball ×99), the game will try to add to an item quantity of the same item from beyond that slot in an attempt to contain the items in an existing stack without creating a new one.
  
Due to a glitch, the end terminator is ignored if it directly proceeds an item quantity, and the game may add to the quantities of items even if the 'item quantity' represents an unrelated memory address.
+
Due to an oversight, the end terminator is ignored if it directly follows the stack of that item ×99. This means the game would move past the item list, and start to interpret unrelated memory addresses as "item type" and "item quantity" alternately. If the game finds the same "item type" before it finds a 0xFF terminator, it may change the "item quantity" byte.
  
The glitch won't happen if the player has less item slots occupied than previously (eg, if the player has had 15 item slots filled in his inventory, having less than 15 item slots occupied will prevent the glitch.
+
This also works even if the existing item stack has less than 99 items, as long as the total quantity of the existing stack and the new stack is more than 99. In this case the game will add enough items to make the existing stack ×99 and go on, triggering the glitch.
  
Note that any memory address with value hex:FF will end the search ; hence having all 8 badges will prevent most corruptions.
+
Note that any memory address in an "item type" slot (even address for bag, odd address for PC) with value 0xFF will end the search (the new item is put in the correct slot because it's calculated from the number of items, not decided by the 0xFF terminator). As a result, the glitch won't happen if the player has less item slots occupied than previously (e.g., if the player has had 15 item slots filled in his inventory, having less than 15 item slots occupied will prevent the glitch), because in this case the item list will have multiple terminators. Having all 8 badges in the English versions will also prevent most corruptions.
 +
 
 +
The glitch also doesn't happen if the item list is already full (20 for the bag, 50 for the PC), because in this case the game wouldn't even try to move past the first existing stack. <!-- This has unintuitive implications, like the game not letting the player buy a Poké Ball even if the player has Poké Ball ×1 in the bag, as long as it comes after some Poké Ball ×99 (and the bag has 20 items). Maybe this is glitch-worthy on its own... -->
  
 
==Examples==
 
==Examples==
 
* In English versions, when buying Ultra Balls with Ultra Ball ×99 in the last slot of the inventory, it is possible to corrupt $D35D (item 32 quantity; controlling the screen palette) if $D35C (item 32; current sound bank value) is 2 (Ultra Ball).
 
* In English versions, when buying Ultra Balls with Ultra Ball ×99 in the last slot of the inventory, it is possible to corrupt $D35D (item 32 quantity; controlling the screen palette) if $D35C (item 32; current sound bank value) is 2 (Ultra Ball).
* In English versions, one can exploit the [[Yami Shop glitch]] to buy Master Balls. If D364 (Block-X ID) is 01 and there are no Master Ball stacks which aren't ×99 before it, then one can add to D365 (map exit warp) to access locations up to hex:63 (S.S. Anne Deck). It may be necessary to change the quantity in address D358 to 99 first.
+
* In English versions, one can exploit the [[Yami Shop glitch]] to buy Master Balls. If $D364 (Block-X ID) is 1 and there are no Master Ball stacks which aren't ×99 before it, then one can add to $D365 (map exit warp) to access locations up to 0x63 (S.S. Anne Deck). It may be necessary to change the quantity in address $D358 to 99 first.
* In Japanese versions, when buying Great Balls with Great Ball ×99 in the last slot of the inventory, it is possible to corrupt number of badges ($D2D5) if the options byte is equal to 3 (Battle Animation On, Battle Style On, medium text speed).
+
* In Japanese versions, when buying Great Balls with Great Ball ×99 in the last slot of the inventory, it is possible to corrupt number of badges ($D2D5) if the options byte ($D2D4) is equal to 3 (Battle Animation On, Battle Style On, medium text speed).
 +
 
 +
The last example is not possible in the English versions because there the options byte ($D355) is an odd address and the badges obtained ($D356) is an even address.
  
 
==External links==
 
==External links==
Line 23: Line 26:
 
{{Youtube|6PxBIzRY4eg|SM}} (warp to S.S. Anne exploit)
 
{{Youtube|6PxBIzRY4eg|SM}} (warp to S.S. Anne exploit)
 
{{Youtube|sv2MzM7CPt8|ChickasaurusGL}} (in Japanese Blue)
 
{{Youtube|sv2MzM7CPt8|ChickasaurusGL}} (in Japanese Blue)
{{stub}}
 
 
[[Category:Generation I glitches]]
 
[[Category:Generation I glitches]]
[[Category:Generation I natural glitches]]
 
[[Category:Natural glitches]]
 

Revision as of 00:00, 7 September 2019

Corrupting the screen palette after purchasing Ultra Balls.

The 99 item stack glitch is a memory corruption glitch and natural glitch which occurs in Pokémon Red and Blue and Pokémon Yellow (Japanese). It does not work in English Yellow.

Description

If the player performs a task which adds to the number of items in a list (purchasing an item from a Poké Mart, depositing it via the PC or withdrawing it via the PC) while they have an existing stack of that item ×99 in the last slot of the inventory (e.g. Ultra Ball ×99), the game will try to add to an item quantity of the same item from beyond that slot in an attempt to contain the items in an existing stack without creating a new one.

Due to an oversight, the end terminator is ignored if it directly follows the stack of that item ×99. This means the game would move past the item list, and start to interpret unrelated memory addresses as "item type" and "item quantity" alternately. If the game finds the same "item type" before it finds a 0xFF terminator, it may change the "item quantity" byte.

This also works even if the existing item stack has less than 99 items, as long as the total quantity of the existing stack and the new stack is more than 99. In this case the game will add enough items to make the existing stack ×99 and go on, triggering the glitch.

Note that any memory address in an "item type" slot (even address for bag, odd address for PC) with value 0xFF will end the search (the new item is put in the correct slot because it's calculated from the number of items, not decided by the 0xFF terminator). As a result, the glitch won't happen if the player has less item slots occupied than previously (e.g., if the player has had 15 item slots filled in his inventory, having less than 15 item slots occupied will prevent the glitch), because in this case the item list will have multiple terminators. Having all 8 badges in the English versions will also prevent most corruptions.

The glitch also doesn't happen if the item list is already full (20 for the bag, 50 for the PC), because in this case the game wouldn't even try to move past the first existing stack.

Examples

  • In English versions, when buying Ultra Balls with Ultra Ball ×99 in the last slot of the inventory, it is possible to corrupt $D35D (item 32 quantity; controlling the screen palette) if $D35C (item 32; current sound bank value) is 2 (Ultra Ball).
  • In English versions, one can exploit the Yami Shop glitch to buy Master Balls. If $D364 (Block-X ID) is 1 and there are no Master Ball stacks which aren't ×99 before it, then one can add to $D365 (map exit warp) to access locations up to 0x63 (S.S. Anne Deck). It may be necessary to change the quantity in address $D358 to 99 first.
  • In Japanese versions, when buying Great Balls with Great Ball ×99 in the last slot of the inventory, it is possible to corrupt number of badges ($D2D5) if the options byte ($D2D4) is equal to 3 (Battle Animation On, Battle Style On, medium text speed).

The last example is not possible in the English versions because there the options byte ($D355) is an odd address and the badges obtained ($D356) is an even address.

External links

YouTube video by TheZZAZZGlitch
YouTube video by ChickasaurusGL
YouTube video by SM

(warp to S.S. Anne exploit)

YouTube video by ChickasaurusGL

(in Japanese Blue)