-
Notifications
You must be signed in to change notification settings - Fork 15
Development
Clone the repository and run everything below from its 'smstrikers-port' folder. On Windows, run the scripts from Git Bash.
- clang, except for the Switch.
- CMake 3.25 or newer, Ninja, Python 3 and Git.
- Optional: FFmpeg's libavcodec, for the movies.
- Optional: Qt 6.4 or newer, for the settings app.
- Install Visual Studio 2022 or its Build Tools, with the Desktop development with C++ workload.
- Install LLVM, CMake, Ninja, Python 3 (as 'python3'), Git for Windows and 7-Zip, and put them all on 'PATH'.
- Optional: install Qt 6.8 for MSVC 2022 64-bit with the Qt online installer.
- Optional: for the movies, run './tools/fetch-ffmpeg-windows.sh'.
-
Install the Xcode Command Line Tools:
xcode-select --install -
Install the rest with Homebrew:
brew install cmake ninja qt -
Optional: for the movies, run './tools/build-ffmpeg.sh'.
- On Ubuntu or Debian, run './tools/install-linux-deps.sh'. On other distributions, install the equivalents of its package list.
- Optional: install 'qt6-base-dev'. Ubuntu 22.04's is too old.
- Optional: for the movies, run './tools/build-ffmpeg.sh'.
./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'.
-
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 -
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'.
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.
./tools/package.sh build <name>
This writes 'dist/' and its archive. 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 the archive:
- Build FFmpeg with './tools/build-ffmpeg.sh'. 'package.sh' refuses your Linux distribution's FFmpeg, and Homebrew's is GPL. On Windows, run the script in an MSYS2 shell that has make, diffutils, tar, xz and curl and sees the Windows 'PATH' ('msys2_shell.cmd -msys -use-full-path').
- On Linux, build the game in an 'ubuntu:22.04' container and set 'STRIKERS_MAX_GLIBC=2.35'. '.github/workflows/release.yml' has the steps.
You need Docker and an arm64 host, such as an Apple silicon Mac.
-
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 -
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 ./tools/build-ffmpeg.sh --switch 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-switchOn a Linux host, 'chown -R' the new files back from root.
-
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.
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.
ctest --test-dir build/tests
ctest --test-dir build-settings
- '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.
- '==> 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.
- A 'THP movies' warning while configuring: CMake didn't find FFmpeg, and the movies are left out.
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.