Guide: Super Mario 64 Port on RK3326 Devices

Last updated: 29AUG2021 (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 RK3326 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 RG351P 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.

Table of Contents:
Build the Super Mario 64 port
Remap the controls
RG351V instructions
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. As written, these instructions will work for the RG351P and RG351M.

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

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

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

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.

If you want to add boxart and videos to your menu, download and unzip this file.

In ArkOS, place the sm64-image.png file in the ports/images folder, and the sm64-video.mp4 file in the ports/videos folder. Note that if you change the name of your .sh file from sm64.sh to something else, you need to change the image and video file names as well, so that they match.

If you are using 351ELEC, you will need to alter the gamelist.xml file in your ports folder, using a text editor. Add the following entry (thanks to seajay for the code) to add box art and change the displayed name to “Super Mario 64”:

<game>
    <path>./sm64.sh</path>
    <name>Super Mario 64</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>

Finally, place the sm64-image.png file in the ports/images folder, and the sm64-video.mp4 file in the ports/videos folder.


Changelog

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

60 thoughts on “Guide: Super Mario 64 Port on RK3326 Devices

    1. Seems there is a Permissions issue with the Jupyter notebook–he is aware and is looking into it (per the pinned comment on his youTube video).

      Like

  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

  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

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 )

Google photo

You are commenting using your Google 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