SR-ZGS

SR-ZGS is a static recompilation of Sonic Riders: Zero Gravity for Windows and Linux that aims for a native PC experience.

README

Sonic Riders: Source Artwork

Sonic Riders: Source

One source. Two riding experiences.
Static recompilation of Sonic Riders (GameCube) and Sonic Riders: Zero Gravity (Wii). Formerly SR-ZGS.

License: GPL v3 Preservation Project Platform Engine Chassis Experimental Static Recompilation GitHub Stars

A modern static recompilation project for Sonic Riders (Nintendo GameCube) and Sonic Riders: Zero Gravity (Nintendo Wii), both played from one launcher, Riders Terminal, with the long-term goal of delivering a high-performance native PC experience on Linux and Windows, with Android support as a future target.

The project uses DolRecomp to generate native code from the original PowerPC game executable and a modified fork of ModernGekko, a Dolphin-derived runtime, to provide the execution environment and GameCube and Wii hardware services. The fork also contains the SR-Source launcher and its Netplay lobby. Both games run the same way, through the same runtime, launcher and settings; Zero Gravity's code was recompiled first, and Sonic Riders' is next (see Performance Notes).

Until 0.1.4 the project was SR-ZGS (Sonic Riders: Zero Gravity Source) and played Zero Gravity alone. From 0.2.0 it is Sonic Riders: Source: see Updating from SR-ZGS.

SR-Source aims to provide a clean, modular architecture that separates recompiled game logic, modding facilities, and hardware-agnostic platform interfaces, progressively reducing its reliance on existing emulation technology.

Current Status: SR-Source is an experimental hybrid static recompilation project. It still relies on ModernGekko for graphics, audio, input and system-level functionality. A fully independent native runtime is a long-term development goal.

Requires your own legally obtained copy of each game you want to play.


Project Status

Current stage: Experimental — Phase 1

  • DolRecomp code generation for the Wii executable.
  • Integration of the generated game module with ModernGekko.
  • PC execution through the ModernGekko runtime.
  • Full game completion successfully tested using ModernGekko's JIT64 CPU core.
  • 60 FPS observed during developer testing using JIT64.
  • StaticRecomp execution path tested.
  • SR-Source launcher with Netplay lobby, music, patch notes and update check (English, Spanish and Japanese).
  • In-game menu with quick settings, the controls, screenshots and visual effects.
  • First public release (0.1.0) for Linux, and for Windows as an experimental build.
  • 0.1.1: fixes from the first reports (Windows window and icon, Direct3D, menu button).
  • 0.1.2: Steam Deck controls, a gamepad that stands in for a missing one, and Netplay help (firewall, logs, same-house play).
  • 0.1.3: a freely adjustable aspect ratio (experimental) and the launcher showing the controller or keyboard in use.
  • 0.1.4: the in-game menu no longer keeps the game paused while a stick is held; the last 0.1 update before 0.2.0.
  • 0.2.0: Sonic Riders: Source. Sonic Riders (GameCube) joins Zero Gravity in one launcher, Riders Terminal: a game selection screen with each game's intro, a loading screen from the launcher to the game, complete saves for both games, three visual effects (Remaster, Anime outline and CRT), 16:9 and 4:3 filling any screen, and a moving PLAY banner.
  • 0.2.1: Netplay's first check of the game files shows its progress on the loading screen and goes on where it stopped, a loading can be stopped (Esc, B or closing the window), and a game no longer stays in the background when the launcher is closed from the Task Manager or crashes.
  • 0.2.2: the launcher opens with SR-Source's icon instead of all at once, a new Netplay lobby with the banner's art, the Netplay host's router opens its port by itself (UPnP) and the lobby says whether friends can reach it, and Netplay errors say why, in a small window of the launcher.
  • Recompiled code for Sonic Riders (GameCube), as Zero Gravity has. Most of its game code lives in _Main.rel, which StaticRecomp doesn't recompile yet: that part runs on the dynamic recompiler.
  • Improve and optimize StaticRecomp execution performance.
  • Independent runtime implementation.
  • Independent graphics and audio systems.
  • Broader hardware and operating system testing.
  • Native modding support.
Performance Notes

The 60 FPS result was achieved with Zero Gravity, using ModernGekko's JIT64 CPU core with MODERNGEKKO_STATICRECOMP=0.

The StaticRecomp CPU core (MODERNGEKKO_STATICRECOMP=1) has also been tested with Zero Gravity, but currently exhibits significantly lower performance on the reference hardware.

Sonic Riders (GameCube) plays the same way, and has been tested with JIT64 during development. It has a recompiled module too, built from source like Zero Gravity's (see Generate the Recompiled Game Code). Most of its game code lives in _Main.rel, a module the game loads as it starts, which StaticRecomp doesn't recompile yet: with StaticRecomp, that part still runs on the dynamic recompiler.

Improving the performance of the StaticRecomp execution path is an ongoing development goal.

These results are specific to the tested hardware and configuration and should not be considered universal performance guarantees.


🐧 Architecture

SR-Source currently consists of three main components:

DolRecomp

Translates the original PowerPC game executable (main.dol) into generated C code that can be compiled for desktop systems.

ModernGekko

Provides the runtime environment that hosts the generated game module.

ModernGekko is based on Dolphin technology and currently provides:

  • Graphics and rendering.
  • Audio services.
  • Controller and input handling.
  • GameCube and Wii system-level functionality.

SR-Source uses a modified fork of ModernGekko: KnivesDevilish/ModernGekko, branch knives/srzgs-launcher, based on the original ExpansionPak/ModernGekko by Hyperway. The external/ModernGekko/ submodule points to this fork. On top of the original runtime, the fork adds:

  • The SR-Source launcher, Riders Terminal, which plays both games (see The SR-Source Launcher).
  • The game selection screen, with each game's intro, and the loading screen between the launcher and the game (see Game selection screen).
  • The Netplay lobby with invite codes (see Netplay).
  • GameCube controller profiles written for SR-Source, with a controller tester.
  • The in-game menu, visual effects and high-resolution screenshots (see In-game menu).
  • Mods that replace or add the games' files, texture packs and data patches, without touching your copy, turned on from the launcher (see Mods).
  • Small runtime adjustments, such as hiding the runtime's on-screen messages and skipping redundant checks of the game files at startup.

Like the original, the fork is licensed under the GNU GPL v3.

SR-Source integration

The project's own code connects the generated module to ModernGekko.

Current source components:

  • src/recompiled/: Generated code produced by DolRecomp (from Zero Gravity's main.dol).
  • src/core/: Project-specific hooks and replacements.
  • src/platform/: Module staging, runtime configuration and launch integration.
  • tools/: Build scripts and recompilation configuration.
  • external/ModernGekko/: ModernGekko submodule.
  • game_assets/: Extracted game files (not distributed).

The project does not yet provide its own independent renderer, audio backend or Wii system implementation.


⚙️ Prerequisites & Setup

Requirements
  • Compiler: C11-compatible C compiler and C++23-compatible C++ compiler (required by ModernGekko). The main SR-Source module uses C++20.
  • Build System: CMake 3.22+ and Ninja.
  • Additional Tools: Git and pkg-config.
  • Recompilation Tools: DolRecomp and the SR-Source fork of ModernGekko (based on ExpansionPak/ModernGekko).
    • Both come with the external/ModernGekko/ submodule: DolRecomp is built from the revision ModernGekko pins, so nothing has to be downloaded separately.
  • Game Assets: Legally obtained NTSC-U copies of the games you want to play: Sonic Riders: Zero Gravity (Wii, Game ID: RS9E8P) and Sonic Riders (GameCube, Game ID: GXEE8P). Building the recompiled code needs Zero Gravity's extracted game files.

📝 Key Goals & Features

The long-term objective is to make SR-Source progressively more independent from its current runtime.

Potential development areas include:

  • Investigating and progressively replacing runtime-dependent Wii services.
  • Developing independent graphics and audio implementations.
  • Improving compatibility across different PC hardware.
  • Expanding configuration and customization options.
  • Exploring native modding capabilities.

These are development goals, not features currently promised or available.


📁 Repository Structure

The repository is organized as follows:

SR-Source/
├── database/
├── docs/                      # Launcher art, music, patch notes, complete saves and test notes
│   ├── banner/                # The PLAY banner in layers, and its layout.txt
│   └── game-select/           # The game selection screen: layers, sounds, font and layout.txt
├── external/
│   └── ModernGekko/           # SR-Source fork of the Dolphin-derived runtime (submodule)
├── game_assets/               # User-provided game files (not distributed)
├── mods/                      # Reserved for the project's own mods (players' mods go in the user directory)
├── src/
│   ├── recompiled/            # DolRecomp-generated game code
│   ├── core/                  # Optional project-specific hooks and replacements (disabled by default).
│   └── platform/              # Runtime staging and launch integration
├── tools/
│   ├── dolrecomp/
│   ├── build_tools.sh
│   └── package_release.sh     # Packs a release build (see Making a Release)
├── .github/workflows/         # release.yml: Linux and Windows release builds
├── CMakeLists.txt
├── CMakePresets.json
└── LICENSE

💻 Platform Status

SR-Source is currently in an experimental development stage.

  • Linux: Current development and testing platform. Tested on Bazzite Linux with Wayland.
  • Windows: Each release includes a Windows build, made by GitHub Actions. The first reports say it runs well; it is still marked experimental until it gets more testing, so reports are very welcome. If Vulkan doesn't start on your PC, choose Direct3D 11 in Settings.
  • Steam Deck: Add SR-Source (SR-Source from the Linux download) as a non-Steam game. The Steam button never reaches the game, so open the in-game menu with ⧉ (View). Since 0.1.2 the game reads the Deck's own controls when it doesn't find the controller the launcher chose: Steam shows them to the launcher and to the game under different names.
  • Android: Long-term development target. No working Android build is currently provided.

For detailed hardware specifications, graphics settings, CPU execution modes and performance results, see TESTING.md.

This is an observed test result, not a universal performance guarantee. Actual performance may vary depending on hardware, runtime configuration and future changes.


📦 Downloading a Release

Ready-to-play builds are on the Releases page. They contain the launcher and the runtime, never the games: you still need your own copy of each game as an ISO, WBFS or RVZ image (a GameCube .gcm dump is an ISO: rename it to .iso). See Required Game Copy.

Linux (SR-Source-<version>-linux-x86_64.tar.gz):

tar -xzf SR-Source-0.2.0-linux-x86_64.tar.gz
cd SR-Source-0.2.0-linux-x86_64
./SR-Source

It is built on Ubuntu 24.04, so it needs a distribution at least that recent (glibc 2.39 or newer), a graphics driver with Vulkan or OpenGL, and PulseAudio or PipeWire for the sound.

Windows (SR-Source-<version>-windows-x64.zip, experimental): extract the whole zip to a folder of its own and open SR-Source.exe. It needs 64-bit Windows 10 or 11. The programs aren't signed, so Windows SmartScreen may warn the first time: choose More info → Run anyway.

In both, keep the folder's files together (the launcher starts moderngekko-run beside it). The first time, open Game Files, choose your disc image and press Extract Game, once for each game you have; then press LAUNCH on the PLAY page and choose the game. Settings, saves, screenshots and logs go to the SR-Source user directory: ~/.local/share/sr-source on Linux, %LOCALAPPDATA%\sr-source on Windows. Each package has a .sha256 file to check the download.

The downloads play with the JIT64 CPU core. StaticRecomp needs the recompiled game module, which is made from your own copy of the game's code and therefore isn't distributed: build SR-Source from source to try it with Zero Gravity (see Building & Getting Started).

Updating from SR-ZGS (0.1.x)

SR-ZGS became Sonic Riders: Source in 0.2.0. Download the new release into a folder of its own; nothing has to be copied by hand:

  • Your settings, saves, screenshots and extracted game move by themselves from the old user directory (~/.local/share/sr-zgs, %LOCALAPPDATA%\sr-zgs) to the new one (sr-source) the first time you open SR-Source. If the old folder can't be moved, SR-Source uses it where it is. The old program folder can be deleted afterwards.

  • Windows: the launcher is now SR-Source.exe. The firewall asks again the first time you host Netplay from the new folder, as with every new release folder: allow it as before (see If your friends can't connect).

  • Steam and Steam Deck: a non-Steam shortcut to SR-ZGS keeps opening the old version. Add SR-Source again, or change the shortcut's target to it.

  • The repository moved from KnivesDevilish/SR-ZGS to KnivesDevilish/SR-Source; GitHub sends the old links to the new place, and the 0.1.x launchers' update check still finds the new releases. In a clone made before, point it at the new address:

    git remote set-url origin https://github.com/KnivesDevilish/SR-Source.git
    

🚧 Game Asset Setup

SR-Source does not distribute copyrighted game executables or assets. You must provide your own legally obtained copy of each game you want to play.

Required Game Copy
GamePlatformReleaseGame ID
Sonic Riders: Zero GravityNintendo WiiNTSC-URS9E8P
Sonic RidersNintendo GameCubeNTSC-UGXEE8P
  • A clean, unmodified disc dump is recommended.
  • One game is enough: the launcher greys out the one you don't have.
  • Other releases (PAL, Japanese) and other platforms (PS2, Xbox, PC) aren't supported.
Extracting Game Files

This is for building from source: the recompiled code is made from Zero Gravity's files in game_assets/. To play, the launcher extracts the games itself (see Extracting with the Launcher).

  1. Extract the contents of your Wii disc image using a suitable tool, such as Dolphin Emulator, Wiimm's ISO Tools or CleanRip.
  2. Place the extracted game directory inside game_assets/.
  3. Preserve the original directory structure.

The expected directory layout is:

game_assets/
├── sys/
│   ├── main.dol
│   └── boot.bin
└── files/

The build configuration expects the extracted game root to contain both sys/ and files/.

Note

This repository does not provide or distribute any copyrighted game binaries or assets. You must extract the required game files from your own legally obtained copy, including main.dol and the required game data directories, to build and run SR-Source.

Extracting with the Launcher

The launcher's Game Files page can also extract the games. Select your disc image and press Extract Game: the launcher checks which game the disc is (RS9E8P or GXEE8P) and extracts it once into the SR-Source user directory (~/.local/share/sr-source/games/<Game ID> on Linux, %LOCALAPPDATA%\sr-source\games\<Game ID> on Windows), where it is reused every time you play. INSTALLED GAMES shows which ones are ready.

Complete save: the Game Files page can also install, for each game, a save with the whole game completed at 100%, everything unlocked. Play once first, until the game makes its own save; then press Install complete save. Your save is copied first to SaveBackups/<Game ID>/ in the user directory, and Restore my save brings it back. The complete saves are in docs/complete-save/, with only the games' save data:

  • Zero Gravity: 0_Games.sav, without the save's banner.bin, which holds the game's own icon and banner; your game's save keeps the one it made.
  • Sonic Riders: GXEE8P/8P-GXEE-SONICRIDERS_GAMEDATA_01.gci, the save on the GameCube memory card (GC/USA/Card A in the user directory), with its picture and icon left blank, since they are the game's own art; the launcher puts in the ones of your own save. Restoring touches that save alone: the other saves on the card stay as they are.

Building the recompiled code (step 3 below) reads main.dol from game_assets/ by default. If you already extracted the game with the launcher, you can point the build at that copy instead of extracting it twice:

ASSETS_DIR="$HOME/.local/share/sr-source/games/RS9E8P" bash tools/dolrecomp/recompile.sh
cmake --preset quick -DSRZGS_GAME_ROOT="$HOME/.local/share/sr-source/games/RS9E8P"

bash tools/preflight.sh "$HOME/.local/share/sr-source/games/RS9E8P" checks that a folder has the expected layout and the same main.dol as the recompiled code.


🚀 Building & Getting Started

Prerequisites

SR-Source requires the following tools:

  • Git
  • CMake 3.22 or newer
  • Ninja
  • A C/C++ compiler
  • pkg-config

Make sure these dependencies are installed in the environment where you intend to build the project.

On Linux, tools/build_tools.sh --chassis checks the system libraries the runtime and the launcher need before it starts the long build, and prints the install command for Ubuntu/Debian and Fedora when something is missing. The launcher's music plays through PulseAudio (PipeWire's PulseAudio support w