Mario 64 as a library for use in external game engines
The purpose of this project is to provide a clean interface to the movement and rendering
code which was reversed from SM64 by the SM64 decompilation project,
so that Mario can be dropped in to existing game engines or other systems with minimal effort.
This project produces a shared library file containing mostly code from the decompilation project,
and loads an official SM64 ROM at runtime to get Mario’s texture and animation data, so any project
which makes use of this library must ask the user to provide a ROM for asset extraction.
The entire external-facing API of the shared library can be found in libsm64.h
. Any client project
making use of the library must only include that header and load the library. There’s a minimal example
project under the test
directory as well, demonstrating usage of the library.
make
to build. If you want to link musl libc instead of glibc run LIBSM64_MUSL=1 make
instead.baserom.us.z64
.https://github.com/libsm64/libsm64.git
pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew
.pacman -S mingw-w64-i686-SDL2 mingw-w64-i686-glew
.make
to buildbaserom.us.z64
.Run emmake make CC=emcc
.
If you want libsm64 standalone to call from JS (may not be that
useful?), then run emcc dist/libsm64.so -o libsm64.js
afterward to
emit libsm64.wasm
and libsm64.js
.
Otherwise, dist/libsm64.so
should be a compiled WebAssembly object
that you can link into your own C project.
make lib
: (Default) Build the dist
directory, containing the shared object or DLL and public-facing header.make test
: Builds the library dist
directory as well as the test program.make run
: Build and run the SDL+OpenGL test program.