perfect_dark/README.md
2020-03-01 00:39:18 +10:00

4.4 KiB

Perfect Dark Decompilation (WIP)

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

Roadmap

Actual decompilation:

Segment Progress
0x1000 boot 206/2,068 words decompiled (9.96%)
0x3050 lib 8,250/89,060 words decompiled (9.26%)
0x4e850 inflate 150/1,276 words decompiled (11.76%)
0x4fc40 game 60,166/452,216 words decompiled (13.30%)
Total 68,772/544,620 words decompiled (12.63%)

Assets:

Asset Type Progress
Lang files Done
Setup files Done
Prop files To do
Character files To do
Gun files To do
BG files To do
Pad files To do
Tile files Done
MIDI files Extracted as binaries
Animation files To do
Textures To do

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

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

Installation Requirements

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

Extracting the base ROM

Before you do anything you need an existing ROM to extract assets from.

  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 directory containing assets from your ROM.

Compiling

The project can do the following:

  • Build individual ucode binaries (boot, lib, setup, inflate and game) which match the ones extracted from the base ROM.

  • Build a functioning ROM by splicing the C source and assets into an existing ROM. The built ROM is not byte perfect yet, but is is functionally equivalent.

  • Run make to build the assets that will be included in the ROM. These files will be written to build/ntsc-final and are matching what's in the extracted/ntsc-final folder.

  • Run make rom to build the ROM. The ROM will be written to 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.