Giter VIP home page Giter VIP logo

libsm64's Introduction

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

libsm64's People

Contributors

jaburns avatar meltyplayer avatar brawmario avatar osnr avatar zalo avatar kafeijao avatar headshot2017 avatar heath123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.