Get Item Manipulation

Get Item Manipulation (GIM) is a memory manipulation glitch which can be used to modify which item you receive from an item drop. This is possible by first performing Get Item Delay (GID), a collection of different tricks that allow you to interrupt the normal collection of an item that Link will display over his head. By doing GID, a flag that denotes that the player is getting an item will remain set, allowing you to obtain an item whenever you surface a body of water. From there, you can manipulate what item you receive by standing near certain actors that update Link's "Get Item" value.

Get Item Delay

When you normally collect an item that Link holds up, the game freezes other entities by setting one of Link's state flags (specifically, Link Instance + 0x66C, flag 0x20000000), sets a state flag noting that Link is getting an item (Instance + 0x66C, flag 0x00000400), and sets Link state such that the player can no longer move him. If you trigger an event that can zero out the freeze entities flag after you've collected an item you can re-enable enemy movement, which allows you to take damage from an enemy, which forces a state change and allows you to control Link while the item getting flag is still set.

Alternatively, it's possible to force Link into a "busy" state where collecting an item won't properly lock him down but still set the "getting an item" flag, negating the need to use an enemy to become un-stuck.

While the item getting flag is set, Link will be in an odd state. Bombs and Bombchus will stop updating once they leave Link's hand, meaning that they won't explode and will hang in mid-air, and cannot be used for hovers or similar. Sliding doors cannot be opened, only doors with a knob on it can.

Lastly, if you leave the area, die, or reset the game, GID will be disabled, since the state is directly stored in Link's instance.

The following item drops can be used to initiate GID:

  • Deku Stick
  • Deku Nut
  • Deku Seeds
  • Magic Jars
  • Heart Pieces
  • Shields
  • Tunics
  • Fire Arrow.

The item drop that was used to initiate the Get Item Delay does not have any effect on the item obtained from GIM. However, it does have an effect on whether GIM will crash later on.

Crawlspaces

If an item you can pick up is close enough to the crawlspace, you can enter it and exit it to stuck the camera for a short amount of a time, if you pick the item drop during that time, the camera will mess up and Link won't be able to move; however enemies should still be able to walk around, the idea is to get hit by one of them to be able to move again (note that you can cancel the textbox after getting hit)

Revived by a Fairy in Water

If you drown or just die in water the camera will mess up and you'll have to pick an item drop quickly and get touched by something afterward. If you die out of bounds, the animation of the camera spinning around Link will be delayed until Link is in bounds, giving you more time to perform the GID.

Swim on land glitch

Discovered By: GlitchesAndStuff

The original method for enabling GID is to use the swim on land glitch.
To activate this glitch, you need to be in water, equip Iron boots while holding Z and a direction to swim with Iron boots. Oddly enough this will make able to swim on land too, at that point you can unequip Iron boots.

Now if you dive and pull out a 1st person item (hookshot, bow...) you'll stay in a diving state. Collecting an item in this state will trigger GID, and incidentally store a ground jump.

This method is very interesting because it doesn't require any enemies after picking the item drop. However this can only be done as adult since you need Iron boots.

Grabbing a Vine While Underwater

This is the current method used in Any%. There are a few ways to do this method, which are shown below. They all require something special. The first shown method involves grabbing the vine out of an underwater superswim. The second method grabs the vine from out of bounds water with Return A. The third method grabs vines with Return A as the water is lowering.



Item Manipulation

Once GID is active, we can manipulate the state of the Get Item value to change what item can be obtained on surfacing a body of water. The Get Item value is a signed byte variable located at Link Instance + 0x424 (NTSC 1.0 address 801DAE54). The absolute value of the variable is used as the index to the Get Item table, which uses a different indexing than the one listed in the Item Chart. The sign of the value determines whether Link should be able to "immediately" obtain the current get item, or whether the item will be obtained by pressing A to open a chest (or other glitched actors).

The following list of actions will modify the Get Item value:

  • Moving near items will set the Get Item value to the proper positive id for that item (Heart Pieces, Ruto's Letter, Fire Arrow, etc.), thus giving you the same item.
  • Moving near fish, fairies (but not big fairies), or bugs will set an id of 126, which is corresponds to a zeroed record on the Get Item Table, giving you Deku Sticks
  • Getting within "Grab" on A range of liftable actors will set the Get Item value to 0 (rocks, bushes, pots, etc.). This will make the Get Item animation not play when you jump into water, so you will receive nothing.
  • Getting within "Open" on A range of chests will set the Get Item value to the negation of the Get Item id of the chest's contents.

Of the above, chests are the most important due to their negative Get Item value. Unlike opening chests, surfacing water with GID active does not negate the Get Item value before using it to perform a table lookup, meaning that GID allows us to look up data at an address before the normal Get Item table.

A list of items which are obtainable from the corresponding chest is here: https://docs.google.com/spreadsheets/d/1SLJzamokLb7wDOaJh5x8DsxmMBy9oIYawyDN3dAWppw

Rendering Crashes

In some scenarios, GIM will crash due to a malformed display list. The specifics are as such:

After spawning Link's instance, an ~0x2000 byte space is reserved for scene title cards (eg. the Kokiri Forest texture that appears when spawning in that area) and objectgi files. In this case, object files can be thought of as the files that contain model and texture data for actors and other entities. objectgi files are a subset of these files, containing model data for the items Link holds up over his head, or holds out when showing a trade item. The space is only big enough to store one file at a time.

If they're similar enough, a single objectgi file can store data for what are technically different items. For example, all of the differently colored rupees use the same objectgi file. Thus, there exists what is known as the GI model id, which is used to set what item to draw. It indexes a table containing a draw function pointer and an array of segment offsets pointing to the display lists required by the draw function.

When performing GID, the object file id and the GI model id of the item you collect is looked up from the Get Item table. The object file is loaded into the reserved space, and the GI model id is set, allowing the engine to draw the model. When performing GIM, the loaded object file remains the same, but the GI model id changes based on the Get Item value. Thus, the game will either render an incorrect model or crash when surfacing the water depending on the last file loaded into the ~0x2000 byte space, and the draw command data referenced by the item being GIM'd for.

Crashes can be avoided entirely by manipulating the camera so that the Get Item model is off screen (and thus never drawn). Another option is to pull out a trade item like the Magic Bean to change the object_gi file stored. However, the act of pulling out a trade item can crash the game for the same reason mentioned above.

Emulation Issues

In order to greatly speed up emulation, many emulators (including official Nintendo ones) default to a high level emulation of the N64's Reality Co-Processor (RCP). Instead of creating an accurate implementation of the RCP (which has it's own assembly language and is reprogrammable through what is known as microcode), emulators will intecept the tasks sent to the RCP and interpret the data directly. In other words, the emulator will interpret the display lists directly as it sees fit, rather than be constrained by the limitations of the RCP. Furthermore, unoffical emulators allow you to change graphics plug-ins which can drastically change the effects of GIM. Crashes in one plug-in can be ignored completely in another. And in some cases, absolutely bizarre errors have been known to happen.

Tested Scenarios

The following table contains a list of items that are generally known to work for GIM. However, it's entirely possible for there to be combinations of GIM that will not work.

Since object_gi files should be binary identical across versions, there should in theory be no differences between the PAL and NTSC versions.

Item/ConsoleWii VCGamecubeWii U VCIQue
Deku Stick
Deku Nut
Deku Seed
Heart Piece
Deku Shield
Hylian Shield
Goron Tunic
Zora Tunic
Magic Jars
Fire Arrow

For N64, items than can sometimes work are magic jars, deku sticks and both shields. Additionally, if you collect a Deku Nut, you can pull out either Magic Beans or Zelda's Letter safely, and attempt GIM with that.

Last updated 07/16/2018 – mzxrules