Collection of tools for Super Mario 64 ROM hacking
Clone or download
queueRAM SM64 (E) and Shindou config updates
* Rename object geo layout sections to match MIO0 blocks
* Correct texture offsets that were out of order

Fixes #5
Latest commit 616c4db Aug 22, 2018
Permalink
Failed to load latest commit information.
configs SM64 (E) and Shindou config updates Aug 22, 2018
examples Update examples' README Dec 18, 2015
ext Update stb submodule May 4, 2018
release Bump sm64extend version to 0.3.2 and update README Aug 22, 2018
tests/example1 Add a small test program to exercise many sections. Oct 23, 2017
tools Cleanup sm64text May 23, 2018
.gitignore Add .gitignore for executable and build artifacts Feb 22, 2015
.gitmodules Use stb_image for image reading/writing Feb 9, 2017
CMakeLists.txt Add libsfx.c source to CMake build Jan 19, 2018
LICENSE Add MIT license file Feb 22, 2015
Makefile Added sounds to the disassembly process, not compatible with most roms!! Oct 3, 2017
README.md Update n64split documentation in README Jan 26, 2018
TODO Add TODO Dec 18, 2015
blast.c Blast Corps texture 3 is IA8 Apr 1, 2016
config.h Use macro for F3D vertex data May 3, 2018
f3d.c Fix warnings from mingw build Jan 27, 2018
f3d2obj.c Add support for SM64 iQue in sm64extend Aug 7, 2018
libblast.h Create libblast for decompressing Blast Corps textures Jan 18, 2016
libmio0.c Speedup MIO0 compression May 14, 2018
libmio0.h Remove MIO0 stats and big endian flag Feb 8, 2017
libsfx.c Add read_f32_be() to parse big-endian float Jan 28, 2018
libsfx.h Add read_f32_be() to parse big-endian float Jan 28, 2018
libsm64.c Add support for SM64 iQue in sm64extend Aug 7, 2018
libsm64.h Add support for SM64 iQue in sm64extend Aug 7, 2018
mipsdisasm.c Look for SWC/LWC[123] instructions for pointer matching May 2, 2018
mipsdisasm.h Use custom struct to store instruction information Sep 28, 2017
n64cksum.c Add n64cksum tool to generate N64 header checksum Apr 1, 2015
n64graphics.c Use default number of channels in STB image loading Aug 7, 2018
n64graphics.h Add command line options to n64graphics and cleanup May 3, 2018
n64split.c Decode SM64 geo layout blocks into asm macros Jul 20, 2018
n64split.collision.mtl.h Output collision material file in models directory Dec 18, 2015
n64split.makefile.h Add makefile improvements for running on Windows Dec 18, 2015
sm64compress.c Fix warnings from mingw build Jan 27, 2018
sm64extend.c Bump sm64extend version to 0.3.2 and update README Aug 22, 2018
sm64geo.c Fix warnings from mingw build Jan 27, 2018
sm64walk.c Support Shindou in sm64walk and add -r REGION flag Nov 11, 2016
strutils.c Add string buffer for accumulating makefile data Sep 14, 2017
strutils.h Add string buffer for accumulating makefile data Sep 14, 2017
utils.c Add read_f32_be() to parse big-endian float Jan 28, 2018
utils.h Add read_f32_be() to parse big-endian float Jan 28, 2018
yamlconfig.c Use macro for F3D vertex data May 3, 2018

README.md

sm64tools

Collection of tools for manipulating the Super Mario 64 ROM

n64split

N64 ROM Splitter and Build System

  • splits ROM into assets: asm, textures, models, levels, behavior data
  • generates build files to rebuild the ROM
  • intelligent recursive disassembler
  • generic config file system to support multiple games

Usage

n64split [-c CONFIG] [-k] [-m] [-o OUTPUT_DIR] [-s SCALE] [-t] [-v] [-V] ROM

Options:

  • -c CONFIG ROM configuration file (default: auto-detect)
  • -k keep going as much as possible after error
  • -m merge related instructions in to pseudoinstructions
  • -o OUTPUT_DIR output directory (default: {CONFIG.basename}.split)
  • -s SCALE amount to scale models by (default: 1024.0)
  • -t generate large texture for MIO0 blocks
  • -v verbose output
  • -V print version information

sm64extend

Super Mario 64 ROM Extender

  • accepts Z64 (BE), V64 (byte-swapped), or N64 (little-endian) ROMs as input
  • works with US, European, Japanese, and Shindou ROMs
  • decompresses all MIO0 blocks from ROM to extended area
  • configurable extended ROM size (default 64 MB)
  • configurable padding between MIO0 blocks (default 32 KB)
  • configurable MIO0 block alignment (default 1 byte)
  • changes all 0x18 level commands to 0x17
  • creates MIO0 headers for all 0x1A level commands
  • optionally fills old MIO0 blocks with 0x01
  • optionally dump compressed and uncompressed MIO0 data to files
  • updates assembly reference to MIO0 blocks
  • recalculates ROM header checksums

Usage

sm64extend [-a ALIGNMENT] [-p PADDING] [-s SIZE] [-d] [-f] [-v] FILE [OUT_FILE]

Options:

  • -a ALIGNMENT Byte boundary to align MIO0 blocks (default = 1).
  • -p PADDING Padding to insert between MIO0 blocks in KB (default = 32).
  • -s SIZE Size of the extended ROM in MB (default: 64).
  • -d Dump MIO0 blocks to files in mio0 directory.
  • -f Fill old MIO0 blocks with 0x01.
  • -v verbose output.

Output file: If unspecified, it is constructed by replacing input file extension with .ext.z64

Examples

64 MB extended ROM that is bit compatible with with generated from the M64ROMExtender1.3b, after extending to 64 MB

sm64extend sm64.z64

24 MB extended ROM that is bit compatible with the ROM generated from the M64ROMExtender1.3b

sm64extend -s 24 sm64.z64

Enable verbose messages and specify output filename:

sm64extend -v sm64.z64 sm64_output.ext.z64

Pad 64 KB between blocks, align blocks to 16-byte boundaries, fill old MIO0 blocks with 0x01:

sm64extend -p 64 -a 16 -f sm64.z64

sm64compress

Experimental Super Mario 64 ROM alignment and compression tool

  • packs all MIO0 blocks together, reducing unused space
  • optionally compresses MIO0 blocks (and converts 0x17 commands to 0x18)
  • configurable MIO0 block alignment (default 16 byte)
  • reduces output ROM size to 4 MB boundary
  • updates assembly reference to MIO0 blocks
  • recalculates ROM header checksums

Usage

sm64compress [-a ALIGNMENT] [-c] [-d] [-v] FILE [OUT_FILE]

Options:

  • -a alignment Byte boundary to align MIO0 blocks (default = 16).
  • -c compress all blocks using MIO0.
  • -d dump MIO0 blocks to files in mio0 directory.
  • -v verbose output.

Output file: If unspecified, it is constructed by replacing input file extension with .out.z64

Other Tools

There are many other smaller tools included to help with SM64 hacking. They are:

  • f3d: tool to decode Fast3D display lists
  • mio0: standalone MIO0 compressor/decompressor
  • n64cksum: standalone N64 checksum generator. can either do in place or output to a new file
  • n64graphics: converts graphics data from PNG files into RGBA or IA N64 graphics data
  • mipsdisasm: standalone recursive MIPS disassembler
  • sm64geo: standalone SM64 geometry layout decoder

License

MIT License. Copyright 2015 queueRAM.