Super Mario 3D All-Stars is finally here, which means you can now play the Super Mario 64 in high-definition on your Nintendo Switch.

Super Mario 3D All-Stars is finally here, which means you can now play the first three 3D platformers in the series — Super Mario, Super Mario Sunshine, and Super Mario Galaxy — in high-definition on your Nintendo Switch. In case you’re looking for a way to enjoy Princess Peach’s cake on your Android phone, you can either try your luck with Switch emulation or grab a compatible Nintendo 64 emulator to dive into the world of Super Mario 64.

Unfortunately, emulation has its fair share of shortcomings. Nothing can beat the performance and scalability of a native executable, which is the driving force behind the long-standing effort to reverse engineer the Super Mario 64 ROM into an equivalent C codebase. As long as you have access to the human readable C code, you have the ability to port the game to any platform, including Android.

As a matter of fact, XDA Member VDavid003 has already stepped up and prepared a repo containing a ready-to-compile Super Mario 64 port for Android using Simple DirectMedia Layer (SDL) with OpenGL ES 2.0. You can clone the repo to your PC running Microsoft Windows or Linux, prepare the build environment, and finally get the APK after compilation which can be easily sideloaded on an Android device. However, what makes the porting process more interesting is the fact that it can also be compiled directly on your Android phone!

How to natively compile and run Super Mario 64 on Android

DISCLAIMER: XDA does not condone pirating games. You must provide your own copy of Super Mario 64 for the following process to work.

If command line voodoo is your thing, then follow these steps to configure the build environment in Android and compile the classic Nintendo platformer from scratch:

  1. Install Termux from Google Play Store.
  2. Install the required dependencies inside the Termux environment:
    pkg install git wget make python getconf zip apksigner clang
  3. Clone the appropriate repository using git:
    git clone https://github.com/VDavid003/sm64-port-android cd sm64-port-android
  4. Copy the baserom of the game using Termux. Once again, you must supply your own copy.
    termux-setup-storage
    cp /sdcard/path/to/your/baserom.z64 ./baserom.us.z64
  5. Get SDL includes:
    ./getSDL.sh
  6. Start the build:
    make –jobs 4
    You can increase the value of the “jobs” parameter depending on how many CPU cores you can devote to the building process.
  7. If things go well, the resulting Super Mario 64 APK should be found inside the “build” folder:
    ls -al build/us_pc/sm64.us.f3dex2e.apk
The article is originally published at xda developers