A decompilation of Perfect Dark. (MIRROR of https://gitlab.com/ryandwyer/perfect-dark)
Go to file
2019-10-02 18:02:48 +10:00
include Replace assembly implementation with C implementation 2019-09-07 16:12:32 +10:00
ld Add missing boot.ld 2019-10-02 18:02:48 +10:00
src Add boot.c 2019-10-02 08:23:06 +10:00
tools Reorganise repository and rename globals to setup 2019-09-29 11:57:51 +10:00
.gitignore Initial commit 2019-09-06 08:09:40 +10:00
macros.inc Start decompiling rarezip binary 2019-09-18 22:27:03 +10:00
Makefile Add boot.c 2019-10-02 08:23:06 +10:00
README.md Reorganise repository and rename globals to setup 2019-09-29 11:57:51 +10:00
stagetable.txt Initial commit 2019-09-06 08:09:40 +10:00

Perfect Dark Decompilation (WIP)

This repository contains a work-in-progress decompilation of Perfect Dark for the Nintendo 64.

Roadmap

Section Progress
0x40 rspboot Won't disassemble as source is likely ASM
0x1000 boot Not started
0x3050 library Not started
0x39850 setup About 50% identified
0x4e850 rarezip 2/8 functions done
0x5032e game Not started
Lang files Done
Setup files Done
Prop files Not started
Character files Not started
Gun files Not started
BG files Not started
Pad files Not started
Tile files Not started

If you want to browse the stage setup files, use this table to find the filename:

Stage File
Defection setupame.c
Investigation setupear.c
Extraction setupark.c
Villa setupeld.c
Chicago setuppete.c
G5 Building setupdepo.c
Infiltration setuplue.c
Rescue setuplip.c
Escape setuptra.c
Air Base setupcave.c
Air Force One setuprit.c
Crash Site setupazt.c
Pelagic II setupdam.c
Deep Sea setuppam.c
Defense setupimp.c
Attack Ship setuplee.c
Skedar Ruins setupsho.c
MBR setupwax.c
Maian SOS setupsev.c
WAR! setupstat.c
The Duel setupate.c
CI Training setupdish.c
Common Functions setup.c

There is also a stagetable.txt in the repository root which includes multiplayer stages.

Compiling

Install the following:

  • make
  • mips build tools (Debian/Ubuntu: binutils-mips-linux-gnu, Arch: mips64-elf-binutils from AUR)
  • Python 3

Then:

  1. Save your existing ROM file into the root of the repository with the name pd.ntsc-final.z64. It should not be byteswapped (the first four bytes should be 0x80371240).
  2. Run make extract. This will create an extracted/ntsc-final containing assets from your ROM.
  3. Make edits to the C files in the src directory if desired.
  4. Run make rom. This will create a ROM file at build/ntsc-final/pd.z64.

How do I know the built files are matching?

Run make followed by make test. If make test produces no output then everything is matching.