fgsfdsfgs / perfect_dark

work in progress port of n64decomp/perfect_dark to modern platforms
MIT License
1.13k stars 70 forks source link

Perfect Dark port

This repository contains a work-in-progress port of the Perfect Dark decompilation to modern platforms.

To run the port, you must already have a Perfect Dark ROM, specifically one of the following:

Status

The game is in a mostly functional state, with both singleplayer and split-screen multiplayer modes fully working.
There are minor graphics- and gameplay-related issues, and possibly occasional crashes.

The following extra features are implemented:

Currently only 32-bit platforms are supported, namely x86 Windows and Linux.
Note that 32-bit binaries will still work on 64-bit versions of those platforms, though you might have to install some additional libraries.

Download

Latest automatic builds for supported platforms:

If you are looking for netplay builds (the port-net branch), see this link.

Running

You must already have a Perfect Dark ROM to run the game, as specified above.

  1. Create a directory named data next to pd.exe if it's not there.
  2. Put your Perfect Dark NTSC ROM named pd.ntsc-final.z64 into it.
  3. Run pd.exe.

If you want to use a PAL or JPN ROM instead, put them into the data directory and run the appropriate executable:

Additional information can be found in the wiki.

A GPU supporting OpenGL 3.0 or above is required to run the port.

Controls

1964GEPD-style and Xbox-style bindings are implemented.

N64 pad buttons X and Y (or X_BUTTON, Y_BUTTON in the code) refer to the reserved buttons 0x40 and 0x80, which are also leveraged by 1964GEPD.

Support for one controller, two-stick configurations are enabled for 1.2.

Note that the mouse only controls player 1.

Controls can be rebound in pd.ini. Default control scheme is as follows:

Action Keyboard and mouse Xbox pad N64 pad
Fire / Accept LMB/Space RT Z Trigger
Aim mode RMB/Z LT R Trigger
Use / Cancel E N/A B
Use / Accept N/A A A
Crouch cycle N/A L3 0x80000000 (Extra)
Half-Crouch Shift N/A 0x40000000 (Extra)
Full-Crouch Control N/A 0x20000000 (Extra)
Reload R X X (0x40)
Previous weapon Mousewheel forward B D-Left
Next weapon Mousewheel back Y Y (0x80)
Radial menu Q LB D-Down
Alt fire mode F RB L Trigger
Alt-fire oneshot F + LMB or E + LMB A + RT or RB + RT A + Z or L + Z
Quick-detonate E + Q or E + R A + B or A + X A + D-Leftor A + X

Building

Windows

  1. Install MSYS2.
  2. Open the MINGW32 prompt. (NOTE: not the MSYS prompt or the MINGW64 prompt)
  3. Install dependencies:
    pacman -S mingw-w64-i686-toolchain mingw-w64-i686-SDL2 mingw-w64-i686-zlib make git
  4. Get the source code:
    git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_dark
  5. Run make -f Makefile.port.
    • Add ROMID=pal-final or ROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.
  6. The resulting executable will be at build/ntsc-final-port/pd.exe.
  7. If you don't know where you downloaded the source to, you can run explorer . to open the current directory.

Linux

  1. Ensure you have gcc, g++ (version 10.0+) and 32-bit versions of SDL2 (version 2.0.12+), libGL and ZLib installed on your system.
    • On a 64-bit system you also need to have gcc-multilib and g++-multilib (or your distro's analogues) installed.
  2. Get the source code:
    git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_dark
  3. Run the following command:
    • On a 64-bit system: make -f Makefile.port TARGET_PLATFORM=i686-linux
    • On a 32-bit system: make -f Makefile.port
    • Add ROMID=pal-final or ROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.
  4. The resulting executable will be at build/ntsc-final-port/pd.exe.

Currently only i686-linux and i686-windows are supported, using gcc -m32 and i686-w64-mingw32-gcc as compilers, respectively.
Alternate compilers can be specified by passing TOOLCHAIN=i686-whatever- as a command line argument.

You can build an executable with PAL or JPN ROM support by adding ROMID=pal-final or ROMID=jpn-final to the make command.
You will need to provide a jpn-final or pal-final ROM to run those, named pd.jpn-final.z64 or pd.pal-final.z64.

It might be possible to build a 32-bit ARM executable, but this has not been tested.

Credits