Atom - A Disassembly and Overlay Utility for Zelda64 - Printable Version
+- Hylian Modding (https://hylianmodding.com)
+-- Forum: N64 Zelda Modding (https://hylianmodding.com/Forum-N64-Zelda-Modding)
+--- Forum: Tools & Software (https://hylianmodding.com/Forum-Tools-Software)
+--- Thread: Atom - A Disassembly and Overlay Utility for Zelda64 (/Thread-Atom-A-Disassembly-and-Overlay-Utility-for-Zelda64)
Atom - A Disassembly and Overlay Utility for Zelda64 - mzxrules - 04-16-2018
Presenting Atom for Windows 10:
Atom is intended to be the ultimate all in one tool for creating custom overlays for the Zelda64 engine. While it's not quite there yet, I'd like to release what I have right now.
Atom is capable of generating a complete disassembly of NTSC 1.0 and the Debug Rom, and a partial disassembly of Majora's Mask J 1.0. Overlay disassemblies generated by this program are compatible with gcc, unless you specify the more readable option.
More importantly, Atom is capable of converting an elf object file (.o) into an overlay. From my testing, a binary generated from converting an overlay -> assembly -> .o -> overlay is functionally identical to the original, with only small parts of relocation data shifted around.
In order to disassemble a rom, or disassemble a single overlay from a rom, you must use the path command to set up the location of the rom you want to disassemble. This will create/modify a file called rom_path.xml. Once that's done, you can re-run the program and simply provide the gameid and versionid parameters to reference the rom of your choice when using the other commands.
for the gameid parameter, use "oot" or "mm" to represent Ocarina of Time or Majora's Mask.
for the versionid parameter, the following ids are supported for Ocarina of Time:
N0, //NTSC 1.0
N1, //NTSC 1.1
N2, //NTSC 1.2
P0, //PAL 1.0
P1, //PAL 1.1
GCJ, //NTSC-J GCN
GCU, //NTSC-U GCN
GCP, //PAL GCN
MQJ, //NTSC-J GCN MQ
MQU, //NTSC-U GCN MQ
MQP, //PAL GCN MQ
DBGMQ, //PAL MQ Debug
For Majora's Mask, the following ids are supported:
For converting elf object files into overlays, there are two commands: ovl and script.
ovl is pretty straightforward, but with the additional hidden feature in that if the symbol "initVars" appears in the object file, it will report back the address that the symbol was relocated to.
script allows for the automatic conversion of an elf file and injection the resultant overlay file into a rom. There are no safety checks performed to make sure that you injection addresses are accurate, so backing up your rom before injection is highly recommended.
the script format itself is actually a very simple xml format. the newscript command will generate "dummy.xml" which contains an example of all the parameters needed for the injection process.
One feature of the elf -> ovl conversion is that in theory, you can define your own custom sections provided that they begin with .text, .data, .rodata, and possibly .bss