OLD MACO DOCUMENTATION FOR ZELDA OOT DEBUG ROM HACKING.

**MAKING CUSTOM SWORDS AND/OR ITEMS** 
A Tutorial by Jason777


For those of you who thought this was going to be a lot more time-consuming than display list porting, boy are you wrong! This takes about 3 minutes at the least!

**I will be doing this on the OoT Debug ROM**


Before you begin this tutorial you must meet these assumptions:
Code:
 
*You already have created your sword and exported it in the OBJ format
*You have the OBJ, MTL, and corresponding texture folder in the same folder as wotf.py or obj2area
*The sword cannot be too detailed or else it'll cause the game to crash (faces/polys around 1000-1500)
*You know the correct scale or size
*You know the correct rotations (To fix up the model afterwards)
*You have Python Version 2.5.2 installed (to be able to run python scripts/programs)
*The textures on your model must be 32x32 24-bit BMP's or 32x32 PNG's (higher releases of Obj2Area support bigger and smaller texture sizes, but... I'm using release2)
*You have a little knowledge of hex editing and display lists
*You know how to create a batch file :P 
*You have a Hex Editor (I recommend HxD)
*You have Obj2Area
*You have and have configured Rice's Video Plugin (To prevent graphic / video errors on emu’s)


^^ Ok, if you meet all of the above continue....

So, you have created a really epic (BUT LOW-POLY) sword and you want use it in-game for OoT (and MM), this tutorial will teach just how it’s done!

Here is the usage for obj2area's counterpart, wotf.py, which is used to create F3DEX2 display lists from wavefront OBJ

Code:
 
Usage: wotf.py [options] [object file]

Options:
-s [float]  : set vertex scale
-sa [float] [float] [float]  : set x/y/z vertex scale
-st [float]  : set uv scale
-b [hex/oct/dec val]  : set bank to use for output file
-a [hex/oct/dec val]  : set start offset to start writing data to
-o [string]  : output filename 
-h, --help  : help message


We will be using the options -s, -b, -a, -o. We will not be using -sa, -st. Option -sa is for more specific scaling dealing with XYZ and option -st is for texture scaling. Alright, so on to creating the batch (BAT) file!

-- Open up Notepad or something of similar use --

The length of Biggoron's Sword in millimeters is around 6300 (I use the millimeters template, sorry ) so use that measurement to fix your scale. The bank of most models is 06- there is a list of bank values you could use following this paragraph. The address we want to begin writing data is 0x37800 since that is the end of Adult link's ZOBJ file. The ouput can be anything we want like "custom_sword.bin". At the end of BAT file we have the name of the file that we want to convert.

Here is a list of bank values you could use:
Code:
 
Bank Values:

06 inline obj
05 gameplay_field_keep OR gameplay_dangeon_keep
04 gameplay_keep.zdata
03 inline map
02 inline scene


In the end our BAT file should look like this:
Code:
 
wotf.py -s 1 -b 06 -a 0x37800 -o custom_sword.bin Example.obj


EXPLANATION:
Code:
 
-s :    Our scale is 1
-b :    Our bank is 06
-a :    Our address to start writing to is 0x37800
-o :    Our output filename is custom_sword.bin
Our file we are converting is Example.obj


Save As--> WOTF.bat

Alright now place your OBJ, MTL, and texture folder all into the folder that holds wotf.py and obj2area. Run WOTF.bat and wotf.py will open to make the conversion. When wotf.py is finished it will give you this "Display List: XXXXXX", jot down whatever the "XXXXXX" is because we will need that for later.

Now, open up the newly made BIN file in a hex editor. Go To 0x37800 (or whatever you put in the BAT file for option -a) and copy everything from there to the very end of the file since that is the actual data. Then, Open up object_link_boy.zobj (the adult link ZOBJ) and go to 0x37800 (Which is the very end of the file). PASTE INSERT (not PASTE WRITE) the data you copied from the BIN file at then end. You are finished inserting the data into adult Link so that way if you go into UoT and you open up the ZOBJ, you will find your custom weapon as the very last display list.

It is time that we replaced one of the already existing swords (or another weapon if you want) with our sword. Go to 0x238C8 (Display list start) in the ZOBJ to replace the high-poly Biggoron's Sword. When you are at 0x238C8 you should see an E7 command:
Code:
 
E7 00 00 00 00 00 00 00   ; this marks the beginning of a display list most of the time



What we are going to be modifying is the data right after that 8th byte. We are going to be placing a DE command to append display lists to that one. Here is the format for the DE command we will be placing:
Code:
 
DE 00 00 00 BB XX XX XX    

BB        = Bank               ; we will be using 06
XX XX XX     = Display List to attach       ; wotf.py gave you this


After typing that DE command, we are going to want to place another DE command right after it so that way Link's hand is attached to it when he draws it. Here is the format for the DE command we will be placing:
Code:
 
DE 00 00 00 BB YY YY YY

BB        = Bank               ; we will be using 06 AGAIN
YY YY YY    = Display List to attach       ; adult link's high-poly left fist is 0x21CE8


Next, we want to place a DF command (marks the end of a display list) right after that last DE command so that way the Biggoron Sword doesn't load up along with your model and Link's fist. Here is how we would write a DF command:
Code:
 
DF 00 00 00 00 00 00 00


Here is an example of how the start of the display list to the high-poly Biggoron Sword should look like after you are done modifying it (wotf.py provided me with a display list offset start of 0x391EC):
Code:
 
E7 00 00 00 00 00 00 00 DE 00 00 00 06 03 91 EC DE 00 00 00 06 02 1E C8 DF 00 00 00 00 00 00 00


^^ If it looks exactly like that except with a different XX XX XX value then you're doing it right. Alright, we're done modifying the adult link ZOBJ; you can save. Be sure to save the file as something else and name it something you can remember like "custom_sword.zobj".

Now, we are on the final step- inserting the new adult Link ZOBJ at free space in the ROM and then changing its original entry in the file table to its new location.

Okay, open up the full Debug OoT ROM in the hex editor. Copy your entire modified ZOBJ and PASTE WRITE it at free space in the ROM (use 0x35CE040 if you don't know where else) and write down it's ending offset because we need it for the next step. Scroll all the way to the very beginning of the ROM now (I get an error when trying to search sometimes if I don't do this). Next, you will want to search for adult link's original offsets. Type this and search:
Code:
 
00FDC00001013800


We want is the second result NOT the first. The second result should look like this (which is the start and end offsets combined):
Code:
 
00 FD C0 00 01 01 38 00


We want to change that to whatever the start and end offsets of you modified ZOBJ is.

Here is an example of how it’s done. Let's say it starts at 0x35CE040 and ends at 0x38DF071, here’s how I would overwrite the original ones:
Code:
 
03 5C E0 40 03 8D F0 71


^^ If it fits those 8 bytes correctly than you're finished! Save your ROM and test out your new Weapon!! Of course if you model is extremely detailed and it doesn't load then... BUMMER 

**OPTIONAL EPICNESS**

You have done everything that is absolutely necessary to make custom weapons, BUT here is how to really make it look LEGIT once you get the hang of it 
Code:
 
* Correct the rotational values on you model if it needs it
* Replace the low-poly version of the original item with your model
* Replace the original icon texture with one of you own using ZLE
* Replace the GI object with your model
* Make you item unique by adding effects to it


Okay! You have completed the tutorial! Is the tutorial easily understood? Do I need to give download links? Do you need me to post pictures? If you have any questions and/or comments feel free to post them.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
***INSTED TUTORIAL 
By Sylux102

This is pretty straight forward but I decided to make a tut so others wouldn't repeat my mistakes.

Required Items:
InstEd (duh)
Any MIDI editor (I'm on windows and use mixcraft but any will do)
Data table of song numbers (found in song replacement tutorial)

Step 1:

Open InstEd. Also open the ROM you are going to edit.

Step 2:

Prepare an MIDI to be used. Instruments don't matter. Neither does length, but make sure it's loopable (if you want looping) and make sure there is only one note played at any given time on the same track (ie no chords, split those up into different tracks)

Step 3:

Go back to InstEd and make a new instrument set. This is done using what the program first displays. The table on the left is for the instrument number, and the expandable tree on the left is for selecting the actual instrument. So click in any of the slots on the right (on my pc they say "none") and then find and select an instrument from the left. That slot on the right should now display the instrument you selected (ie on mine it goes from "none" to "violin")

Step 4:

Save the set as a binary file in an easy to access place (desktop etc). It should show up as xx.zset, where xx is the filename you gave it.

Step 5:

Find the MIDI converter (somewhere next to file option should be a drop down with this utility in it) open your MIDI and click convert. This will create .txt files from the MiDI tracks.

Step 6:

Open each .txt file (except control.txt) and add the line "instr XX" in the first section (ie before big empty space) where XX is the number of the instrument in the zset you created. This is the instrument used for that track.

Step 7:

Go to the same menu you found the converter in and there should be more options. One is "insert instrument set to ROM" or something similar. Open that and then open your ROM and your zset. Where it says "0x03" or something like that is the instrument set from OoT you will replace. Spinouts site has a list for those sets. Change it to the one that the song you are replacing uses. Then click insert.

Step 8:

Almost the same process a above, except open the MIDI inserted and open your ROM and control.txt (created by the midi converter). Where it says "2" you change to the song you want to replace. Click insert and you're done. Simply recalculate CRC with GZRT or something like that and test!

But wait! I want to replace the lost woods song, and the code is 3E! InstEd says "3E is an invalid integer"! How do I do this?

For all songs it is easier to take a little extra time to type in "0x".before the code. So the "2" would change to "0x3E" to replace lost woods. DO NOT TYPE A DECIMAL NUMBER! IT WILL CRASH YOUR ROM ON LOAD!
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DISABLING THE DEBUG CONTROLS FOR OOT DEBUG ROM HACKS
By Xenon

Thanks goes out to duuthbuskut for finding this.

Make file 1 into a normal file:
1. go to B20434 in ROM and write 00000000 over the four bytes there.
2. go to BDF648 and change 15C0001B to 1000001B.
3. go to B20488 and write 10000002

Disable noclip (when you press L+dpad-right)
go to C1EC04 and change 11E00080 to 10000080.

Disable map select
go to B3D954 and write 10000009

Disable debug camera
1. go to AD0AA0 and change 3B2E0001 to 00007021 (fixes controls).
2. go to AD0AEC and change 11200022 to 10000022.

Disable item debug (L at start menu)
go to BEEC20 and change 24190001 to 24190000.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HOW TO PORT MUSIC FROM MM TO OOT
By GANONdork123

Since the tutorials are scarce for this topic I will make a tutorial myself. First off, download this zip archive and extract it somewhere: Download
DO NOT EXTRACT TO THE DESKTOP!!!!!
Once extracted run the run.bat file. this will dump all the songs from MM. To make things simple, lets port Termina Field's theme. the file for it is "seq_0a_0202.zseq" You can now just insert the sequence via InstEd. There is a tutorial for it on Maco. Termina field uses the same Instrument set as Hyrule Field so it should work fine. I do not know how to dump Instrument sets yet. if you want to port a different theme, refer to this
MM Music Values
Sequence File: "seq_XX_02??.zseq"
Replace ?? with the values below.
Replace XX with a letter value since some songs are in parts such as "seq_0a_0202.zseq" and "seq_0b_0202.zseq"
00 nothing
01 nothing
02 termina field
03 chase theme
04 majoras mask
05 song of healing(theme in clock tower)
06 stone tower temple
07 stone tower temple upside down
08 chase theme(start)
09 skull kid with mask
0A song of healing angry mask seller
0B song of healing organ
0C southern swamp
0D UFO attack
0E mini game
0F Song of death
10 great bay
11 Ikana valley
12 deku palace
13 snowy fields
14 gerudo fortress
15 clock town day1
16 clock town day2
17 Clock Town day3
18 fairys fountain
19 Get epona
1A enemy
1B boss battle
1C deku dungeon
1D clock town day 1
1E intromusic
1F house
20 Game over
21 beaten boss
22 got something
23 clock town day 2
24 got heart container
25 water race
26 goron race
27 music box house
28 fairy fountain
29 zeldas lullaby
2A Kameros dance
2B opening a chest
2C ghost shop
2D the four giants
2E song of storms
2F romani ranch
30 goron domain
31 mayors office
32 eponas song
33 suns song
34 song of time
35 song of storms
36 zoras domain
37 get mask
38 mini boss
39 get skulltula token
3A astral observatory
3B ikana valley
3C chateau romani bar
3D got something good!
3E lost woods
3F lost woods
40 Horse race
41 won horse race
42 beaten horse race
43 kotake and koume
44 shop
45 owls melody
46 game house
47 owls song
48 song of healing
49 song of inverted time
4A song of double time
4B deku royalsong
4C goron lullaby(complete)
4D new wave bossa nova
4E elegy of emptiness
4F oath to order
50 sword game
51 goron lullaby(incomplete)
52 something good happened
53 marching song
54 chateau romani bar minigame
55 being warped by owl song
56 chateau romani bar
57 past midnight (day3)
58 zora guitar played by dying zora
59 single guitar strike
5A don geros song
5B Deku royal
5C goron lullaby
5D New wave bossa nova
5E Elegy of emptiness
5F oath to order
60 path on day 3
61 zora song quest ocarina
62 zora song quest (half complete)
63 - Zora song quest (Complete)
64 - Zora band (vocal)
65 - Snowhead Temple
66 - Water Temple
67 - New Wave Bosa Nova (Guitar)
68 - New Wave Bosa Nova (Zora singing)
69 - Last Boss 3 (Final Boss)
6A - Last Boss 2
6B - Last Boss 1
6C - Zora Guitar playing Color Dungeon Music from The Legend of Zelda: Link's Awakening DX
6D - Zora playing drums
6E - Zora Playing a piano
6F - Ikana Castle again
70 - Calling the four gians
71 - Kamero's Song (Flute)
72 - Carriage Ride
73 - Garo's Song
74 - End Credits 1
75 - Mysterious Woods at beginning of game
76 - Intro Movie
77 - Majora's Mask Released
78 - The moon has been beaten!
79 - The moon has been beaten! (Long version)
7A - Nothing
7B - Majora's Mask reveals it's true intentions
7C - The Giants leave!
7D - Song of Reunion
7E - The world has been saved!
7F - End Credits 2