Super Mario 64 Natively on Android

Found a post on XDA about building Super Mario 64 for Android using Termux, & figured I’d try it out for fun.
Source: XDA Developers: Super Mario 64 can be natively run on Android without a Nintendo 64 emulator

Their instructions worked fine, so below is really just a copy & paste from the XDA post:

➜  ~ pkg install git wget make python getconf zip apksigner clang
Checking availability of current mirror: ok
Reading package lists... Done
Building dependency tree       
Reading state information... Done
apksigner is already the newest version (29.0.2-5).
clang is already the newest version (10.0.1-2).
getconf is already the newest version (0.5-1).
git is already the newest version (2.28.0).
make is already the newest version (4.3-1).
python is already the newest version (3.8.5).
wget is already the newest version (1.20.3-3).
zip is already the newest version (3.0-5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
➜  ~ cd Development 
➜  Development git clone https://github.com/VDavid003/sm64-port-android
Cloning into 'sm64-port-android'...
remote: Enumerating objects: 15616, done.
remote: Total 15616 (delta 0), reused 0 (delta 0), pack-reused 15616
Receiving objects: 100% (15616/15616), 22.76 MiB | 5.71 MiB/s, done.
Resolving deltas: 100% (7567/7567), done.
➜  Development cd sm64-port-android 
➜  sm64-port-android git:(master) cp ~/storage/shared/Super\ Mario\ 64\ \(USA\).z64 baserom.us.z64
➜  sm64-port-android git:(master) sha256 baserom.us.z64 
The program openssl is not installed. Install it by executing:
 pkg install openssl-tool
➜  sm64-port-android git:(master) pkg install openssl-tool
Checking availability of current mirror: ok
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  openssl-tool
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 185 kB of archives.
After this operation, 643 kB of additional disk space will be used.
Get:1 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 openssl-tool aarch64 1.1.1g-4 [185 kB]
Fetched 185 kB in 0s (214 kB/s)    
Selecting previously unselected package openssl-tool.
(Reading database ... 14219 files and directories currently installed.)
Preparing to unpack .../openssl-tool_1.1.1g-4_aarch64.deb ...
Unpacking openssl-tool (1.1.1g-4) ...
Setting up openssl-tool (1.1.1g-4) ...
➜  sm64-port-android git:(master) sha256 baserom.us.z64   
SHA256(baserom.us.z64)= 17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91
➜  sm64-port-android git:(master) md5sum baserom.us.z64 
20b854b239203baf6c961b850a4a51a2  baserom.us.z64
➜  sm64-port-android git:(master) ./getSDL.sh
~/Development/sm64-port-android/SDL ~/Development/sm64-port-android
--2020-09-20 11:56:47--  https://www.libsdl.org/release/SDL2-2.0.12.zip
Resolving www.libsdl.org... 2604:a880:1:20::181:e001, 192.241.223.99
Connecting to www.libsdl.org|2604:a880:1:20::181:e001|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6784187 (6.5M) [application/zip]
Saving to: ‘SDL2-2.0.12.zip’

SDL2-2.0.12.zip                       100%[=======================================================================>]   6.47M  5.65MB/s    in 1.1s    

2020-09-20 11:56:49 (5.65 MB/s) - ‘SDL2-2.0.12.zip’ saved [6784187/6784187]

~/Development/sm64-port-android
➜  sm64-port-android git:(master) make --jobs 4
...
cp build/us_pc/sm64.us.f3dex2e.unsigned.apk build/us_pc/sm64.us.f3dex2e.apk
apksigner sign --cert certificate.pem --key key.pk8 build/us_pc/sm64.us.f3dex2e.apk
➜  sm64-port-android git:(master) ls
Android.mk   Makefile.split  assets           charmap.txt       enhancements       key.pk8        sm64.jp.sha1  text
CHANGES      README.md       assets.json      charmap_menu.txt  extract_assets.py  levels         sm64.ld       textures
Dockerfile   SDL             baserom.us.z64   data              first-diff.py      lib            sm64.sh.sha1  tools
Doxyfile     actors          bin              diff.py           format.sh          rename_sym.sh  sm64.us.sha1  undefined_syms.txt
Jenkinsfile  android         build            diff_settings.py  getSDL.sh          rsp            sound
Makefile     asm             certificate.pem  doxygen           include            sm64.eu.sha1   src
➜  sm64-port-android git:(master) ls build 
us_pc
➜  sm64-port-android git:(master) ls build/us_pc 
actors  bin   endian-and-bitwidth  level_rules.mk  lib         rsp                  sm64.us.f3dex2e.unsigned.apk  src   textures
assets  data  include              levels          libmain.so  sm64.us.f3dex2e.apk  sound                         text
➜  sm64-port-android git:(master)
Super Mario 64 running natively on my OnePlus 7 Pro.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.