Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

Dry Underflow - Page 1

Dry Underflow

Posted by: luckytyphlosion
Date: 2015-01-27 16:38:18
[size=18pt]Dry Underflow[/size]
This is basically a method of item underflow, except you don't need the guard to take the fresh water from your inventory. (hence the name "dry underflow", since there isn't a freshwater involved. Credits for Stumpdotio for coming up with this name)

EDIT: At this point, I realize that you can underflow items using the above method.

[size=14pt]New Method:[/size]

Requirements:

Procedure

Item Setup
Item Count: 1
Item3 x255
Item3 x255
Item3 x255
Cancel x0 (quantity of Cancel doesn't matter)

After acquiring the above setup, which should look like what is shown above, toss 253 of the first 255 stack.

Toss 253
Item Count: 1
Item3 x2
Item3 x255
Item3 x255
Cancel x0

Then, swap the x2 Stack with the x255 Stack.

Swap
Item Count: 0
Item3 x1
Item3 x255
Cancel x0

Swap again to achieve Item Underflow.

Swap again
Item Count: 255
Item3 x0
Cancel x0

[size=14pt]Old Method:[/size]

Requirements:


Method:


[size=14pt]Explanation of the Old Method[/size]
While this isn't related to the New Method, this does explains the mechanics of the glitch that are used in the new method.

When you deposit the three items into the PC (the two useless items and the 255 item stack), and you toss the two items, the item count decrements (read: is subtracted by one). However, the 255 stack shifts up instead of the Cancel Button, so by tossing the two items, you get this layout in your box items.

(note: the item names are simply labels, and do not represent the position of items in the box)

Before Tossing
Box Items Quantity: 3
Item1 x1 (quantity doesn't matter)
Item2 x1 (same case as above)
Item3 x255
Cancel x0 (quantity doesn't matter)

After Tossing Item1 and Item2 in your box items
Box Items Quantity: 1
Item3 x255
Item3 x255
Item3 x255
Cancel x0

This means that you can swap whatever is in the Cancel Slot with the item above. Right now, it doesn't seem useful.
With the current setup, you can't simply toss the remaining 255 stacks, since the Cancel Button Item doesn't actually back you out of the menu. Instead, the Number of Items + 1 determines the location of the real Cancel Button.

Right now, our goal is to decrement the amount of items in the box when the number of items in the box is 0, so that it will underflow to 255. You can't simply toss items, as stated above. To do this, we need to create a setup to decrement the item counter when our item count is 0.

If you swap the two stacks of 255 you can currently access, then you end up with:

Item3 x156
Item3 x99
Item3 x255

Then, we toss 155 of the first item so we have one remaining.

Item3 x1
Item3 x99
Item3 x255

Now, the next part here is very weird. If you swap Item3 x1 with Item3 x99, nothing happens. However, if you swap Item3 x99 with Item3 x1, then Item3 x99 is swapped with Item3 x1.

Item3 x99
Item3 x1
Item3 x255

We can now toss x98 of the first stack, so that only one remains. Then, we can swap both x1 Stacks with each other, decrementing the item count so we have 0 items.

Item Count: 0
Item3 x2
Item3 x255

Normally, you wouldn't be able to scroll down since you have 0 items. For some reason though, if you decrement the item counter BY swapping an item, the cursor boundaries will not change. This allows us to swap Item3 x2 with Item3 x255, decrementing the item counter once again, and allowing you to access other bytes in memory.

Item Count: 255
Item3 x1 (since 255 + 2 = 1, because of overflow)

Re: Dry Underflow

Posted by: luckytyphlosion
Date: 2015-01-29 18:55:48
Bumping since I added more information to the first post.

Re: Dry Underflow

Posted by: Dabomstew
Date: 2015-01-30 09:23:27
Worth noting that if the 255 quantity item is the last item in your inventory you can achieve dry underflow by just tossing all your non-255 items until you have none left (i.e. your top item is a 255 stack); once this happens your "item count" will be 1 and you can proceed to do the "new method" using the top three stacks. This isn't too relevant to anything other than speedruns, but does make the process a fair bit quicker. Still requires no key items in inventory.

Re: Dry Underflow

Posted by: Torchickens
Date: 2015-01-30 11:05:11
Wow. Excellent.

So thanks to this and good luck, somebody has done Pokémon Blue NSC in 15 minutes.

I wasn't even aware of the join item stacks together to make one stack thing. Though I imagine that is related to why the Gen II duplicate key items glitch works.

You can do the item joining thing in Gen II as well, but if you can just get a stack of 255 items in the correct pocket you can toss the item above it even when the number of items is 0, allowing underflow. I don't know if you can replicate dry underflow in Gen II with you and Dabomstew's methods and get the requirements as I haven't tried that.

Food for thought is that some glitch worlds in Crystal (I don't know about Gold) accessible by stepping out of bounds can corrupt your items, and I did item underflow with one of them (south of Fast Ship from Olivine City).

I thought it was strange how I couldn't swap an item stack with another of the same identifier when playing around with an expanded items pack in the past.

Now that you no longer need a Fossil or drink (and you don't have to rely on the Saffron guard being thirsty) this is much more accessible for non-speedrunning in RB since it's no longer inaccessible after a certain point in game. (or is it?) You could just use the old man glitch for Missingno. and for getting your 255 stack.

In Yellow if you used up all your long-range Trainers, have no glitch items and have no Super Glitch Pokémon, cannot do the Pokémon box byte shift glitch because of having no Q and/or a box 1 that was filled before, cannot do CoolTrainer due to the difficulty (needing glitch Pokémon or box shift glitch to work to learn it) of getting it as the first move, that may create a problem though. The Cable Club escape glitch would save you by letting you encounter fossil/ghost Missingno. I think, but that requires a link cable.

So I wonder if there is a way to get a stack of 255 items in Yellow from no Trainer flies?

Additionally, SheNanagans said you can achieve box underflow with this, so I'm going to have fun with that.

Edit: You don't need to toss all of your items below the stack of 255. The only difference is that I just tossed the 255 stack on the top until my number of items became 1 before moving on to the toss 253 bit of the new method.

Re: Dry Underflow

Posted by: Dabomstew
Date: 2015-01-31 02:15:36
Yeah, it's not too difficult to "keep" the items you want and still do dry underflow provided you have two useless items to toss away to establish your three 255 stacks. Unfortunately (again from a speedrunning perspective) you lose 2 of your item slots and can only hold 18 items in your "real" inventory after doing this, but overall this is still a very useful trick.

That tidbit about being able to establish item underflow on pretty much any possible R/B save with the combination of this and Cinnabar Coast is a cool fact. Yellow is a bit tricky, but you can still death-fly with a bit of patience if you have any trainers that see you at all available in places where you can get encounters (mt.moon, rock tunnel, victory road, pokemon tower have a lot, other places are a bit meh). Past that I have no idea how you'd do it though.