This is an example mod for Majora's Mask: Recompiled that can be used as a template for creating mods. It has a basic build system, headers, sample code, and a mod config toml.
See this document for an explanation of the modding framework, including how to write function patches and perform interop between different mods.
You'll need to install clang and make to build this template.
- On Windows, using chocolatey to install both is recommended. The packages are
llvmandmakerespectively. - On Linux, these can both be installed using your distro's package manager.
- On MacOS, these can both be installed using Homebrew. Apple clang won't work, as you need a mips target for building the mod code.
On Linux and MacOS, you'll need to also ensure that you have the zip utility installed.
You'll also need to build N64Recomp for the RecompModTool utility.
- First, make sure that the
RecompModToolexecutable is in the root of the mod directory. - Next, run
make(with an optional job count) to build the mod code itself.- This will produce your mod's
.nrmfile in the build folder.
- This will produce your mod's
- Finally, compile your mod offline.
- This part is temporary and only needed while the recomp mod runtime doesn't have LuaJIT recompilation implemented
- Start by running the
OfflineModRecomputility (included in the N64Recomp repo). Pass the following arguments:build/mod_syms.bin build/mod_binary.bin Zelda64RecompSyms/mm.us.rev1.syms.toml build/mod_recompiled.c - Next, build the dynamic library from the generated
build/mod_recompiled.cfile and passoffline_buildas an include path.- On Windows, you can run:
On Linux, you can run:
clang-cl build/mod_recompiled.c -fuse-ld=lld -Z7 /Ioffline_build /MD /O2 /link /DLL /OUT:build/mm_recomp_mod_template-1.0.0.dllclang build/mod_recompiled.c -shared -fvisibility=hidden -fPIC -O2 -Ioffline_build -o build/mm_recomp_mod_template-1.0.0.so - Make sure your mod's dynamic library and .nrm file have the same filename (besides the extension).
- e.g.
testmod-1.0.0.nrmandtestmod-1.0.0.dll
- e.g.
- On Windows, you can run: