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

klaussilveira1 pts0 comments

GitHub - libsm64/libsm64: Mario 64 as a library for use in external game engines · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Uh oh!

There was an error while loading. Please reload this page.

libsm64

libsm64

Public

Notifications<br>You must be signed in to change notification settings

Fork<br>50

Star<br>752

master

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>204 Commits<br>204 Commits

.github/workflows

.github/workflows

src

src

test

test

.gitignore

.gitignore

LICENSE.md

LICENSE.md

Makefile

Makefile

README.md

README.md

import-mario-geo.py

import-mario-geo.py

import-test-collision.py

import-test-collision.py

View all files

Repository files navigation

libsm64 - Super Mario 64 as a library

The purpose of this project is to provide a clean interface to the movement and rendering<br>code which was reversed from SM64 by the SM64 decompilation project,<br>so that Mario can be dropped in to existing game engines or other systems with minimal effort.<br>This project produces a shared library file containing mostly code from the decompilation project,<br>and loads an official SM64 ROM at runtime to get Mario's texture and animation data, so any project<br>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<br>making use of the library must only include that header and load the library. There's a minimal example<br>project under the test directory as well, demonstrating usage of the library.

Bindings and plugins

Rust bindings

Odin bindings

Unity plugin

Blender add-on

Godot add-on

Game Maker 8 extension

Unity MelonLoader mod

Unity BepInEx plugin

C# bindings

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 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

Follow steps 1-4 for setting up MSYS2 MinGW 64 here, but replace the repository URL with https://github.com/libsm64/libsm64.git

Ensure the SDL2 and GLEW libraries are installed if you're building the test program.

64 bits: pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew.

32 bits: pacman -S mingw-w64-i686-SDL2 mingw-w64-i686-glew.

Run make to build

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 for Emscripten (Web) (WIP)

Run emmake make CC=emcc.

If you want libsm64 standalone to call from JS (may not be that<br>useful?), then run emcc dist/libsm64.so -o libsm64.js afterward to<br>emit libsm64.wasm and libsm64.js.

Otherwise, dist/libsm64.so should be a compiled WebAssembly object<br>that you can link into your own C project.

Make targets (all platforms)

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.

About<br>Mario 64 as a library for use in external game engines<br>Resources<br>Readme<br>CC0-1.0 license<br>Activity<br>Custom properties<br>Stars<br>752 stars<br>Watchers<br>18 watching<br>Forks<br>50 forks<br>Report repository

Releases

Packages

Contributors

Languages

You can’t perform that action at this time.

libsm64 test library mario project make

Related Articles