HeadlinesBriefing favicon HeadlinesBriefing.com

libsm64: Mario 64 Library for Game Engines

Hacker News •
×

The libsm64 project provides a clean interface to the movement and rendering code reversed from SM64 by the decompilation project, allowing Mario to be dropped into existing game engines with minimal effort. It produces a shared library containing mostly code from the decompilation and loads an official SM64 ROM at runtime for texture and animation data, requiring users to provide a ROM for asset extraction.

The entire external-facing API resides in libsm64.h, and client projects need only include that header and load the library. A minimal example exists in the test directory. Bindings and plugins are available for Rust, Odin, Unity, Blender, Godot, Game Maker 8, and C#, plus Unity Melon Loader and BepInEx mods.

Building on Mac and Linux requires python3, SDL2, and GLEW; run make to build, with LIBSM64_MUSL=1 make for musl libc. The test program needs a SM64 US ROM named baserom.us.z64. Windows uses MSYS2 MinGW64 with similar dependencies. Emscripten web builds are work-in-progress via emmake make CC=emcc.