mirror of
https://github.com/snesrev/sm.git
synced 2024-11-23 05:39:44 +00:00
9680714094
### Description People seemed to be having issues compiling the game on MSYS2 so this PR fixes all of it. And I also overhauled the instruction to make it look prettier. This also updates the Switch compiling instructions to make it work. ### Will this Pull Request break anything? No. ### Suggested Testing Steps See if it compiles.
3.3 KiB
3.3 KiB
Requirements
- A Super Metroid rom (Make sure to rename it to
sm.smc
) - libsdl2-dev
- Super Metroid repo
git clone --recursive https://github.com/snesrev/sm
For Linux/MacOS you must install these for your desired OS:
- Ubuntu/Debian:
sudo apt install libsdl2-dev
- Fedora Linux:
sudo dnf in sdl2-devel
- Arch Linux:
sudo pacman -S sdl2
- macOS:
brew install sdl2
Windows
Building with MSYS2
Dependencies and requirements:
- The
libsdl2-dev
library - MSYS2
Note: Make sure you're using MINGW64 and you're in sm
folder in the terminal.
- Install MSYS2 on your machine.
- Place the copy of your rom in the main directory.
- Install the necessary dependencies by inputting this command in the terminal.
pacman -S mingw-w64-x86_64-SDL2 && pacman -S make && pacman -S mingw-w64-x86_64-gcc
- Type
sdl2-config --cflags
, it should output:
-IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main
- After that type
sdl2-config --libs
, should output:
-LC:/msys64/mingw64/lib -lmingw32 -mwindows -lSDL2main -lSDL2
After you've done installing everything, cd to sm
folder. Type make
In order to speed up the compilation, type make -j16
Building with Visual Studio
Dependencies and requirements:
- The
libsdl2-dev
library, which is automatically installed with NuGet. - Visual Studio Community 2022
Download VS installer. On installer prompt, make sure you're on "Workloads" and check Desktop Development with C++
this will install the necessary deps for compilation.
- Open
sm.sln
solution. - Change the build target from
Debug
toRelease
- Build the solution.
Building with Tiny C Compiler
Dependencies and requirements:
- Unzip both TCC and SDL and place them in
third_party
folder. - Double click
run_with_tcc.bat
- Wait for it to compile and the game will automatically boot-up.
Linux/MacOS
CD to your SM root folder and open the terminal and type:
make
For more advanced usage:
make -j$(nproc) # run on all core
make clean all # clear gen+obj and rebuild
CC=clang make # specify compiler
Nintendo Switch
Dependencies and requirements:
- The
switch-sdl2
library - DevKitPro
- Atmosphere
- Make sure you've installed Atmosphere on your Switch.
- Please download the DevKitPro version of MSYS2 through their installer, as the default MSYS2 causes issues with windows compiling.
- Now that you've installed DevKitPro, open up the location you've installed DevKitPro to, then find
mingw64.exe
insidemsys2
located indevkitPro
folder. - Type
pacman -S git switch-dev switch-sdl2 switch-tools
in the terminal to install theswitch-sdl2
library. - CD to
switch
folder by typingcd src/platfrom/switch
in the terminal on thesm
root folder. - type
make
to compile the Switch Port. - Transfer the
.ini
,nro
,ncap
and your rom file to the Switch.
OPTIONAL STEP
make -j$(nproc) # To build using all cores