Decompilation of Starfox 64
Go to file
Alejandro Asenjo Nitti 0251769d16
General docs (#269)
* fox_display.c DOCS

* PRINTF

* actor->destroy boolean

* corneria docs

* Boss->unk_04C to Boss->animFrame

* aCoGrangaWalkingAnim

* more corneria docs

* Spawner

* Spawner code refined

* Spawner description

* Actor Spawn guard

* Molar Rock (name by @inspectredc)

* more docs

* actor docs

* initial disassembly config for lodgenet

* correct vram addresses for lodgenet

* Actor Docs

* More actor docs

* more actor docs

* correction

* correction

* more actor docs

* Preliminary work for Effect documentation

* Change Init for Setup

* fox_play cleanup and defake

* fox_zo function names

* fox_so function renaming

* more object docs

* venom 1 actors

* actor docs

* some fox_bo docs

* some fox_fo corrections

* fox_ma obj->this

* fox_ma renamings

* fox_ma docs

* fox_ti Actors

* revert permuter settings to ido

* some renames on fox_andross.c

* fox_sy actors

* object names

* corrections

* some effect comments

* fix AudioTable struct and data to avoid UB

* uintptr_t in audio

* audio load changes

* event id enum usage in fox_sy

* clear padding in sPlaylists

* HUD_FoBase_ExplodeCs

* HUD
2024-08-12 11:58:54 -03:00
.github/workflows Isolate rev1 building tree (#239) 2024-05-11 21:11:29 -03:00
.vscode General docs (#269) 2024-08-12 11:58:54 -03:00
assets/yaml General docs (#269) 2024-08-12 11:58:54 -03:00
include General docs (#269) 2024-08-12 11:58:54 -03:00
linker_scripts General docs (#269) 2024-08-12 11:58:54 -03:00
src General docs (#269) 2024-08-12 11:58:54 -03:00
srceu Implement common data in EU and JP and clean up US data (#258) 2024-05-23 20:40:42 -03:00
srcjp Implement common data in EU and JP and clean up US data (#258) 2024-05-23 20:40:42 -03:00
tools Improve audio docs and partial audio disassembly support (#268) 2024-07-07 14:43:41 -03:00
yamls General docs (#269) 2024-08-12 11:58:54 -03:00
.clang-format format style change: SpaceAfterCStyleCast: true 2023-10-18 10:50:51 -03:00
.clang-tidy fox_rcp (#20) 2023-11-13 10:18:43 -06:00
.gitignore Improve audio docs and partial audio disassembly support (#268) 2024-07-07 14:43:41 -03:00
.gitmodules Asset extraction (#133) 2024-02-17 23:19:18 -03:00
config.yml Updated segment offsets to match real jp ones (#250) 2024-05-15 22:26:19 -03:00
diff_settings.py update diff_settings 2024-05-12 18:44:20 -03:00
diff.py sf_61B30 decomped (#25) 2023-11-18 12:44:33 -03:00
first_diff.py Forgot an update to first_diff (#242) 2024-05-12 11:18:36 -05:00
LICENSE.md add license (#86) 2024-01-15 00:16:47 -03:00
Makefile General docs (#269) 2024-08-12 11:58:54 -03:00
mips_to_c.sh fox_effects decompiled (#77) 2024-01-13 10:43:04 -03:00
README.md Isolate rev1 building tree (#239) 2024-05-11 21:11:29 -03:00
segfinder.py Asset names and headers (#131) 2024-02-16 21:58:59 -03:00
starfox64.eu.rev0.uncompressed.md5 support for EU rev 0, updates to tools, other cleanup (#255) 2024-05-18 19:49:49 -03:00
starfox64.jp.rev0.uncompressed.md5 fix jp rev0 build 2024-05-14 10:59:18 -03:00
starfox64.us.rev1.md5 Isolate rev1 building tree (#239) 2024-05-11 21:11:29 -03:00
starfox64.us.rev1.uncompressed.md5 Isolate rev1 building tree (#239) 2024-05-11 21:11:29 -03:00
sym_info.py export configuration for ast_map (#172) 2024-03-21 15:41:46 -03:00

Discord Invitation

Starfox 64 (US) REV 1.1

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.

It currently builds the following ROM:

  • starfox64.us.rev1.z64 MD5: 741a94eee093c4c8684e66b89f8685e8

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

1. Install build dependencies

Windows

For Windows 10, install WSL and a distribution by following this Windows Subsystem for Linux Installation Guide. We recommend using Debian or Ubuntu 22.04 Linux distributions.

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:

sudo apt update
sudo apt install make cmake git build-essential binutils-mips-linux-gnu python3 python3-pip clang-format-14 clang-tidy

MacOS

Install Homebrew and the following dependencies:

brew update
brew install coreutils make pkg-config tehzz/n64-dev/mips64-elf-binutils

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:

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:

cd sf64

3. Install python dependencies

The build process has a few python packages required that are located in /tools/requirements-python.txt.

To install them simply run in a terminal:

python3 -m pip install -r ./tools/requirements-python.txt
  • Depending on your python version, you might need to add --break-system-packages, or use venv.

4. Update submodules & build toolchain

git submodule update --init --recursive
make toolchain

5. Prepare a base ROM

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

  • Make sure the ROM is the US version, revision 1.1 (REV A).

6. Make and Build the ROM

To start the extraction/build process, run the following command:

make init

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.

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:

741a94eee093c4c8684e66b89f8685e8  build/starfox64.us.rev1.z64
./build/starfox64.us.rev1.z64: OK

If you instead see the following:

./build/starfox64.us.rev1.z64: FAILED
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.

From now on you should be able to build the rom by running make.