Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Pokémon cheat codes
Pokémon glitch terminology
Useful tools
More

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: mew glitch + item underflow  (Read 216 times)

0 Members and 1 Guest are viewing this topic.

davidenettuno

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
mew glitch + item underflow
« on: July 15, 2019, 04:16:03 pm »
I'm starting to study pokemon blue techniques. In the video I would like to understand what exactly happens in memory after activating the item underflow glitch. Because it positions itself in that specific spot for slowpoke combat
https://www.youtube.com/watch?v=8dyE0XWNylA

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • PSYNCIN' IN THE VaiN
    • View Profile
Re: mew glitch + item underflow
« Reply #1 on: July 15, 2019, 04:24:50 pm »
wNumBagItems is changed to something above 20. In the case of underflow, it's "decreasing" it from 0 to 255.

Also, welcome!
« Last Edit: July 17, 2019, 04:11:48 pm by Sherkel »

I come and go. Apparently still more than most of the other regulars, so hard to say it's a semi-hiatus of some sort. Suggestions for wiki organization are appreciated here if you haven't seen this thread yet.
I don't have a habit of keeping Discord open, so direct inquiries are still preferred through here.

davidenettuno

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: mew glitch + item underflow
« Reply #2 on: July 18, 2019, 01:26:22 pm »
Thanks for the reply. But would you mind explaining in detail?

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • PSYNCIN' IN THE VaiN
    • View Profile
Re: mew glitch + item underflow
« Reply #3 on: July 18, 2019, 03:13:49 pm »
Shen is using dry underflow in the PC, letting him change bytes at will starting from here: https://github.com/pret/pokered/blob/master/wram.asm#L2637 . A lot of what he does after that is...admittedly beyond me. The basic idea is that it centers around map script pointer manipulation, letting him fight a trainer that has a Slowpoke with the right Special stat to find Mew with the trainer escape glitch without having to actually go to where the trainer is originally located.

Catching all 151 as quickly as possible is pretty complicated and was part of what helped push glitchology to the limits it's reached, and I'm still catching up on a lot of it. The guide here starts with the basics, and the run itself is a matter of combining and executing those in different ways. I'd recommend looking at the links at the beginning of that guide.

I come and go. Apparently still more than most of the other regulars, so hard to say it's a semi-hiatus of some sort. Suggestions for wiki organization are appreciated here if you haven't seen this thread yet.
I don't have a habit of keeping Discord open, so direct inquiries are still preferred through here.

davidenettuno

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: mew glitch + item underflow
« Reply #4 on: July 18, 2019, 03:55:18 pm »
thank you for the help

Evie the Mother Hen ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • I love My Melody. 🦋 ✿
    • View Profile
Re: mew glitch + item underflow
« Reply #5 on: July 20, 2019, 07:14:04 am »
I'm starting to study pokemon blue techniques. In the video I would like to understand what exactly happens in memory after activating the item underflow glitch. Because it positions itself in that specific spot for slowpoke combat
https://www.youtube.com/watch?v=8dyE0XWNylA

It works something like this.

The cause called "dry underflow" exploits an obscure mechanic that allows item quantities to merge to become one stack if they are the same base item (e.g. two Ultra Ball stacks), as well as
a x255 stack's ability to reduce the number of items by both reducing the number of items in the bag and copying itself after tossing directly above it - which works because Cancel buttons are 0xFF (dec:255), so the game must only move items above that if you tossed all of a stack.

We first toss above x255 to obtain three x255 items at the top with a registered item count of 1. Although the item count is 1, the second item can still be selected (just not possible to use as a Cancel would be). Tossing 253 of the top item leaves us with x2. Swapping the x2 stack with the x255 stack below 'merges' the two, converting the top into x1 and making the item count x0. Repeating this (leaving us with the remainding third x255) due to item count being a standard one byte value underflows x0 by subtracting 1, resulting in an item count of x255.

With the item count of x255, items beyond slot 20 can be selected, and items 1 through 20 occupy memory addresses D31E-D345 (see Game Boy memory structure. Now, items 21 and their quantities will be loaded and upon modification saved as extrapolations of D345; so item 21 is D346, item 21 quantity is D347 and so on - allowing us to have control over unrelated RAM such as your rival's name, the exit map and much more. The memory addresses can be analysed here: https://github.com/pret/pokered/blob/master/wram.asm with corresponding items and quantities here  https://glitchcity.info/wiki/Expanded_bag_item_documentation_(Generation_I) but for elaborate explanations of specific tricks an understanding of how they work is needed; for instance D35F-D360 is a pointer for the top-left tile block of a map. Note that apparently due to an arithmetic error in the engine, items 129-255 are a copy of items 1-128. Additionally if using Yellow you'll have to interpret all of the Red/Blue expanded items pack addresses by -1.

Hope this helps with your questions. :)
« Last Edit: July 20, 2019, 07:21:05 am by Princess Torchic Owl Lover ☽ ❤ »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post :)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Transgender woman but spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman/I'm a 'girly' nerd who discovered herself. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3