readme: add osx build instructions

This commit is contained in:
fgsfds authored and GitHub committed 2024-11-23 21:07:21 +01:00
1 parent 5c5c33c116
commit 37e69cb83d
1 file changed
+33 -5
+33 -5
View File
@@ -35,7 +35,7 @@ There are minor graphics- and gameplay-related issues, and possibly occasional c
* in practice the game will have issues running faster than ~165 FPS, so use VSync or `Video.FramerateLimit` to cap it.
* emulate the Transfer Pak functionality the game has on the Nintendo 64 to unlock some cheats automatically.
The following platforms are officially supported and tested:
**The following platforms are officially supported and tested:**
* Windows 7+: i686, x86_64
* Linux: i686, x86_64
* MacOS: x86_64 (OS 10.9+), arm64 (OS 11.0+)
@@ -136,6 +136,32 @@ Controls can be rebound in `pd.ini`. Default control scheme is as follows:
4. Run `cmake --build build -j4`.
5. The resulting executable will be at `build/pd.<arch>` (for example `build/pd.x86_64`).
### MacOS
1. Set up Homebrew.
2. Install dependencies:
* Execute command: `brew install cmake gcc python3 zlib git`
3. Install SDL2:
* Execute commands:
```
wget 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
```
* This installs SDL2 system-wide and this is how the automatic builds are done. The game will also look for it in the executable path, so you could
download it locally instead.
4. Get the source code:
`git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_dark`
5. Configure:
* Execute command: `cmake -G"Unix Makefiles" -Bbuild -DCMAKE_OSX_ARCHITECTURES=x86_64 .`
* Replace `x86_64` with `arm64` if building for an ARM64 Mac.
* Add ` -DROMID=pal-final` or ` -DROMID=jpn-final` at the end of the command if you want to build a PAL or JPN executable respectively.
6. Build:
* Execute command: `cmake --build build --target pd -j4 --clean-first`
7. The resulting executable will be at `build/pd.<arch>` (for example `build/pd.x86_64`).
* You might need to execute `chmod +x build/pd.x86-64` before you can run it.
### Nintendo Switch
1. Set up the [devkitA64 environment](https://devkitpro.org/wiki/Getting_Started).
@@ -151,15 +177,17 @@ Controls can be rebound in `pd.ini`. Default control scheme is as follows:
dkp-pacman -S devkitA64 libnx switch-zlib switch-sdl2 switch-cmake dkp-toolchain-vars
```
* If in MSYS2 or `dkp-pacman` doesn't work, replace it with just `pacman`.
4. Ensure devkitA64 environment variables are set:
4. Get the source code:
`git clone --recursive https://github.com/fgsfdsfgs/perfect_dark.git && cd perfect_dark`
5. Ensure devkitA64 environment variables are set:
* Execute command: `source /opt/devkitpro/switchvars.sh`
* If your `$DEVKITPRO` path is different, substitute that instead or set the variables manually.
5. Configure:
6. Configure:
* Execute command: `aarch64-none-elf-cmake -G"Unix Makefiles" -Bbuild .`
* Add ` -DROMID=pal-final` or ` -DROMID=jpn-final` at the end of the command if you want to build a PAL or JPN executable respectively.
6. Build:
7. Build:
* Execute command: `make -C build -j4`
7. The resulting executable will be at `build/pd.arm64.nro`.
8. The resulting executable will be at `build/pd.arm64.nro`.
### Notes