Monday, September 21, 2020

Unofficial Port of Super Mario 64


"This is now possible thanks to the work of XDA Member VDavid003. With the effort done on rewriting the source code in the programming language C, Super Mario 64 has been ported to Android (and also as a WIP on Dreamcast). VDavid003 has created a GitHub repo that you can use to compile an APK version of the game on your PC or directly on your Android device. For it to work, you must provide your own copy of Super Mario 64."

Android. Use this repo if you want to compile the app on PC
Guide:
1.  Get Termux app from Google Play Store.
2. Install required dependencies inside Termux:
pkg install git wget make python getconf zip apksigner clang

3. Clone appropriate repository with git:
git clone https://github.com/VDavid003/sm64-port-android
cd sm64-port-android

4. Copy the game's baserom with Termux. You must provide your own copy of the game.
termux-setup-storage
cp /sdcard/path/to/your/baserom.z64 ./baserom.us.z64

5. Get SDL includes:
./getSDL.sh

6.   Start the build:
# if you have more cores available, you can increase the --jobs parameter
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

For building native executables on Linux:
Linux
1.   Install prerequisites (Ubuntu): sudo apt install -y git build-essential pkg-config libusb-1.0-0-dev libsdl2-dev.

2. Clone the repo: git clone https://github.com/sm64-port/sm64-port.git, which will create a directory sm64-port and then enter it cd sm64-port.

3. Place a Super Mario 64 ROM called baserom..z64 into the repository's root directory for asset extraction, where VERSION can be us, jp, or eu.

4. Run make to build. Qualify the version through make VERSION=. Add -j4 to improve build speed (hardware dependent based on the amount of CPU cores available).

5. The executable binary will be located at build/_pc/sm64..f3dex2e.

Windows
1.   Install and update MSYS2, following all the directions listed on https://www.msys2.org/.
2. From the start menu, launch MSYS2 MinGW and install required packages depending on your machine (do NOT launch "MSYS2 MSYS"):
  • 64-bit: Launch "MSYS2 MinGW 64-bit" and install: pacman -S git make python3 mingw-w64-x86_64-gcc
  • 32-bit (will also work on 64-bit machines): Launch "MSYS2 MinGW 32-bit" and install: pacman -S git make python3 mingw-w64-i686-gcc 
  • Do NOT by mistake install the package called simply gcc.
3. The MSYS2 terminal has a current working directory that initially is C:\msys64\home\ (home directory). At the prompt, you will see the current working directory in yellow. ~ is an alias for the home directory. You can change the current working directory to My Documents by entering cd /c/Users//Documents.

4. Clone the repo: git clone https://github.com/sm64-port/sm64-port.git, which will create a directory sm64-port and then enter it cd sm64-port.

5. Place a Super Mario 64 ROM called baserom..z64 into the repository's root directory for asset extraction, where VERSION can be us, jp, or eu.

6. Run make to build. Qualify the version through make VERSION=. Add -j4 to improve build speed (hardware dependent based on the amount of CPU cores available).

7. The executable binary will be located at build/_pc/sm64..f3dex2e.exe inside the repository.

Troubleshooting
  • If you get make: gcc: command not found or make: gcc: No such file or directory although the packages did successfully install, you probably launched the wrong MSYS2. Read the instructions again. The terminal prompt should contain "MINGW32" or "MINGW64" in purple text, and NOT "MSYS".
  • If you get Failed to open baserom.us.z64! you failed to place the baserom in the repository. You can write ls to list the files in the current working directory. If you are in the sm64-port directory, make sure you see it here. 
  • If you get make: *** No targets specified and no makefile found. Stop., you are not in the correct directory. Make sure the yellow text in the terminal ends with sm64-port. Use cd to enter the correct directory. If you write ls you should see all the project files, including Makefile if everything is correct.
  • If you get any error, be sure MSYS2 packages are up to date by executing pacman -Syu and pacman -Su. If the MSYS2 window closes immediately after opening it, restart your computer. 
  • When you execute gcc -v, be sure you see Target: i686-w64-mingw32 or Target: x86_64-w64-mingw32. If you see Target: x86_64-pc-msys, you either opened the wrong MSYS start menu entry or installed the incorrect gcc package.
Source:
GBAtemp

No comments:

Post a Comment