2024-01-21 22:39:28 +00:00
[![Discord Invitation ](https://discordapp.com/api/guilds/1190102597521133700/widget.png?style=banner2 'Starfox 64' )](https://discord.gg/tuwdmuTTqc)
2024-01-08 23:57:46 +00:00
2023-10-07 15:39:22 +00:00
# Starfox 64 (US) REV 1.1
2023-12-22 23:56:06 +00:00
This is a WIP **matching decompilation** of ** *Starfox 64***. The purpose of the project is to recreate a source code base for the game from scratch, using information found inside the game along with static and/or dynamic analysis.
2023-10-07 15:39:22 +00:00
It currently builds the following ROM:
2024-05-12 00:11:29 +00:00
* starfox64.us.rev1.z64 `MD5: 741a94eee093c4c8684e66b89f8685e8`
2023-10-07 15:39:22 +00:00
**This repo does not include any assets or assembly code necessary for compiling the ROM. A prior copy of the game is required to extract the required assets.**
## Installation
2024-01-01 20:29:08 +00:00
#### 1. Install build dependencies
2023-10-07 15:39:22 +00:00
### Windows
For Windows 10, install WSL and a distribution by following this
[Windows Subsystem for Linux Installation Guide ](https://docs.microsoft.com/en-us/windows/wsl/install-win10 ).
2023-10-08 14:25:33 +00:00
We recommend using Debian or Ubuntu 22.04 Linux distributions.
2023-10-07 15:39:22 +00:00
### Linux (Native or under WSL / VM)
The build process has the following package requirements:
* make
* git
* build-essential
* binutils-mips-linux-gnu
* python3
* pip3
* libpng-dev
Under Debian / Ubuntu (which we recommend using), you can install them with the following commands:
```bash
sudo apt update
2024-02-28 18:55:00 +00:00
sudo apt install make cmake git build-essential binutils-mips-linux-gnu python3 python3-pip clang-format-14 clang-tidy
2023-12-26 20:55:57 +00:00
```
### MacOS
Install [Homebrew ](https://brew.sh ) and the following dependencies:
```
brew update
brew install coreutils make pkg-config tehzz/n64-dev/mips64-elf-binutils
2023-10-07 15:39:22 +00:00
```
#### 2. Clone the repository
Create your own fork of the repository at `https://github.com/sonicdcer/sf64` . Then clone your fork where you wish to have the project, with the command:
```bash
git clone https://github.com/< YOUR_USERNAME > /sf64.git
```
This will copy the GitHub repository contents into a new folder in the current directory called `sf64` . Change into this directory before doing anything else:
```bash
cd sf64
```
#### 3. Install python dependencies
2023-10-12 17:01:43 +00:00
The build process has a few python packages required that are located in `/tools/requirements-python.txt` .
2023-10-07 15:39:22 +00:00
To install them simply run in a terminal:
```bash
2024-05-06 02:10:44 +00:00
python3 -m pip install -r ./tools/requirements-python.txt
2023-10-07 15:39:22 +00:00
```
2024-05-06 02:10:44 +00:00
* Depending on your python version, you might need to add --break-system-packages, or use venv.
2023-10-07 15:39:22 +00:00
2023-12-06 12:20:22 +00:00
#### 4. Update submodules & build toolchain
2023-10-14 12:33:21 +00:00
```bash
git submodule update --init --recursive
2023-12-10 19:27:26 +00:00
make toolchain
2023-10-14 12:33:21 +00:00
```
#### 5. Prepare a base ROM
2023-10-07 15:39:22 +00:00
2024-05-12 00:11:29 +00:00
Copy your ROM to the root of this new project directory, and rename the file of the baserom to reflect the version of ROM you are using. ex: `baserom.us.rev1.z64`
2024-05-06 02:12:56 +00:00
* Make sure the ROM is the US version, revision 1.1 (REV A).
2023-10-07 15:39:22 +00:00
2023-10-14 12:33:21 +00:00
#### 6. Make and Build the ROM
2023-10-07 15:39:22 +00:00
To start the extraction/build process, run the following command:
```bash
make init
```
2024-01-05 05:07:59 +00:00
This will create the build folders, a new folder with the assembly as well as containing the disassembly of nearly all the files containing code.
2023-10-07 15:39:22 +00:00
2024-05-12 00:11:29 +00:00
this make target will also build the ROM. If all goes well, a new ROM called "starfox64.us.rev1.z64" should be built and the following text should be printed:
2023-10-07 15:39:22 +00:00
```bash
2024-05-12 00:11:29 +00:00
741a94eee093c4c8684e66b89f8685e8 build/starfox64.us.rev1.z64
./build/starfox64.us.rev1.z64: OK
2023-10-07 15:39:22 +00:00
```
If you instead see the following:
```bash
2024-05-12 00:11:29 +00:00
./build/starfox64.us.rev1.z64: FAILED
2023-10-07 15:39:22 +00:00
md5sum: WARNING: 1 computed checksum did NOT match
```
This means that something is wrong with the ROM's contents. Either the base files are incorrect due to a bad ROM, or some of the code is not matching.
2023-10-15 22:18:54 +00:00
2023-10-15 22:19:33 +00:00
From now on you should be able to build the rom by running `make` .