Skip to content

Instantly share code, notes, and snippets.

@Francesco149
Last active July 18, 2020 06:20
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Francesco149/98397538d8d249115d72d90339b536b6 to your computer and use it in GitHub Desktop.
Save Francesco149/98397538d8d249115d72d90339b536b6 to your computer and use it in GitHub Desktop.

how to build the super mario 64 pc port

the binary will be in build/sm64.us.f3dex2e

PC Port - Before Building

  • get the sm64 US rom in z64 format, rename to baserom.us.z64 and put it in the sm64pc root folder
  • you can also use the japanese rom (except rename to .jp instead of .us) and when you run make you would pass VERSION=jp

PC Port - Building on Linux

  • install gcc make glfw-devel libusb-devel audiofile-devel
  • make -j9 TARGET_N64=0

PC Port - Building on Windows

  • install msys2 and start it
  • pacman -Syu
  • restart msys2
  • explorer .
  • copy sm64pc source code folder to the directory that opens in explorer

NOTE: in these commands when you see -j9 replace that with the number of cores/threads to use when compiling (in my case 9)

pacman -Syu
pacman -S git make auto{make,conf} libtool python3 gcc \
  mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-pkg-config

cd sm64pc

git clone https://github.com/mpruett/audiofile/ --depth=1
cd audiofile
CC=x86_64-pc-msys-gcc CXX=x86_64-pc-msys-g++ ./autogen.sh --prefix=/usr/
cd libaudiofile
make -j9
make install
cd ../..

make -C tools clean
make -C tools CC=x86_64-pc-msys-gcc CXX=x86_64-pc-msys-g++
make -j9 TARGET_N64=0
@pnuema-pi
Copy link

As someone completely new to the Linux game I was hoping you could help me with a couple things. First, will the 4k widescreen aspect of this run on a Pi4?

Also, when you say:

“ install gcc make glfw-devel libusb-devel audiofile-devel

make -j9 TARGET_N64=0“

Are these commands you have to run in the terminal prior to the rest in the list at the end of the post? Where does one put the SM64 source code folder when compiling from linux?

I got this to run perfectly on a Win10 machine but would love to get it going on a Pi4 if possible. Thanks.

@Francesco149
Copy link
Author

@pnuema-pi make is an actual command yes, the install part entirely depends on your linux distro. for example on ubuntu, debian or raspbian it would be sudo apt install gcc make glfw-devel libusb-devel audiofile-devel, but the package names can also vary depending on linux distro so you'll have to search a bit until you find everything it wants

you can place the source anywhere you want

no idea how it runs in 4k as i don't have a 4k screen to test. it ran smooth in 1280x1024 though

raspberry pi requires some source code changes to compile, see this more up to date guide: https://github.com/Francesco149/sm64pc_instructions

if you use raspbian it might still not compile, i had to change some stuff in the code other than what i suggest in that link because they use outdated GLX. any more up to date linux distro running on rpi should compile fine with just the .s file changes though

@pnuema-pi
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment