Refresh 13

This commit is contained in:
n64
2020-12-03 14:26:38 -05:00
parent 8b872a71e8
commit 6d87c424b8
552 changed files with 32958 additions and 18073 deletions

View File

@@ -1,21 +1,22 @@
# Super Mario 64
- This repo contains a full decompilation of Super Mario 64 (J), (U), and (E) with minor exceptions in the audio subsystem.
- This repo contains a full decompilation of Super Mario 64 (J), (U), and (E).
- Naming and documentation of the source code and data structures are in progress.
- Efforts to decompile the Shindou ROM steadily advance toward a matching build.
- Efforts to decompile the Shindou ROM steadily advance.
It builds the following ROMs:
* sm64.jp.z64 `sha1: 8a20a5c83d6ceb0f0506cfc9fa20d8f438cafe51`
* sm64.us.z64 `sha1: 9bef1128717f958171a4afac3ed78ee2bb4e86ce`
* sm64.eu.z64 `sha1: 4ac5721683d0e0b6bbb561b58a71740845dceea9`
* sm64.sh.z64 `sha1: 3f319ae697533a255a1003d09202379d78d5a2e0`
This repo does not include all assets necessary for compiling the ROMs.
A prior copy of the game is required to extract the assets.
## Quick Start (for Ubuntu)
1. Install prerequisites: `sudo apt install -y build-essential git binutils-mips-linux-gnu python3 libaudiofile-dev`
1. Install prerequisites: `sudo apt install -y build-essential git binutils-mips-linux-gnu python3`
2. Clone the repo from within Linux: `git clone https://github.com/n64decomp/sm64.git`
3. Place a Super Mario 64 ROM called `baserom.<VERSION>.z64` into the project folder for asset extraction, where `VERSION` can be `us`, `jp`, or `eu`.
4. Run `make` to build. Qualify the version through `make VERSION=<VERSION>`. Add `-j4` to improve build speed (hardware dependent).
@@ -44,33 +45,25 @@ There are 3 steps to set up a working build.
The build system has the following package requirements:
* binutils-mips
* capstone
* pkgconf
* python3 >= 3.6
* libaudiofile
* qemu-irix
Dependency installation instructions for common Linux distros are provided below:
##### Debian / Ubuntu
To install build dependencies:
```
sudo apt install -y build-essential git binutils-mips-linux-gnu python3 libaudiofile-dev
```
Download latest package from [qemu-irix Releases.](https://github.com/n64decomp/qemu-irix/releases)
Install this package with:
```
sudo dpkg -i qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb
sudo apt install -y binutils-mips-linux-gnu build-essential git libcapstone-dev pkgconf python3
```
##### Arch Linux
To install build dependencies:
```
sudo pacman -S base-devel python audiofile
sudo pacman -S base-devel capstone python
```
Install the following AUR packages:
* [mips64-elf-binutils](https://aur.archlinux.org/packages/mips64-elf-binutils) (AUR)
* [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git) (AUR)
##### Other Linux distributions
@@ -106,23 +99,47 @@ The full list of configurable variables are listed below, with the default being
* ``VERSION``: ``us``, ``jp``, ``eu``, ``sh`` (WIP)
* ``GRUCODE``: ``f3d_old``, ``f3d_new``, ``f3dex``, ``f3dex2``, ``f3dzex``
* ``COMPARE``: ``1`` (compare ROM hash), ``0`` (do not compare ROM hash)
* ``NON_MATCHING``: Use functionally equivalent C implementations for non-matchings. Also will avoid instances of undefined behavior.
* ``NON_MATCHING``: Use functionally equivalent C implementations for non-matchings (Currently there aren't any non-matchings, but this will apply to Shindou and iQue). Also will avoid instances of undefined behavior.
* ``CROSS``: Cross-compiler tool prefix (Example: ``mips64-elf-``).
* ``QEMU_IRIX``: Path to a ``qemu-irix`` binary.
### macOS
Installing Docker is the recommended avenue for macOS users. This project does not support macOS natively due to lack of macOS host support.
With macOS, you may either use Homebrew or [Docker](#docker-installation).
#### Homebrew
#### Step 1: Install dependencies
Install [Homebrew](https://brew.sh) and the following dependencies:
```
brew update
brew install capstone coreutils gcc make pkg-config tehzz/n64-dev/mips64-elf-binutils
```
#### Step 2: Copy baserom(s) for asset extraction
For each version (jp/us/eu) for which you want to build a ROM, put an existing ROM at
`./baserom.<VERSION>.z64` for asset extraction.
##### Step 3: Build the ROM
Use Homebrew's GNU make because the version included with macOS is too old.
```
gmake VERSION=jp -j4 # build (J) version instead with 4 jobs
```
### Docker Installation
#### Create Docker image
Create the docker image with `docker build -t sm64`.
After installing and starting Docker, create the docker image. This only needs to be done once.
```
docker build -t sm64 .
```
#### Build
To build, mount the local filesystem into the Docker container and build the ROM with `docker run`.
To build, mount the local filesystem into the Docker container and build the ROM with `docker run sm64 make`.
##### macOS example for (U):
```
@@ -132,7 +149,7 @@ docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VE
##### Linux example for (U):
For a Linux host, Docker needs to be instructed which user should own the output files:
```
docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 --user $UID:$UID sm64 make VERSION=us -j4
docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 --user $UID:$GID sm64 make VERSION=us -j4
```
Resulting artifacts can be found in the `build` directory.