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:
ntsc-final/US V1.1/US Rev 1 (md5 e03b088b6ac9e0080440efed07c1e40f).NTSC version 8.7 final on the boot screen.ntsc-1.0/US V1.0 (md5 7f4171b0c8d17815be37913f535e4e93).NTSC version 8.7 final on the boot screen as well.jpn-final (md5 538d2b75945eae069b29c46193e74790).JPN version 8.9 final on the boot screen.pal-final (md5 d9b5cd305d228424891ce38e71bc9213).PAL 8.7 final on the boot screen.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:
Uncap Tickrate in Extended Video Options to activate;Video.FramerateLimit to cap it.The following platforms are officially supported and tested:
Latest automatic builds for supported platforms:
If you are looking for netplay builds (the port-net branch), see this link.
You must already have a Perfect Dark ROM to run the game, as specified above.
This assumes that you're using an x86_64 build. If you aren't, replace x86_64 below with your arch (e.g. i686).
data next to pd.x86_64 if it's not there.pd.ntsc-final.z64 into it.pd.x86_64 executable.If you want to use a PAL or JPN ROM instead, put them into the data directory and run the appropriate executable:
pd.pal-final.z64, executable name pd.pal.x86_64.pd.jpn-final.z64, executable name pd.jpn.x86_64.Optionally, you can also put your Perfect Dark for GameBoy Color ROM named pd.gbc in the data directory if you want to emulate having the Nintendo 64's Transfer Pak and unlock some cheats automatically.
Optionally, you can move the data folder to ~/.local/share/perfectdark on Linux or ~/Library/Application Support/perfectdark on MacOS.
Additional information can be found in the wiki.
A GPU supporting OpenGL 3.0/ES3.0 or above is required to run the port.
The Nintendo Switch build ZIP comes with all 3 regions in different folders: perfectdark, perfectdark_pal and perfectdark_jpn.
Take the folder for the region you want and put it into the /switch folder on your SD card, then put your ROM into the data folder inside of the folder you extracted as described above.
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 | LS Click | 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 |
MINGW64 prompt if building for x86_64, or the MINGW32 prompt if building for i686. (NOTE: do not use the MSYS prompt)pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-SDL2 mingw-w64-x86_64-zlib mingw-w64-x86_64-cmake mingw-w64-x86_64-python3 mingw-w64-i686-toolchain mingw-w64-i686-SDL2 mingw-w64-i686-zlib mingw-w64-i686-cmake mingw-w64-i686-python3 make gitgit clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darkcmake -G"Unix Makefiles" -Bbuild ..
-DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.\cmake --build build -j4 -- -O.build/pd.x86_64.exe (or at build/pd.i686.exe if building for i686).explorer . to open the current directory.gcc-multilib and g++-multilib for x86_64 -> i686 crosscompilation.git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darkcmake -G"Unix Makefiles" -Bbuild . -DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively. -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 at the end of the command if you want to crosscompile from x86_64 to x86.cmake --build build -j4.build/pd.<arch> (for example build/pd.x86_64).brew install cmake gcc python3 zlib gitwget http://libsdl.org/release/SDL2-2.30.9.dmg -O SDL2.dmg
hdiutil mount SDL2.dmg
sudo cp -vr /Volumes/SDL2/SDL2.framework /Library/Frameworks
hdiutil detach /Volumes/SDL2
git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darkcmake -G"Unix Makefiles" -Bbuild -DCMAKE_OSX_ARCHITECTURES=x86_64 .x86_64 with arm64 if building for an ARM64 Mac. -DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.cmake --build build --target pd -j4 --clean-firstbuild/pd.<arch> (for example build/pd.x86_64).
chmod +x build/pd.x86-64 before you can run it.pacman -Syuu && pacman -S git make cmake python3dkp-pacman -Syuu
dkp-pacman -S devkitA64 libnx switch-zlib switch-sdl2 switch-cmake dkp-toolchain-vars
dkp-pacman doesn't work, replace it with just pacman.git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darksource /opt/devkitpro/switchvars.sh$DEVKITPRO path is different, substitute that instead or set the variables manually.aarch64-none-elf-cmake -G"Unix Makefiles" -Bbuild . -DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.make -C build -j4build/pd.arm64.nro.Alternate compilers or toolchains can be specified by passing -DCMAKE_TOOLCHAIN_FILE=whatever as normal. The port does not build with Visual Studio.
You will need to provide a jpn-final or pal-final ROM to run executables built for those regions, named pd.jpn-final.z64 or pd.pal-final.z64.
It might be possible to build and run the game on platforms that are not specified in the supported platforms list (e.g. Linux on armv7), but this has not been tested.
pd-extract;(top 30 of 33)
C
86.9%
Linker Script
4.2%
Python
4.0%
C++
2.5%
Assembly
2.3%
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:
ntsc-final/US V1.1/US Rev 1 (md5 e03b088b6ac9e0080440efed07c1e40f).NTSC version 8.7 final on the boot screen.ntsc-1.0/US V1.0 (md5 7f4171b0c8d17815be37913f535e4e93).NTSC version 8.7 final on the boot screen as well.jpn-final (md5 538d2b75945eae069b29c46193e74790).JPN version 8.9 final on the boot screen.pal-final (md5 d9b5cd305d228424891ce38e71bc9213).PAL 8.7 final on the boot screen.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:
Uncap Tickrate in Extended Video Options to activate;Video.FramerateLimit to cap it.The following platforms are officially supported and tested:
Latest automatic builds for supported platforms:
If you are looking for netplay builds (the port-net branch), see this link.
You must already have a Perfect Dark ROM to run the game, as specified above.
This assumes that you're using an x86_64 build. If you aren't, replace x86_64 below with your arch (e.g. i686).
data next to pd.x86_64 if it's not there.pd.ntsc-final.z64 into it.pd.x86_64 executable.If you want to use a PAL or JPN ROM instead, put them into the data directory and run the appropriate executable:
pd.pal-final.z64, executable name pd.pal.x86_64.pd.jpn-final.z64, executable name pd.jpn.x86_64.Optionally, you can also put your Perfect Dark for GameBoy Color ROM named pd.gbc in the data directory if you want to emulate having the Nintendo 64's Transfer Pak and unlock some cheats automatically.
Optionally, you can move the data folder to ~/.local/share/perfectdark on Linux or ~/Library/Application Support/perfectdark on MacOS.
Additional information can be found in the wiki.
A GPU supporting OpenGL 3.0/ES3.0 or above is required to run the port.
The Nintendo Switch build ZIP comes with all 3 regions in different folders: perfectdark, perfectdark_pal and perfectdark_jpn.
Take the folder for the region you want and put it into the /switch folder on your SD card, then put your ROM into the data folder inside of the folder you extracted as described above.
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 | LS Click | 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 |
MINGW64 prompt if building for x86_64, or the MINGW32 prompt if building for i686. (NOTE: do not use the MSYS prompt)pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-SDL2 mingw-w64-x86_64-zlib mingw-w64-x86_64-cmake mingw-w64-x86_64-python3 mingw-w64-i686-toolchain mingw-w64-i686-SDL2 mingw-w64-i686-zlib mingw-w64-i686-cmake mingw-w64-i686-python3 make gitgit clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darkcmake -G"Unix Makefiles" -Bbuild ..
-DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.\cmake --build build -j4 -- -O.build/pd.x86_64.exe (or at build/pd.i686.exe if building for i686).explorer . to open the current directory.gcc-multilib and g++-multilib for x86_64 -> i686 crosscompilation.git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darkcmake -G"Unix Makefiles" -Bbuild . -DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively. -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 at the end of the command if you want to crosscompile from x86_64 to x86.cmake --build build -j4.build/pd.<arch> (for example build/pd.x86_64).brew install cmake gcc python3 zlib gitwget http://libsdl.org/release/SDL2-2.30.9.dmg -O SDL2.dmg
hdiutil mount SDL2.dmg
sudo cp -vr /Volumes/SDL2/SDL2.framework /Library/Frameworks
hdiutil detach /Volumes/SDL2
git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darkcmake -G"Unix Makefiles" -Bbuild -DCMAKE_OSX_ARCHITECTURES=x86_64 .x86_64 with arm64 if building for an ARM64 Mac. -DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.cmake --build build --target pd -j4 --clean-firstbuild/pd.<arch> (for example build/pd.x86_64).
chmod +x build/pd.x86-64 before you can run it.pacman -Syuu && pacman -S git make cmake python3dkp-pacman -Syuu
dkp-pacman -S devkitA64 libnx switch-zlib switch-sdl2 switch-cmake dkp-toolchain-vars
dkp-pacman doesn't work, replace it with just pacman.git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_darksource /opt/devkitpro/switchvars.sh$DEVKITPRO path is different, substitute that instead or set the variables manually.aarch64-none-elf-cmake -G"Unix Makefiles" -Bbuild . -DROMID=pal-final or -DROMID=jpn-final at the end of the command if you want to build a PAL or JPN executable respectively.make -C build -j4build/pd.arm64.nro.Alternate compilers or toolchains can be specified by passing -DCMAKE_TOOLCHAIN_FILE=whatever as normal. The port does not build with Visual Studio.
You will need to provide a jpn-final or pal-final ROM to run executables built for those regions, named pd.jpn-final.z64 or pd.pal-final.z64.
It might be possible to build and run the game on platforms that are not specified in the supported platforms list (e.g. Linux on armv7), but this has not been tested.
pd-extract;(top 30 of 33)
C
86.9%
Linker Script
4.2%
Python
4.0%
C++
2.5%
Assembly
2.3%