Jump to content

Dry underflow glitch: Difference between revisions

Cleanup
>Sherkel
mNo edit summary
old->Bbbbbbbbba
(Cleanup)
Line 1:
'''Dry underflow glitch''' is a [[glitch]] in {{RBY}} and a major sub-glitch of having a x255 item stack. Similar to the [[item underflow glitch (event method)]], it allows the player to get an [[expanded item pack]] by decreasing the item count while it is already 0, making it underflow to 255. It relies on an implementation quirk in an in-game mechanic which allows the player to merge two item stacks (e.g. Ultra Ball x1, Ultra Ball x20) of the same kind into one stack, by swapping them.
 
It was documented by Luckytyphlosionluckytyphlosion ([http://forums.glitchcity.info/index.php?topic=7175.0 thread]). It is called "dry underflow" because, unlike the most common implementation of the [[item underflow glitch (event method)|event method]], no fresh water is involved.
 
ItSince is a betterthis method because it doesn't require the Saffron guards to be thirsty or a Fossil., Itit reliescan onbe andone oversighteither invery anearly in-game mechanicthe whichgame allows(e.g. in the player"Catch to'em mergeAll" twospeed run), or itemvery stackslate (e.g. Ultraon Balla x1completed game). Also, Ultrait Ballcan x20)be ofdone with the samePC kinditems, intoallowing one stack,to byedit swappingmore RAM addresses that could otherwise only be manipulated with [[arbitrary code execution]] or [[Map_254_(Yellow)|map themFE]].
 
Also, it can be done with the PC items, allowing one to edit more RAM addresses that could only be manipulated with [[arbitrary code execution]] or [[Map_254_(Yellow)|map FE]].
 
==Requirements==
You will need 2 different tossable items, and a stack of 255 items.
 
Refer to [[#Methods to obtain x255 stack|below]] for methods of obtaining a x255 item quantity slot for this glitch:.
 
== Method ==
# Order your items so that your 2 tossable items are in slots 1 and 2 and the item x255 is in slot 3.
# Toss everything below the item x255. (Item count = 3)
# Toss the top two items so you have three items x255. (itemItem count = 1)
# Toss 253 of the first item x255.
# Swap item 1 with item 2. (Item count = 0)
# Swap item 1 with item 2, again. (Item count = 255)
 
You can also do this with items below the third (and initial) 255 stack. You need to count how many items you have, then after step 3 toss the top item x255 the number of items you initially had -2.
 
==Explanation==
== Methods to obtain x255 stack ==
This method uses a few quirks of item swapping when [[Item stack duplication glitch|the item count is desynchronized with the terminator of the item list (i.e. "the Cancel button")]].
 
When the item count is 1, the second item usually "acts like the Cancel button". However, while the A button checks the cursor position against the item count, the Select button checks whether the item under the cursor is actually the Cancel button (0xFF). Therefore it is allowed to switch an item that "acts like the cancel button" with another item.
 
The game also has a "max menu item" internal variable to help handle bounds and scrolling. For the item list, its value is usually 2 (the third item on screen); moving past the third item causes the menu to scroll instead. When the item count is 1 or 0, then the "max menu item" should change to 1 or 0 respectively, to make sure that the player cannot scroll past the Cancel button.
 
When using the swap function to combine two item stacks into one, and thus decreasing the item count, the game checks whether the new item count is 1, and if so changes the "max menu item" to 1. However, since it is normally not possible to '''decrease the item count to 0 by combining stacks''', the game doesn't check for an item count of 0 and doesn't change the "max menu item", allowing the cursor to access the second slot.
 
Now, when the item count is 0, both slots "act as the Cancel button". However, as long as neither is actually the Cancel button, there is still nothing stopping the player from swapping the two stack and combining them. This decreases the item count once more, and achieves underflow.
 
== Methods to obtain x255 stack ==
 
===Using MissingNo.===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.