Skip to content

Latest commit

 

History

History
120 lines (87 loc) · 4.61 KB

BUILDING.md

File metadata and controls

120 lines (87 loc) · 4.61 KB

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:

  • You'll need TCC and SDL2 in order to compile using TCC.
  1. Rename your obtaind Super Mario World rom to smw.sfc and place it in the root folder.
  2. Unzip both TCC and SDL2 and place them in third_party folder.
  3. Double click run_with_tcc.bat
  4. Wait for it to compile and the game will automatically boot-up.

More advanced methods

Building with MSYS2

Dependencies and requirements:

  • The libsdl2-dev library
  • MSYS2

Note: Make sure you're using MINGW64 and you're in smw folder in the terminal.

  1. Install MSYS2 on your machine.
  2. Place the copy of your rom in the main directory.
  3. 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
  1. Type sdl2-config --cflags, it should output:
-IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main
  1. 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:

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.

  1. Open smw.sln solution.
  2. Change the build target from Debug to Release
  3. Build the solution.

Running SMB1 and SMBLL

Dependencies and requirements:

  • Super Mario All-Stars rom (US version and not + Mario World)
  • zstandard
  1. Rename your obtained rom to smas.sfc and place it inside the other folder.
  2. To install zstandard make sure you've installed Python and added to PATH. Open up CMD and type pip install zstandard to install the required dep.
  3. In the other folder drag and drop your renamed rom into extract.py or by typing extract.py in the command line to extract the necessary files.
  4. Move smb1.sfc and smbll.sfc to root folder.
  5. Before running the games, make sure to recompile or else they won't boot up.
  6. Drag your desired game to smw.exe in 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:

  1. Make sure you've installed Atmosphere on your Switch.
  2. Please download the DevKitPro version of MSYS2 through their installer, as the default MSYS2 causes issues with windows compiling.
  3. Now that you've installed DevKitPro, open up the location you've installed DevKitPro to, then find mingw64.exe inside msys2 located in devkitPro folder.
  4. Type pacman -S git switch-dev switch-sdl2 switch-tools pkg-config in the terminal to install the switch-sdl2 library.
  5. CD to switch folder by typing cd src/platform/switch in the terminal on the smw root folder.
  6. type make to compile the Switch Port.
  7. Transfer the .ini, nro, ncap and your rom file to the Switch.

OPTIONAL STEP

make -j$(nproc) # To build using all cores