Setup - ds-pokemon-hacking/White2Upgrade GitHub Wiki

Dependencies

You will need the following tools to use this repository:

Installation

Windows

Install Windows Subsystem for Linux, then utilize the Linux guide.

Linux

Installing System Dependencies

In order to build White2Upgrade, one must install a few dependencies. Most of these dependencies only need to be set up one time, with the exception of ndstool which may be updated. The specific instructions for this are distribution dependent, but we will assume that you are using Ubuntu (as that is default that comes with WSL).

  1. Install all of the system dependencies. On Debian/Ubuntu, the following set of commands should work:
# Update repo packages to latest.
sudo apt update

# Install base-devel metapackage, libpng
sudo apt install build-essential libpng-dev 
  1. Next, install the cross compilation tools (in this case, arm-none-eabi 13.2).
sudo mkdir -p /opt/gcc-arm-none-eabi-13_2
curl -L https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz -o arm-gcc.tar.xz
sudo tar xf arm-gcc.tar.xz -C /opt/
rm -rf arm-gcc.tar.xz
  1. Add the cross-compilation tools to your PATH on your shell startup. Assuming you are using bash:
echo 'export PATH="$PATH:/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin"' | tee -a ~/.bashrc
source ~/.bashrc
  1. Now, build and install ndstool.
# Clone ndstool and cd into directory
git clone [email protected]:devkitPro/ndstool.git
cd ndstool

# Run autogen and configure to generate a Makefile
./autogen.sh
./configure

# Build the tool and install it to /usr/local/bin 
make -j$(nproc)
make install

Installing White2Upgrade

Cloning & Setting Up Dependencies

Before starting, make sure you are in a directory where you would like to store this project (i.e Documents or similar).

  1. Clone this repository, and change directory into it.
git clone --recursive [email protected]:ds-pokemon-hacking/White2Upgrade.git
cd White2Upgrade

Do not omit the recursive flag, or you will not have all of the necessary submodules associated with this repository.

  1. Download CTRMap (Community Edition), and put CTRMap.jar in tools/CTRMap, making the directory if it does not exist.

  2. Grab a fresh American Pokémon White 2 ROM (preferrably one with the SHA256SUM 3e50aec3db401332175a5d2b5fe2a68ac1a05ec63995dba9d1506b1b51837446), name it IRDO.nds, and place it in the root directory of the repository (i.e in the same folder as Makefile).

  3. Run make tools to build all of the tools associated. You should see no errors, and the log should look something similar to this:

[+] Building blz...
tools/blz/blz.c: In function ‘Title’:
tools/blz/blz.c:109:10: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  109 |   printf("");
      |          ^~
[+] Building nitrogfx...
[+] Building knarc...
[+] Building o2narc...
  1. Run make base to prepare the ROM contents for the build. You should see no errors, and the logs should look something similar to this:
[+] Extracting game to build/IRDO...
Nintendo DS rom tool 2.2.0 - Jul  2 2023
by Rafael Vuijk, Dave Murphy, Alexei Karpenko
[+] Decompressing all overlays...
[+] Installing PMC...
y9
Namespace(type='y9', input='data/overlay_table.yml', output='build/IRDO/exefs/ARM9OVT.bin', ex_parameters={})

Building

Once the repository is setup, run make -j$(nproc) to build the ROM. This will also be the command used to build every single time a change is to be made to the local repository instance.

If all goes well, you shall see White2Upgrade.nds at the end of your build.