Skip to content

Development

new-coke edited this page Nov 9, 2026 · 3 revisions

Clone the repository and run everything below from its 'smstrikers-port' folder. On Windows, run the scripts from Git Bash.

Requirements

  • clang, except for the Switch.
  • CMake 3.25 or newer, Ninja, Python 3 and Git.
  • Optional: Qt 6.4 or newer, for the settings app.

Windows

  1. Install Visual Studio 2022 or its Build Tools, with the Desktop development with C++ workload.
  2. Install LLVM, CMake, Ninja, Python 3 (as 'python3'), Git for Windows and 7-Zip, and put them all on 'PATH'.
  3. Optional: install Qt 6.8 for MSVC 2022 64-bit with the Qt online installer.

macOS

  1. Install the Xcode Command Line Tools:

     xcode-select --install
    
  2. Install the rest with Homebrew:

     brew install cmake ninja qt
    

Linux and Steam Deck

  1. On Ubuntu or Debian, run './tools/install-linux-deps.sh'. On other distributions, install the equivalents of its package list.
  2. Optional: install 'qt6-base-dev'. Ubuntu 22.04's is too old.

Building

./tools/configure.sh build Release
./tools/rebuild.sh build

Always build with 'rebuild.sh'; 'cmake --build' alone fails at the link on Linux and Windows. For a debug build, pass another folder and 'Debug' to 'configure.sh', then that folder to 'rebuild.sh'.

Running from a checkout

  1. Extract a plain ISO/GCM disc image into 'data', in a folder named for its disc ID:

     ./tools/extract-disc.py "Super Mario Strikers (USA).iso" data/G4QE01
    
  2. Run 'build/strikers' ('build/strikers.exe' on Windows).

To use another disc, set 'STRIKERS_DATA' to its extracted 'files' folder or to the image:

STRIKERS_DATA="../Super Mario Strikers (USA).iso" ./build/strikers

The game reads 'strikers.ini' from beside the executable or the current folder, or the file 'STRIKERS_CONFIG' names. Every key is also an environment variable that overrides the file: 'fps_limit' is 'STRIKERS_FPS_LIMIT'.

The settings app

cmake -S settings -B build-settings -DCMAKE_PREFIX_PATH=<Qt folder>
cmake --build build-settings

'' is your Qt installation, such as 'C:/Qt/6.8.3/msvc2022_64'. To use the app with the game, package them.

Packaging

./tools/package.sh build <name>

This writes 'dist/' and its archive, with the licence texts in 'licenses'. Set 'QT_PREFIX' to your Qt folder ('/usr' on Linux; macOS finds Homebrew's), or 'SETTINGS=0' to leave the settings app out.

To distribute a Linux archive, build the game in an 'ubuntu:22.04' container and set 'STRIKERS_MAX_GLIBC=2.35'. '.github/workflows/release.yml' has the steps.

For an AppImage, run this on Debian or Ubuntu with 'debian-archive-keyring' installed, on the archive's architecture. It downloads Debian 12's Qt for the settings app.

./tools/appimage.sh dist/<name>.tar.gz dist/<name>.AppImage

Nintendo Switch

You need Docker and an arm64 host, such as an Apple silicon Mac.

  1. Build the Vulkan driver and start the devkitPro container:

     . tools/switch/deps.env
     ./tools/switch/build-nvk.sh
     docker run -it --rm -v "$PWD:$PWD" -w "$PWD" "$DEVKITPRO_IMAGE" bash
    
  2. Inside the container, build and package:

     apt-get update && apt-get install -y --no-install-recommends cmake ninja-build python3 git curl xz-utils zip make llvm
     ./tools/fetch-switch-deps.sh
     CMAKE_TOOLCHAIN_FILE=$PWD/tools/toolchain-switch.cmake ./tools/configure.sh build-switch Release
     ./tools/switch/rebuild.sh build-switch
     ./tools/switch/package.sh build-switch strikers-switch
    

    On a Linux host, 'chown -R' the new files back from root.

  3. Copy 'build-switch/strikers.nro' to 'switch/strikers/' on the SD card, or press Y in the homebrew menu and run 'nxlink -s build-switch/strikers.nro'. Start the homebrew menu in title mode, as Nintendo Switch describes.

Debugging

F1 opens the debug menu.

Variable Effect
'STRIKERS_LOG' '1' writes 'strikers-log.txt' beside the executable, a path writes there, and 'console' prints to the terminal.
'STRIKERS_LOG_SCENES=1' Logs every screen entered and package loaded.
'STRIKERS_AUDIO=0' Turns the sound off.
'STRIKERS_CAPTURE=<file.ppm>' Saves frame 120, or 'STRIKERS_CAPTURE_FRAME', as an image. 'STRIKERS_CAPTURE_EXIT=1' quits after it.
'STRIKERS_RECORD_INPUT=' Records the first controller. 'STRIKERS_REPLAY_INPUT=' plays it back.
'STRIKERS_SEED=', 'STRIKERS_FIXED_DT=1' Make a replay repeat exactly.
'STRIKERS_AUTOPRESS=A@200,START@400' Presses buttons on the given frames.
'STRIKERS_USER_DIR', 'STRIKERS_CACHE_DIR' Move saves and bindings, and the shader caches.
'STRIKERS_NO_CRASH_HANDLER=1' Leaves crashes to a debugger or AddressSanitizer.
'STRIKERS_NO_MESSAGEBOX=1' Reports fatal errors in the log only.

For AddressSanitizer, run 'cmake -B build -DSTRIKERS_ASAN=ON' on a configured build folder, then rebuild.

Tests

ctest --test-dir build/tests
ctest --test-dir build-settings

Changing the code

  • 'src/Game', 'src/NL', 'src/ode', 'extern/musyx' and most of 'include' are the game, from the decompilation. Edit them directly, and mark each change with a '// PORT:' comment saying what it compensates for.
  • 'src/platform' and 'include/port' are the port's own code. Format it with clang-format.
  • 'extern/aurora' carries this port's changes to Aurora.

When the build fails

  • '==> LINK FAILED' with nothing under it: 'cmake' isn't on 'PATH'.
  • 'genstubs: refusing to link over ...' after '==> generate stubs': a file failed to compile, two declarations disagree, or a definition is missing. 'tools/genstubs.allow' lists the symbols allowed to become stubs, and 'STRIKERS_ACCEPT_NEW_STUBS=1' links anyway.

Releases

Push a tag starting with 'v' to draft a release with every platform's archive and 'SHA256SUMS'. To build without releasing, run the release workflow from the Actions tab, in a fork too.

Clone this wiki locally