Guide: Super Mario 64 Port on Retro Handhelds

Last updated: 23JUN2022 (see Changelog for details)

Great news – the method used to bring the awesome Super Mario 64 port for RG350 devices is now available for the RG351P and similar retro handheld devices. This port is unique in that it features a 60fps (frames per second) patch, making the game look and feel twice as smooth as it originally did. It’s worth checking out this port for this feature alone. Moreover, it’s available for both the 351ELEC and ArkOS firmwares, which is very handy!

This guide is relatively simple, but before we get started, a word about copyright: The game file for Super Mario 64 (or for any game, unless explicitly offered by the owner) is considered copyrighted media, just like a film or song is considered copyrighted media. While it’s never been tested in court, distributing game files over the internet is considered illegal. This guide will show you how to create your own port of SM64 using your own copy of the game, for your own personal use. Sharing the location of a copy of SM64 is not permitted on this site, nor is distributing a copy of the completed port we’re about to create. If you’re interested in reading more about the legality surrounding game emulation, check out my article here.

Note that the video below is quite dated, but the process is relatively the same. For the most current information, follow the written guides below.

Table of Contents:
Build the Super Mario 64 port
Remap the controls
RG351V instructions
RG351MP instructions
Updated instructions for RG351V, RG351MP, RGB20S, RG552, RG503, and RG353P
PowKiddy RGB10 instructions
RetroOZ (ODROID Go Super and PowKiddy RGB10 Max) instructions
Notes

Changelog

To start, you will need your personal copy of the Super Mario 64 Nintendo 64 ROM. Make sure that you’re using a ROM with the file extension of .z64 to ensure widest compatibility. You need to use a US version of the ROM. The file needs to be renamed as follows:

baserom.us.z64 for NTSC/US version of Super Mario 64

Build the Super Mario 64 port

I found this to be the most fun part of the whole process. The developer of this port created an online builder tool specifically for this port. All you have to do is visit a webpage, follow a few notes, and voilà, the builder will decompile and build a zip file from your SM64 game file.

  • Head to this page to find the SM64 port builder.
  • In the first “cell” (piece of code) on the page, you’ll find a “play” button on the top-left side of the code. This will download the toolchain and create the necessary file structure.
  • On the left menu, you’ll see an icon of a folder (click the refresh button if you don’t see it). Click that folder icon, then the “sm64-351elec-port” folder. Take your renamed “baserom.us.z64” file and drag it into the sm64-351elec-port folder.
  • In the next cell (code) you will see a bunch of lines that are annotated with a “#” comment symbol. It will look like this:
# VERY EXPERIMENTAL : Uncomment the following line to apply puppycam patch
#!cd sm64-351elec-port && patch -p1 < ./enhancements/puppycam.patch

# Uncomment the following line to apply 60fps patch
#!cd sm64-351elec-port && git apply ./enhancements/60fps.patch --ignore-whitespace --reject

# Uncomment the following line to build for 351ELEC
#!cd sm64-351elec-port && ./build_351_elec.sh && ./build_package_elec.sh

# Uncomment the following line to build for ArkOS
#!cd sm64-351elec-port && ./build_351_ark.sh && ./build_package_ark.sh
  • The first section is for a “puppycam” patch, which gives you a full 360 camera on the right stick (something not originally available on the game). This section is still experimental, so it’s up to you if you want to try it or stick with the original camera. To try the puppycam patch, simply delete the “#” before the “!cd” line, which will enable the patch. Fair warning, the patch is fairly buggy, and I prefer not to use it.
  • Similarly, you want to delete the “#” from the first “!cd” line to apply the 60fps patch, and then delete the “#” from the “!cd” line that applies to whatever firmware you’re using — 351ELEC or ArkOS.
  • After that, just click the “play” button for this cell, and it will create the .zip file port for you. If you get an error, there’s probably something wrong with your Super Mario 64 ROM. Use a different one.
  • If all goes well, you will have a file named sm64-351ELEC.zip (or sm64-ArkOS.zip if you built the ArkOS version) in the main root directory on the left menu. Download this file, then unzip it to reveal a sm64.sh file and a folder named sm64. Note that in ArkOS, the name of the .sh file is what will appear on your menu, so if you’d like, rename it to something easier to identify, like “Super Mario 64.sh”. To change the name of the game in 351ELEC, use the gamelist.xml entry found in the Notes section below.
  • Insert your RG351P microSD card into your computer using a USB SD card reader, then navigate to GAMES (or EASYROMS for ArkOS) / ports folder. Place the sm64.sh and sm64 folder into the ports folder. Note that it will take a while to move over, because there are lots of little files in the sm64 folder.

After that, just eject the SD card and re-insert it into your device. You should now find the Super Mario 64 game in your Ports section.

Remap the controls

By default, here are the controls:

A button: jump
B button: punch/roll
L1 button: Z button
R1 button: R button
Right analog stick: C buttons
START: pause/in-game menu
START + SELECT: close game

There are two methods to remap the controls. If you built your SM64 port before 30DEC2020, you will need to do Method #2. If you compiled your port on 30DEC2020 or later, you can do either method.

Method #1: sm64config.txt files

To start, you have to boot up the game at least once to create the necessary files. Eject the SD card and put it in your computer. In the ports/sm64/configuration folder on your SD card, you’ll find a file named “sm64config.txt”. In this file, you can set the parameters “button_a”, “button_b”, etc, with the buttons you want to use (be sure to use uppercase). It will look like this:

button_a A
button_b B
button_start START
button_r R1
button_z L1

For me, I changed button_a to B and button_b to Y.

Method #2: gamecontrollerdb.txt file

You can also go into the ports/sm64/controller folder on your SD card, and open the gamecontrollerdb.txt file. Find the text string that starts with “03000000091200000031000011010000,OpenSimHardware OSH PB Controller”, and make the following changes to the face button configuration in that string:

a:b1,b:b3,y:b2,x:b0

This will map the jump button to the B button, and the punch/roll button to Y, which feels the most natural to me.

RG351V instructions

The RG351V has a single analog stick, which makes using the C buttons a bit tricky. Luckily this process will map them to the d-pad instead, giving you a simple workaround. Thanks to Reddit user daedalia2 for the controller file!

  • Build the SM64 port using the build guide above, following instructions for either the ArkOS or 351ELEC version. Also be sure to uncomment the 60fps patch, and you can also select the puppycam patch to make navigation a bit easier in later levels. If you’ve already built it once before, you can use that same file again.
  • Place the sm64.sh file and the sm64 folder in the “ports” folder (you can rename sm64.sh file to something a bit nicer, like Super Mario 64.sh). Next, download this file, unzip it, and place the gamecontrollerdb.txt file in the ports/sm64/controller folder (replace the one that’s already in there).
  • If using ArkOS with a two-card setup, place everything in the SD2 card instead, but also place the downloaded gamecontrollerdb.txt file in the EASYROMS/ports/sm64/controller folder of the SD1 card too. You will have to create the sm64/controller folders first.

Press START + SELECT to exit the game at any time.

RG351MP instructions

Thanks to Reddit user daedalia2 and jetup for cracking the code on this one.

  • Build the SM64 port using the build guide above, following instructions for either the ArkOS or 351ELEC version. Also be sure to uncomment the 60fps patch, and you can also select the puppycam patch to make navigation a bit easier in later levels. If you’ve already built it once before, you can use that same file again.
  • Place the sm64.sh file and the sm64 folder in the “ports” folder (you can rename sm64.sh file to something a bit nicer, like Super Mario 64.sh). Next, download this file, unzip it, and place the gamecontrollerdb.txt file in the ports/sm64/controller folder (replace the one that’s already in there).
  • If using ArkOS with a two-card setup, place everything in the SD2 card instead, but also place the downloaded gamecontrollerdb.txt file in the EASYROMS/ports/sm64/controller folder of the SD1 card too. You will have to create the sm64/controller folders first.

Press START + SELECT to exit the game at any time.

Updated instructions for RG351V, RG351MP, RGB20S, RG552, RG503, and RG353P

These instructions will work with any retro handheld that has dual SD cards and is capable of running PortMaster. This will include the RG351V, RG351MP, RG552, RG503, and RG353P. This process will take a couple extra steps from those above, but will utilize universal controller profiles already set up in PortMaster. You will need to have PortMaster installed and updated on your device before starting, here is my guide on how to get this set up. Thanks to romadu for the fixes!

  • Download this package and extract the contents onto our computer.
  • Build the SM64 port using the build guide above, following instructions to create either the 351ELEC or ArkOS version. Also be sure to uncomment the 60fps patch, and you can also select the puppycam patch to make navigation a bit easier in later levels. Before pressing the “Play” button on Step 2, go into the file browser on the left column and navigate to sm64-351elec-port > src > pc > controller and delete the controller_sdl.c file found there. Then, drag and drop the controller_sdl.c file we downloaded from the package in Step 1 into that same folder, to replace it. Proceed with the rest of the build as intructed above.
  • Once you have built the sm64-ArkOS.zip or sm64-351ELEC.zip file, save it to your computer, then unzip the file to reveal the data files inside. Within there, replace the sm64.sh file with the sm64.sh file we downloaded from the package in Step 1.
  • Place the sm64.sh file and the sm64 folder in the PORTS folder in your SD card (you can rename the sm64.sh file to something a bit nicer, like Super Mario 64.sh).

PowKiddy RGB10 instructions

Setting up Super Mario 64 on the RGB10 is almost the same as the RG351 devices, but with a special button configuration for the device. You will need to be running the ArkOS firmware for this to work.

  • Build the SM64 port using the build guide above, following instructions to create the ArkOS version. Also be sure to uncomment the 60fps patch, and you can also select the puppycam patch to make navigation a bit easier in later levels.
  • Once you have built the sm64-ArkOS.zip file, save it to your computer, then unzip that file to reveal all of the data files inside.
  • Place the sm64.sh file and the sm64 folder in the EASYROMS/ports folder (you can rename the sm64.sh file to something a bit nicer, like Super Mario 64.sh). Next, download this file, unzip it, and place the gamecontrollerdb.txt file in the EASYROMS/ports/sm64/controller folder (replace the one that’s already in there).

Press START + SELECT to exit the game at any time.

RetroOZ (ODROID Go Super and PowKiddy RGB10 Max) instructions

Setting up Super Mario 64 on the ODROID Go Super and RGB10 Max is fairly simple, but it does have some distinguishing installation requirements from the Anbernic devices:

  • Build the SM64 port using the build guide above, following instructions to create the ArkOS version. Also be sure to uncomment the 60fps patch, too. You can also select the puppycam patch, although I find it to be inferior to the standard SM64 camera when using dual analog sticks.
  • Once you have built the sm64-ArkOS.zip file, save it to your computer, then unzip that file to reveal all of the data files inside.
  • Move everything within the unzipped “sm64” folder into the ROMS/ports/sm64 folder on your RetroOZ sd card, minus the “configuration” and “controller” folders. Don’t worry about the .sh file that is in the root directory of your unzipped folder, RetroOZ already has a pre-built .sh file in the ports folder for you.
  • If using the RGB10 Max, be sure to go into the OPTIONS section in the main RetroOZ menu, then select DEVICES > and whatever RGB10 Max control scheme you prefer (I like having my START/SELECT buttons on top, for example).
  • If using the RGB10 Max 2, download this file, unzip it, and place the gamecontrollerdb.txt file in the ports/sm64/controller folder (replace the once that’s already in there).

Press START + SELECT to exit the game at any time.

Notes

Note that there are no save states, you will have to use the in-game saves just like on the original console.


Changelog

23JUN2022
– updated instructions to include RG351V, RG351MP, RGB20S, RG552, RG503, and RG353P
– removed boxart instructions since you can now just scrape the game within the menu

07NOV2021
– added instructions for the RGB10 Max 2

06NOV2021
– added RG351MP instructions

29AUG2021
– added RG351V, RGB10, and RetroOZ instructions

01AUG2021
– fixed broken link

29DEC2020
– added gamelist.xml instructions for 351ELEC
– added button remapping section

28DEC2020
– published guide

82 thoughts on “Guide: Super Mario 64 Port on Retro Handhelds

  1. I just built it and got it installed on my device but for some reason the game won’t work. Its throwing some kind of an error that says “Software Failure: Check log files for more info.” I really don’t know what the problem is, I followed the tutorial step for step.

    Like

    1. What version of ArkOS are you using? To echo Gingerone, could be you need to redump the ROM (or otherwise source a different one), but I also wonder if this maybe only works with ArkOS 1.5 so far.

      Like

  2. This is somehow very specific and mostly the game is running perfect on the device. Thanks a lot for the guide.
    Not sure if this is somehow related to the port…but I think there are small problems in the game… e.g. in world “Whomp’s Fortress” –> “Blast Away the Wall” the star is missing and not revealed when Mario is crashing into the wall.

    Do you know about more problems like this?

    Like

  3. For folks having issues with the preview image and video, I figured it out! There wasn’t anything in the gamelist file pointing to it. Just copied the formatting for some of the other games and made this for sm64, which is working beautifully.

    Make sure your ../roms/ports/gamelist.xml file has this entry:

    ./sm64.sh
    sm64
    A native port of Super Mario 64, built specifically for the RG351P.
    ./images/sm64-image.png
    ./videos/sm64-video.mp4
    ./images/sm64-image.png
    1.0
    19960624T000000
    Nintendo
    Nintendo

    Like

    1. Ah shoot – it stripped the formatting and everything, and I can’t edit the comment. The relevant text to paste in is here though!


      <game>
      <path>./sm64.sh</path>
      <name>sm64</name>
      <desc>A native port of Super Mario 64, built specifically for the RG351P.</desc>
      <image>./images/sm64-image.png</image>
      <video>./videos/sm64-video.mp4</video>
      <thumbnail>./images/sm64-image.png</thumbnail>
      <rating>1.0</rating>
      <releasedate>19960624T000000</releasedate>
      <genre>Platform</genre>
      <developer>Nintendo</developer>
      <publisher>Nintendo</publisher>
      </game>

      view raw

      sm64example.xml

      hosted with ❤ by GitHub

      Liked by 1 person

  4. The puppycam patch seems to be really wonky on 351Elec. The sensitivity is completely off (might be tuned through settings), and I did not find a way to reset the camera. I’m going to rebuild a version without this patch.

    Like

  5. does anyone else have a problem with the controls not working at all? I’ve recompiled this thing like 4 times and each time it will boot, but controls don’t work so I can’t get past the title screen. Was working just fine on ArkOS, but newest 351 elec is giving me problems as of now.

    Like

      1. You’ll have to check gamecontroller.txt to make sure it’s correct. Copy it from another working port that uses that key mapping method. Max2 will have different input than Max1.

        Like

  6. Hi Guys. Thanks this is awsome. At least, I think it is. First rom i tried, didn work, wrong hash. Second worked and everything worked flawless.
    So I copied the folder an the sh file to the roms/ports Folder of 351Elec.
    But it did not show up in the ports section. Since there was no gameslist.xml in the ports folder i made an empty one, copied the conted for the video and image into it and made a videos and a images folder and copied the image and the video into them. But still, in the ports section all the other (empty) ports appeyr, but not SM64. Does anyone have an idea what could be wrong?

    Liked by 1 person

  7. o man, come on… I just did everything from scratch again. new file, US Version again, correct sha1 Checksum, did every step again without errors. And still the same. Sothing appears in the ports section of Emulation Station. 😦

    Liked by 1 person

    1. “ScummVM, Ports, and MS-DOS are hidden by default in the collections menu. To enable press Start at the main menu screen. Scroll to Game Collection Settings, and press A. Select Systems Displayed, and press A. Scroll to the system you wish to enable and press A. Press B repeatedly to back out to the main menu and EmulationStation will restart automatically.” From the 351elec Wiki

      Liked by 1 person

  8. Hi b1ttercup,

    thank you. Yes I knew that, I allready turned the porst section on to see it.
    I found the problem, as often it was sitting in front of the pc. I wasn´t aware I was still on 351Elec 1.0. After reflashing the OS now the 1.08. version, SM64 works.

    So Russ, thanks this port is awesome, I´ve never seen SM64 this great.

    Liked by 1 person

  9. The content you provide is so awesome. Can’t thank you enough! Really hope to see some more amazing port guides soon. Love your channel and web content on Retro handhelds, easily the best out there in my opinion!

    Like

  10. I keep getting this error. Really new to this so it could be something small I’m missing!

    Makefile:839: recipe for target ‘build/us_pc/src/engine/math_util.o’ failed
    make: *** [build/us_pc/src/engine/math_util.o] Error 1
    make: *** Waiting for unfinished jobs….

    Like

  11. Damn it… this was working for me perfectly for hours. Over the past week I got 70 stars and went to fight the final Bowser, beat him, and then reset the RG351M once the credits got to the “The End” screen. Now it doesn’t work! When I start the game the audio and controls seem to be working flawlessly, like I can load the game and hear everything happening, but there’s no video. Just a black screen and a blinking yellow underscore in the top left side of the screen. In fact, I just check my Doom port (brutal doom) which was working fine and it’s doing the same thing. Emulated games seem to work fine.

    Anyone else experience this?

    Like

  12. Hi, first of all, great port, but there are some problems with the puppycam patch which makes the game barely playable:

    Most of the time, I can’t move the camera to the left and directly to the right. I need to move it up or down between left and right, otherwise it won’t move. The same goes for up to down. I need to go either left or right between those.
    There is no problem if I keep rotating the joystick. But if I release it to center position, I must do this weird manipulation to unlock the camera movement.

    Does anyone have the same problem?

    Like

  13. So regarding the video not playing in the menu. You have to follow the same instructions as 351 Elec. You need to edit the gamelist.xml file to point to the actual video file.

    Like

  14. Hi all,

    Got this running perfectly however, I can’t seem to make Mario double or triple jump? When I press the mapped button as mario lands, nothing happens… any one else experience this problem with the RG351M ?

    Thanks!

    Like

    1. Install the RetroOZ firmware on your OGS, then run the ArkOS method from this guide, put those files on the RetroOZ card minus the controller and config files that will already be on there.

      Like

      1. i’ve tried this on my RGB10 Max, got the game to load, but can’t get the controls to work, any ideas? on RetroOZ 0.49

        Like

      2. Would be great if you can provide the gamecontrollerdb.txt and sm64config.txt for RGB10 Max. Thank you for all the guides!

        Like

  15. Got it working perfectly on my RG351V however one thing i have noticed with the lack of a second stick I have no use of the C buttons, and the locked the Winged cap behind being able to look up at the ceiling is there any kind of fix for this?

    Like

  16. I got this to run on my Odroid Go Super under EmuELEC 4.1, but none of the controls work, anybody get that to work?

    Like

  17. Answering my own question, on the Odroid Go Super under EmuELEC 4.1, I found that using the controller config file from the ArkOS version worked.

    Like

  18. I can’t get this to boot on my RG351P. I’ve tried it on both ArkOS and 351ELEC and in both cases it attempts to start it for a few seconds and then just goes back to the Ports menu. I checked my base rom and it works just fine, so I’m not sure what the problem could be.

    Like

  19. i’m using Powkiddy rgb10 Max and copied the SM64 files to the RetroOZ and got the game to run but no controls. i’ve tried it with version 0.48 and 0.49 with removing the controller and config files and also tried leaving them in there and just can’t get the controls to work. it looks glorious in 60fps to!!! any one found the same and got a solution? Thanks

    Like

  20. The link is saying the “notebook has been moved to trash” and it didn’t work for me, any idea what’s going on there?

    Like

    1. I’m the one who fixed it for the V. I’ll be having a look in the coming days. Might be a simple one. I’ll keep my Reddit updated

      Like

  21. Hello and thanks for your work. Unfortunately, I am stuck on step two. Every time I try to upload the file, a yellow working circle appears, but after a while the circle turns red and the file has not been uploaded.

    Like

  22. For the RG351MP, you need to add the following line to gamecontrollerdb.txt (anywhere in the file). If you have a 2 SD card setup make sure this edited file is at /roms/ports/sm64/controller/gamecontrollerdb.txt instead of /roms2/ports/sm64/controller/gamecontrollerdb.txt as the game has this path hardcoded in the source code – this is similar to instructions above for for the RG351V.

    190000004b4800000011000000010000,GO-Super Gamepad,x:b2,a:b1,b:b0,y:b3,back:b12,start:b13,dpleft:b10,dpdown:b9,dpright:b11,dpup:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b14,guide:b15,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Linux,

    Like

  23. So I have the port on my rg351v at 60fps (via 351elec) and I realized I made my 351P (arkos) port 30 so I went to do a build for 60fps ark os and it is having issues making the build. Same og dump but will not build. Am I missing something here? Can you not reset the google build file so you can do a completely fresh build?

    Thanks,

    Like

  24. I’m using a stock RG351V. I don’t see a Ports folder on either of the SD sticks nor do I see a gameslist.xml in either SD stick (Windows 10). Am I doing something wrong? I tried putting the folder and.sh file into the root of the 2nd SD stick, but can’t see it in All Games.

    Like

  25. Hi Russ – thanks for all the great content. On my RG552 I got the port running (just copied a folder I had created from another handheld), however the controller mapping isn’t working correctly. Can you provide the gamecontrollersdb.txt file for this device please? Thanks in advance!

    Like

  26. Yes like Matt I’m using the RG552 as well and would love to fix the controls as well! I tried using the control txt.file for the Max2 and the sticks are now reversed.

    Like

  27. Got it to work for the RG552! I simply tried the gamecontrollersdb.txt that was listed for the 351MP above, there are several devices in the file and II used the one for GO-Super. You can cut and paste this one if you like:

    190000004b4800000011000000010000,GO-Super Gamepad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b12,guide:b16,start:b13,dpleft:b10,dpdown:b9,dpright:b11,dpup:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b14,rightstick:b17,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Linux,

    Like

  28. Dumb question, but I’m noticing a fair bit of left stick drift on my RG351M, making Mario quite suicidal in later stages lol
    It only ever drifts forward and so far, the SM64 port is the only game where this drift occurs. I also eliminated the possibility of a hardware issue by swapping the control stick modules. Is there a way to adjust the controller deadzone via the sm64config.txt file (or elsewhere)?

    Like

  29. I have RG351V ArkOS. I installed using the “Updated instructions for RG351V, RG351MP, RGB20S, RG552, RG503, and RG353P”, but I also used the gamecontrollerdb file from the “RG351V instructions” section.

    The game runs but the d-pad, does not work as the c-buttons. The d-pad doesnt work at all in-game. I did not apply puppycam.patch. So any ideas why the d-pad is not working as intended?

    Like

  30. worked like a charm for me (RG353P running JELOS). Just one question: is it possible to invert camera axis?

    Like

  31. In the last version of AmberElect the gamepad comes crazy, I tried a lot of configs to fix it, but I can’t do it, someone has a 351p and the same problem?

    Like

  32. I’ve got the game loading on my 351MP, and I can play around with Mario’s nose, etc… However, when I try to start (by pressing start) the game will NOT start. I also cannot exit the game by pressing start and select. I have to force off the device. Could something have changed with the controls?

    Like

    1. Yeah, exactly the same scenario with me too. Can move his face but can’t start the game and have to power down to exit the game. Was fine before the last OTA update. This happens in both my 351m and my 552.

      Like

  33. So I followed this guide and something went wrong the first time. Now idk how to repeat the guide because it says the folder is not empty. What do I do to redo everything from the start please?

    Like

  34. The error message I’m getting:

    “fatal: destination path ‘sm64-351elec-port’ already exists and is not an empty directory.”

    What do do now?

    Like

  35. I have it working from a ready image I downloaded from elsewhere btw… Can I just put that in the ports folder and have it work as is?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s