A decompilation of Duke Nukem Zero Hour
Go to file
2024-10-23 10:56:51 +02:00
.github/workflows Initial prototype version compatibility 2024-10-23 10:56:51 +02:00
.vscode Match libmus 2024-04-16 14:31:58 +02:00
include Initial prototype version compatibility 2024-10-23 10:56:51 +02:00
libs Various fixes 2023-12-02 17:14:55 +01:00
src Initial prototype version compatibility 2024-10-23 10:56:51 +02:00
tools Initial prototype version compatibility 2024-10-23 10:56:51 +02:00
versions Initial prototype version compatibility 2024-10-23 10:56:51 +02:00
.editorconfig Add README 2023-01-11 14:42:35 +01:00
.gitignore Match controller.c 2024-04-21 11:18:07 +02:00
.gitmodules Initial FR version compatibility 2024-04-08 11:23:00 +02:00
diff_settings.py initial commit 2022-09-09 13:16:32 -05:00
Dockerfile Initial FR version compatibility 2024-04-08 11:23:00 +02:00
Makefile Initial prototype version compatibility 2024-10-23 10:56:51 +02:00
permuter_settings.toml Split maps+tiles 2024-01-04 13:51:03 +01:00
README.md Match libkmc 2024-04-17 18:43:01 +02:00
requirements.txt Initial FR version compatibility 2024-04-08 11:23:00 +02:00

Duke Nukem Zero Hour N64 Build Status Code Progress Bytes Progress

A decompilation of Duke Nukem Zero Hour for N64.

Note: To use this repository, you must already own a copy of the game.

Dependencies

The build instructions assume that you will be using Ubuntu 20.04; either natively or via WSL2.

Package requirements can be install via:

sudo apt update
sudo apt install make git build-essential binutils-mips-linux-gnu cpp-mips-linux-gnu python3 python3-pip

Tools requires Python 3.8+. Package requirements can be installed via:

pip3 install --upgrade pip
pip3 install -U splat64[mips]
pip3 install -r requirements.txt

Building

Clone the repository; note the --recursive flag to fetch submodules at the same time:

git clone https://github.com/Gillou68310/DukeNukemZeroHour.git --recursive

Navigate into the freshly cloned repo

cd DukeNukemZeroHour

Place the Duke Nukem Zero Hour US ROM in the root of this repository, name it baserom.us.z64, and then run the first make command to extract the ROM:

make setup

Now build the ROM:

make --jobs

If you did everything correctly, you'll be greeted with the following:

Creating z64: build/us/dukenukemzerohour.z64
OK

Other versions

This repository has support for the French versions of the game too.

To build this version, place your ROM in the root of the repo and rename it to baserom.fr.z64. Pass VERSION=fr to the above make commands.

Building NON_MATCHING Version

Functions can be decompiled to a state where they are functionally equivalent, but are not a byte-perfect match. In order to build/test the non-matching, add NON_MATCHING=1 argument to the make commands.

Docker

A Docker image containing all dependencies can be built and ran as follows:

docker build --no-cache . -t dukenukemzerohour
docker run --rm -ti --mount src=$(pwd),target=/dukenukemzerohour,type=bind dukenukemzerohour

Then continue with the building instructions

When binding windows or mac folder I strongly recommand installing Mutagen Extension for Docker Desktop.

docker --context=desktop-linux-mutagen run --rm -ti --mount src=$(pwd),target=/dukenukemzerohour,type=bind dukenukemzerohour

Debugging

Game can be debugged with gdb through mupen64plus (Windows only for now). In order to have source code information the game should be compiled with modern gcc by adding MODERN=1 to the make command.

Run the gdb server in cmd:

tools\debugger\win32\gdbserver.bat

Then run the gdb client in cmd:

tools\debugger\win32\gdbclient.bat

It's also possible to debug within vscode with the Native Debug extension.

Run the gdb server in cmd:

tools\debugger\win32\gdbserver.bat

Then run the "GDB Client(Win32)" configuration in vscode.

Tools

  • asm-differ; rapidly diff between source/target assembly
  • decomp-permuter; tweaks code, rebuilds, scores; helpful for weird regalloc issues
  • mips2c; assembly to C code translator
  • splat; successor to n64split