Editing RAM

From OoT Randomizer Wiki
Revision as of 17:42, 13 July 2021 by ETR BTF (talk | contribs) (finished the section on how to manipulate your inventory)

This page is still a work in progress

For the purpose of fixing softlocked/"unbeatable" seeds and for helping staff members recreate reported issues.

Accessing and Using the Hex Editor / Debugger

Bizhawk

With your ROM loaded, head to ToolsHex Editor. A new window should pop up. Next, go to OptionsMemory Domains and select System Bus. Also go to OptionsData Size and select 1 Byte. Navigate to the relevant address (e.g. 8011A644) by hitting CTRL + G or going to OptionsGo to Address.... To make changes to the RAM, right-click the relevant byte and select Poke Address. In the new window enter the value you want to change the byte to and hit Poke to confirm. Your changes should be reflected in the game immediately.

Project64

To enable the debugger, go to OptionsSettings...Advanced and check Enable debugger. Click Apply.

Close the settings window and go to DebuggerView memory.... A new window should pop up. Right-click any of the bytes in this window and go to Byte group size1. Navigate to the relevant address (e.g. 8011A644) by entering the address in the field in the top left corner of the window. To make your changes, simply select the location where you want to make your change and type in the value. Your changes should be reflected in the game immediately.

Dolphin

Soon?

Finding the Correct Address and Value

In everyday life we use a "base 10 numeral system", which means that we use 10 different symbols for denoting numbers: "0-9". When we add one more to 9, we loop back to 0 but prefix it with a 1 to indicate that we've looped back once and we get the number "10". The hex editor/debugger uses a "base 16 numeral system" instead, which means it uses 16 different symbols for denoting numbers: "0-9" (for the numbers 0 to 9) and "A-F" (for the numbers 10-15). "Decimal numbers" are what we call the symbols of the first system and "hex numbers" are what we call symbols of the second system. To properly use the hex editor/debugger you will need to count in hex numbers. Fortunately, most calculators and many tools online can convert numbers between both numeral systems for you.

Item Select Screen

The locations of your items on the item select screen (i.e. items you can put on C buttons) start at address 8011A644 and last for 24 bytes (i.e. 24 double digit hex numbers) as seen in the image below.

The value of the first byte determines what item is in the first slot, the value of the second byte determines what item is in the second slot, etc. The ordering for the slots follows the "logical" western reading order, that is it starts in the top left corner and goes left-to-right and top-to-bottom. Below is a table that tells you which hex numbers correspond to which items. Keep in mind that this table is only true for these 24 bytes in the RAM.

If you want to test if you understood everything so far correctly, then try to work out the inventory of the RAM in the first image of this section. The answer is: Deku Nuts in the Deku Nuts slot, Din's Fire in the Din's Fire slot, Ocarina of Time in the Ocarina slot, and Megaton Hammer in the Farore's Wind slot (whoops!).

The addresses for ammo counts (e.g. Deku Sticks, Bombs, Magic Beans) start at 8011A65C and is 15 bytes long. However, only 7 of these bytes correspond to relevant ammo counts: the 1st, 2nd, 3rd, 4th, 7th, 9th and 15th (see image below). These are the counts for Deku Sticks, Deku Nuts, Bombs, Arrows, Deku Seeds, Bombchus and Magic Beans respectively. Using or obtaining additional ammo without the associated ammo holder, such as a Quiver for Arrows, will immediately drop the ammo count to 0. Note that even Deku Sticks and Deku Nuts require an "ammo holder". There are two ways to prevent this. Firstly, you can right-click the relevant bytes and choose Freeze (Bizhawk) or Lock value (Project64). Alternatively, you can give yourself the relevant ammo holders. This information is laid out in memory in a considerably more complicated way than the other "items" mentioned in this guide, so to keep things simple we will just give you the value for having the maximum of every upgrade, and after you've resolved your softlock you can revert these bytes to their original value (make sure to write them down beforehand). Go to address 8011A670 and change the first 4 bytes into 00 36 F4 DB.

To give yourself Magic, set the byte at 8011A60A to 01, and the byte at 8011A603 to 30.

Equipment Screen

The address for modifying Tunics and Boots is 8011A66C, and the address for Swords and Shields is 8011A66D. They are both a single byte long. The first digit of each byte controls the Boots and Shields, and the second digit controls the Tunics and Swords. Changing any of these digits to a 7 will give you all Swords/Shields/Tunics/Boots. If you don't want to have them all but only 1 or 2, then try different numbers in the range 1-7 until you get the layout you desire. Keep in mind that if you want the Biggoron Sword instead of the Giant's Knife, you'll have to change the byte at 8011A60E from 00 to 01

If you want to play around with the famous "F boots" (= anti-gravity boots), then change the byte at 8011A640 into F1.

Quest Status Screen

The address for modifying the Spiritual Stones, Song of Time, Song of Storms and Gerudo Card (and some irrelevant things) is 8011A675, the address for Bolero of Fire, Minuet of Forest and the Medallions is 8011A677, and the address for the other songs is 8011A676. They are all a single byte long. Changing these bytes to FF will give you all of the items and songs. If you don't want to have them all but only a certain combination of them, then manually try different hex numbers. A systematic approach to finding the right number would be to increment the current hex number by 1 until you find the right one.

Keys

Below is a table that gives the addresses for the Small Keys and Boss Keys of all the relevant locations. They are all 1 byte long. For the Small Keys you can just insert the number of keys you want. For the Boss Keys you'll want to use one of the following numbers depending on if you also want the Map and/or Compass: 01, 03, 05 or 07.