Setting up ages-disasm

From ZeldaHacking Wiki
Jump to: navigation, search

The disassembly uses WLA-DX as its assembler. Follow this guide to set up ages-disasm into a compileable state.

Windows

  • Download and install Cygwin on your computer (64-bit version). Cygwin provides a linux-like environment on Windows.
  • Continue with the default settings in the installer until you reach the "Select Packages" window. If you accidentally went past this, you can run the installer again to select the packages.
  • Select the following packages:
    • Interpreters -> python (NOT python3, although you can install that too)
    • Devel -> git
    • Devel -> make
  • Download wlalink.exe and wla-gb.exe (last updated Dec 16, 2017), and place them in C:\cygwin64\usr\local\bin.
    • Alternatively, skip this step and follow the instructions for compiling wla-dx in the Linux section later.
      • You will need to install the cmake and gcc packages if you do this.
    • (These precompiled binaries probably won't work on a 32-bit cygwin installation).
  • Start up a Cygwin terminal and follow the instructions for Linux.

Linux

Prerequisites

  • Standard building tools (Bash, Make, gcc)
  • CMake
  • Git
  • Python 2

Procedure

  • Compile wla-dx (skip this step if you downloaded the .exes from the cygwin section):
    • Clone this fork of wla-dx and checkout the "labels" branch:
git clone https://github.com/vhelin/wla-dx
cd wla-dx
  • Compile it:
cmake .
make
  • Copy the binaries to somewhere in your PATH:
cp binaries/* /usr/local/bin/
  • Clone the disassembly:
cd ~
git clone https://github.com/Drenn1/ages-disasm
cd ages-disasm
  • Run make. On a successful build, the final line should say rom.gbc: OK, indicating that the ROM produced is an exact copy of the US Oracle of Ages rom.

Configuring

By default, the disassembly is configured to build a clean ROM by using precompressed assets. This isn't useful if you want to edit graphics or text, for example.

To change this, run the "swapbuild.sh" script. The output should look like this:

$ ./swapbuild.sh
Switching to modifiable (non-precompressed) mode
'build' -> 'build_v'
'build_e' -> 'build'
removed 'rom.gbc'

You can now run make again to build everything from uncompressed assets. This first build may take several minutes, depending on your computer's speed. To speed it up by using 4 threads, run make -j4 instead.

Potential errors

PARSE_DEFINES_AND_GET_FINAL_NAME: Error in commandline options.

You're using the incorrect version of wla-dx. You should either use the provided binaries, or a recent build from github.

ImportError: No module named site

This seems to be caused by conflicting python installations between Windows and Cygwin.

A temporary fix is to run export PYTHONHOME=/usr/ before running make again. Add this line to your ~/.bashrc file to make the fix permanent.

What next?

Once you have ages-disasm working, see some of its uses.