Skip to content
Tech News
← Back to articles

Libsm64: Mario 64 as a library for use in external game engines

read original more articles
Why This Matters

Libsm64 transforms Super Mario 64 into a reusable library, enabling developers to integrate Mario's movement and rendering into various game engines with minimal effort. This opens up new possibilities for modders, developers, and researchers to experiment with or build upon the classic game in modern environments, fostering innovation and preservation of gaming history.

Key Takeaways

libsm64 - Super Mario 64 as a library

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.

Bindings and plugins

Building on Mac and Linux

Ensure python3 is installed.

Ensure the SDL2 and GLEW libraries are installed if you're building the test program (on Ubuntu: libsdl2-dev, libglew-dev).

Run make to build. If you want to link musl libc instead of glibc run LIBSM64_MUSL=1 make instead.

to build. If you want to link musl libc instead of glibc run instead. To run the test program you'll need a SM64 US ROM in the root of the repository with the name baserom.us.z64 .

Building on Windows

... continue reading