2021-01-15 17:28:05 +01:00
# Setup
This repository supports:
- [Linux ](#unix )
2021-01-15 17:49:09 +01:00
- [macOS ](#unix )
2021-01-15 17:28:05 +01:00
- [Windows Subsystem for Linux 2 ](#wsl-2 )
- [Docker ](#docker ) (any host OS)
2023-04-22 15:47:03 +02:00
- [Nix ](#nix )
2021-01-15 17:28:05 +01:00
If you encounter any issues setting up the repo, please feel free to [reach out to us on Discord ](https://discord.gg/urUm3VG ).
2021-07-27 13:17:51 +02:00
## Common
2021-01-15 17:28:05 +01:00
Clone the repository:
```sh
git clone https://github.com/pmret/papermario
cd papermario
```
2021-07-27 13:17:51 +02:00
## Unix
2021-01-15 17:28:05 +01:00
Install build dependencies:
```sh
2023-06-26 12:27:37 +02:00
./install_deps.sh
2021-01-15 17:28:05 +01:00
```
2022-08-28 06:12:47 +02:00
> **NOTE:** On Mac, if you get an error that looks like
2023-04-29 15:28:06 +02:00
>
2022-08-28 06:12:47 +02:00
>```sh
>Error: Cannot install md5sha1sum because conflicting formulae are installed.
> coreutils: because both install `md5sum` and `sha1sum` binaries
>
>Please `brew unlink coreutils` before continuing.
>```
>
2023-06-26 12:27:37 +02:00
>it's fine to just open `install_deps.sh` in a text editor, delete the `md5sha1sum` from the `brew install` line, and rerun it (put it back after so you don't accidentally commit it!)
2021-01-15 17:28:05 +01:00
2023-06-26 12:27:37 +02:00
Continue onto [building ](#building )
2021-01-15 17:28:05 +01:00
## WSL 2
1. Install or upgrade to **WSL 2** following [these instructions ](https://aka.ms/wsl2-install ) (Ubuntu is recommended)
2. Open a WSL terminal
3. Run the following command: `sudo apt update && sudo apt upgrade && cd ~`
2023-06-26 12:27:37 +02:00
4. Continue with [building ](#building )
2021-01-15 17:28:05 +01:00
2021-01-15 17:50:06 +01:00
If you have Visual Studio Code, you can type `code .` to open the repo within it.
2021-01-15 17:28:05 +01:00
`Ctrl + J` opens up a Linux terminal within VS Code.
## Docker
A Docker image containing all dependencies can be built and ran as follows:
```sh
docker build . -t pm
docker run --rm -ti -v $(pwd):/papermario pm
```
2023-06-26 12:27:37 +02:00
Then continue with [building ](#building )
2023-04-22 15:47:03 +02:00
## Nix
Install [Nix ](https://nixos.org/download.html ) and run `nix-shell` . You will need to set the `NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM` environment variable to `1` (required for cross compiling).
```sh
export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
nix-shell
```
2023-06-26 12:27:37 +02:00
Like the instructions for Docker, continue with [building ](#building )
# Building
Copy baseroms into the following places (at least 1 is required):
* `ver/us/baserom.z64` (sha1: `3837f44cda784b466c9a2d99df70d77c322b97a0` )
* `ver/jp/baserom.z64` (sha1: `b9cca3ff260b9ff427d981626b82f96de73586d3` )
* `ver/pal/baserom.z64` (sha1: `2111d39265a317414d359e35a7d971c4dfa5f9e1` )
* `ver/ique/baserom.z64` (sha1: `5c724685085eba796537573dd6f84aaddedc8582` )
(If you're using WSL, you can enter the Linux filesystem by opening `\\wsl$` in File Explorer; e.g. `\\wsl$\Ubuntu\home\<your username>\papermario` .)
Configure the build and extract assets from the base ROM:
```sh
./configure
```
Compile the game:
```
ninja
```
If you get `papermario.z64: OK` at the end, the build succeeded and the built rom matches the input rom!