mirror of https://github.com/snesrev/smw.git
4.6 KiB
4.6 KiB
Welcome to the building instructions for the project! Please make sure to prepeare the required files and install the necessary dependencies for your current OS.
Requirements:
- A Super Mario World rom (Make sure to rename it to
smw.sfc) libsdl2-dev(The installation for this will be different for each compiler.)- Super Mario World repo
git clone --recursive https://github.com/snesrev/smw - Python (During installation, make sure to check the "Add to PATH")
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 Tiny C Compiler
Dependencies and requirements:
- Rename your obtaind Super Mario World rom to
smw.sfcand place it in the root folder. - Unzip both TCC and SDL2 and place them in
third_partyfolder. - Double click
run_with_tcc.bat - Wait for it to compile and the game will automatically boot-up.
More advanced methods
Building with MSYS2
Dependencies and requirements:
- The
libsdl2-devlibrary - MSYS2
Note: Make sure you're using MINGW64 and you're in smw folder in the terminal.
- Install MSYS2 on your machine.
- Place the copy of your rom in the main directory.
- Install the necessary dependencies and SDL2 by inputting this command in MSYS2 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, in the terminal, type make
In order to speed up the compilation, type make -j16
Building with Visual Studio
Dependencies and requirements:
- The
libsdl2-devlibrary, 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
smw.slnsolution. - Change the build target from
DebugtoRelease - Build the solution.
Running SMB1 and SMBLL
Dependencies and requirements:
- Super Mario All-Stars rom (US version and not + Mario World)
zstandard
- Rename your obtained rom to
smas.sfcand place it inside theotherfolder. - To install
zstandardmake sure you've installed Python and added to PATH. Open up CMD and typepip install zstandardto install the required dep. - In the
otherfolder drag and drop your renamed rom intoextract.pyor by typingextract.pyin the command line to extract the necessary files. - Move
smb1.sfcandsmbll.sfcto root folder. - Before running the games, make sure to recompile or else they won't boot up.
- Drag your desired game to
smw.exein order to run.
Linux/MacOS
Open the terminal and CD to your SM root folder:
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-sdl2library - DevKitPro
- Atmosphere
pkg-config
- 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.exeinsidemsys2located indevkitProfolder. - Type
pacman -S git switch-dev switch-sdl2 switch-tools pkg-configin the terminal to install theswitch-sdl2library. - CD to
switchfolder by typingcd src/platform/switchin the terminal on thesmwroot folder. - type
maketo compile the Switch Port. - Transfer the
.ini,nro,ncapand your rom file to the Switch.
OPTIONAL STEP
make -j$(nproc) # To build using all cores