Salvage Item Manipulation

Technical Explanation

Explanation by LagoLunatic

On the frame the grappling hook hits the sunken treasure: if forest water expires; or if a cutscene is cancelled with storage; then the salvage point tag you're about to salvage will no longer count as the active one, but it still triggers the salvage. Because there's no active tag, the active index is set to -1. There's no sanity check in place to prevent the chest from coming up when the index is negative. This means that the game tries to read the item ID from 4 bytes before the start of the list in RAM instead. Since this byte is unrelated to the sunken chest, it could be literally anything. This allows for salvaging any of the 255 (used and unused) items in the game.

After closing the textbox for the item, the game normally crashes because it reads the salvage to be the kind of salvage corresponding to treasure charts (kind 0). It then fails to to save the treasure chart information, because it ends up in an invalid range (0 again). This crash can however be avoided by fishing up the treasure chest with Storage.

Heap Setup

No matter the method used, the memory must first be setup in order for you to salvage the item you want. At 0x803EA014 on JP and at 0x803F6B44 on US there is a pointer to an address, and 4 bytes before that pointed address is what is read to be an item ID. If you can control that byte then you can obtain any item that you want early. Currently, there are no good setups that are not luck-reliant. Once that byte has the value you want, you can proceed with performing the glitch.

Example of luck-reliant setup to get the Hookshot

Method 1 - With Cutscene Storage

Get Storage and store the pirate ship password door at Windfall, climb in the boat and get ready to salvage a sunken treasure (it can be any kind of treasure, one from a chart or one from a light ring). Salvage the chest and activate a cutscene on the same frame the grappling hook hits the chest. You must also release the grappling hook button right as it hits the chest or a little bit before (the frame window can vary). Then close the password text to cancel the salvaging animation. Reload the area to obtain the item, just like with chest storage.

The password text is currently necessary because it is one of the rare textboxes that can be used to cancel the salvaging animation alltogether, kind of like Door Cancel. Cancelling the salvaging animation is required to avoid the crash. The cutscene that activates and gets stored on the same frame the grappling hook hits the chest must be a cutscene entirely cancelled from having storage. Cutscenes that are known to work in theory are:

  • Shooting the Windfall Lighthouse with a fire arrow
  • Making a chest spawn at a platform (using Tingle Bombs)
  • Receiving Mail

Due to the password text being required, only the first cutscene currently works without crashing.

Method 2 - With Forest Water

Have a bottle with forest water close to expiry. Get Storage, climb in the boat and get ready to salvage a sunken treasure (it can be any kind of treasure, one from a chart or one from a light ring). Salvage the chest and have forest water expire on the exact same frame as the grappling hook hits the chest. You must also release the grappling hook button right as it hits the chest or a little bit before (the frame window can vary). The forest water text will then appear and you can close it to cancel the salvaging animation. Reload the area to obtain the item, just like with chest storage.

Method to avoid the crash

This trick relies on a frame perfect forest expiry and a small frame window for releasing the grappling hook, it is thus very difficult.

Uses in Speedruns

The main use of this trick is to obtain the Hookshot early. With an early hookshot, it is possible to enter the Earth Temple early.

Due to the volatilness of the known setups to get the Hookshot and the difficulty of the trick, it is currently considered TAS-only.

Last updated 01/12/2022 – azer67