Making A Backup: Difference between revisions

From OoT Randomizer Wiki
Line 31: Line 31:


=== What You Will Need ===
=== What You Will Need ===
* [[Wii Virtual Console#Softmodding Your Wii|A Softmodded Wii]] or [[Wii Virtual Console#Softmodding Your Wii U's Virtual Wii Mode|A Softmoodded vWii]]
* [[Wii Virtual Console#Softmodding Your Wii|A Softmodded Wii]] or [[Wii Virtual Console#Softmodding Your Wii U's Virtual Wii Mode|A Softmodded vWii]]
* A Dump of your Ocarina of Time / Master Quest disc or Zelda Collector's Edition disc ([https://wiki.dolphin-emu.org/index.php?title=Ripping_Games Dolphin's wiki has a guide on doing this.])
* A Dump of your Ocarina of Time / Master Quest disc or Zelda Collector's Edition disc ([https://wiki.dolphin-emu.org/index.php?title=Ripping_Games Dolphin's wiki has a guide on doing this.])
* The [[Dolphin]] Emulator
* The [[Dolphin]] Emulator

Revision as of 08:01, 14 January 2022

For using the Ranodmizer you need to have a backup copy of Ocarina of Time on your computer. This guide will demonstrate how to do this.

Wii Virtual Console

The easiest method of backing up a copy of Ocarina of Time is by creating a WAD of the version installed on your Wii and then extracting that WAD using gzinject and finding the file called rom inside of the extracted contents.

What You Will Need

Getting and Setting Up gzinject

gzinject is an application by Krim/Krimtonz originally for putting the OoT Practice ROM in a WAD, but now has a variety of uses.

Windows: Download then extract the zip file. To run it, open the folder with gzinject in it, then click in the address bar and type cmd and press Enter. In the terminal that shows up you should be able to type gzinject and press Enter and see a bunch of information on how to use gzinject. If you do, move on to the next step.

Linux: Try using the WSL build of gzinject. It doesn't link to many libraries so should work without recompiling. If not, download the source code and then follow the BUILDING file on GitHub.

macOS: Currently you have to build from source. Setting up a build environment is out of scope for this guide, but once you have it set up you should be able to download the source code then follow the BUILDING file on GitHub

Once you have a version of gzinject that runs, you'll need to find yourself the Wii common key or figure out a way to generate one. It is the same file you will need to make a WAD on the online generator as well. The file should be placed in the same folder as gzinject and called common-key.bin. Once you have that in place, gzinject should be ready for use.

Extracting the ROM From the WAD

To extract all of the data from your dumped WAD, open a terminal and type gzinject -a extract -w . Don't forget the space at the end. Next drag your dumped WAD onto the terminal. This should put the path to the WAD at the end. If there is not a space between the "w" and the path, use the arrow keys to go back and add the space. If so, press Enter and gzinject should now extract the WAD to a folder called wadextract.

If it does not make sure that you have the common-key.bin file in the right place, and that you typed the command in the terminal correctly, including the space.

Now if you open the wadextract folder there should be another folder inside called content5 and inside of that folder is a bunch of files, but the one you are looking for is called rom. This is an Ocarina of Time 1.2 ROM that you can run in an emulator. If you want to use it for the Randomizer you will have to downgrade it to 1.0.

Gamecube

Another way to to make a backup of Ocarina of Time is by ripping a Gamecube disc to an ISO using a Wii and then extracting the ROM using Dolphin.

What You Will Need

Extract File From Disc

First, in Dolphin you will need to have the ISO backup of your GameCube disc in the list of games in the main window. If you need to add the path the files are located in, go to OptionsConfigurationPaths and click the Add... button. Next navigate to the folder with your ISO file in it and click Open.

With the backup in the game list, right-click the game and click on Properties then click on the Filesystem tab. You may need to click the arrows on the right of the tabs list to find it.

For a Ocarina of Time / Master Quest ISO, you will want to look for the zlj_f.tgc file for the US copy, if other copies do not have this file, you want the large 500MB+ size file. For Collector's Edition you want to open the tgc folder and select the zelda_ENG_090903.tgc file for the US copy, if other copies do not have this file, you want the large 480MB file. Right-click the file and click Extract File... and extract it to a folder.

Create ROM File From Extracted File

For this part you will want a hex editor for finding where the ROM is in the file we extracted.

For Windows: HxD is recommended. It will also be able to copy the data you find to make a ROM file. For macOS: Hex Fiend looks like a good choice. For Linux: Any graphical hex editor should work, or if you're experienced with hexdump that should also work.

First lets locate the ROM file in the extracted file using a hex editor. Open up the file in a hex editor, then open a find dialog. Hex Fiend has this located at the top of the window. Other software should be able to bring up one by pressing Ctrl+F or on macOS Command ⌘+F. Make sure it is in Hex mode, or you are typing in the Hex side of the window. Type 80 37 12 40 and try to search for that string. This is the "magic" header for a N64 ROM and all N64 ROMs start with these bytes.

Your hex editor should have a place on the window where it displays an "Offset" value somewhere in the window. Make sure you have the 8 or 0 in 80 selected and then write down this value. It is usually a hex value which means that it uses the numbers 0-9 and the letters A-F. Use this Hex to Decimal converter to convert the hex number to a normal decimal number. We will use this in the next section, but the next part is OS specific.

Windows

Now that you have the decimal value of where the ROM is located, press Control+E to open the Select block dialog. Make sure that the radio button next to the dec option is selected. In the Start-offset text box paste or type the decimal value of where the ROM is. Next click the radio button next to Length and type in that text box 33554432. Next click OK and the ROM file will now be selected.

Copy the ROM file's bytes with Ctrl+C, open a new file by pressing Ctrl+N. Next press Ctrl+S to save the file. Save it with a name you will remember such as Ocarina of Time.z64 or similar.

Linux and macOS

Now that you have the decimal value of where the ROM is located, open a terminal. Type cd and press space, then drag the folder you want to save the ROM in into the terminal such as your Downloads folder then press Enter.

We will be using dd to extract the relevant bytes from the file we extracted. Type dd skip= and paste the decimal value of where the ROM is located, then press space and continue the command with count=33554432 if= then drag the file you extracted using Dolphin into the terminal to put it's path here. Press space again then continue the command with of=OcarinaOfTime.z64 bs=1 and press Enter. This will create a file called OcarinaOfTime.z64 in the folder you chose earlier.