Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Project516/sm64dx/llms.txt

Use this file to discover all available pages before exploring further.

The patching workflow in sm64dx relies on two thin shell wrappers around the standard patch utility: tools/apply_patch.sh and tools/revert_patch.sh. Each script asks for interactive confirmation before touching any source files, so you have a chance to abort before anything is modified. Run both scripts from the repository root.
Apply patches only to a clean working tree. If you have uncommitted local changes, applying a patch may produce conflicts or leave your tree in an inconsistent state. Run git status first and commit or stash any pending work before proceeding.

Applying a patch

1

Navigate to the repository root

All patch scripts expect to be run from the repository root so that the relative paths inside the .patch files resolve correctly.
cd /path/to/sm64dx
2

Run apply_patch.sh with the target patch

Pass the path to the .patch file as the sole argument.
tools/apply_patch.sh enhancements/crash.patch
The script prompts you to confirm before applying:
Do you wish to apply the patch 'enhancements/crash.patch'? [Y/N]
Enter Y to proceed. The script calls patch -p1 with the patch file, stripping one level of path prefix so that the hunks map correctly onto the repository layout.
3

Build the project

After the patch is applied, rebuild the ROM to incorporate the new code.
make VERSION=us

Reverting a patch

1

Run revert_patch.sh with the same patch file

Pass the exact same .patch file you originally applied.
tools/revert_patch.sh enhancements/crash.patch
The script prompts for confirmation:
Do you wish to revert the patch 'enhancements/crash.patch'? [Y/N]
Enter Y to proceed. Internally the script calls patch -p1 -R, which applies the patch in reverse to undo every hunk.
2

Rebuild

Rebuild after reverting to ensure the binary no longer includes the enhancement.
make VERSION=us
To understand exactly what each script does, read the source directly — they are short and straightforward:
  • tools/apply_patch.sh — confirmation prompt, then patch -p1 < patch_file
  • tools/revert_patch.sh — confirmation prompt, then patch -p1 -R < patch_file

Build docs developers (and LLMs) love