HeroesRecomp

X: @HeroesRecomp

Requirements · Features · Controls · FAQ · Known Issues · Building · Credits

## Claude AI usage This recompilation isn't meant to be the definitive Sonic Heroes static recompilation. I mainly made it for myself, to play and have fun with. Once a non-AI recompilation is made and published, I'll link it here, in hopes that people who end up here will go and use that one instead. ## Clarifications - **No generative AI art:** none of the graphics were generated by AI. Everything visual, except for the placeholder menus, was made by me with free tools such as Photopea. - **Not a "Claude, make it better, make no mistakes" repository:** Claude wrote most of the code, but that doesn't mean I have no experience with code, graphics interpreters, memory addresses, graphics stacks and so on. - **Everything is tested:** menus, features, bug fixes, all of it. ## Why? Mainly so people can have fun, experiment, or use it as inspiration and as a guide to how this works when creating a non-AI one. --- **HeroesRecomp** is an unofficial native Windows port of **Sonic Heroes** (GameCube, NTSC-U `G9SE8P`). It is built by static recompilation, not emulation. All of the game's PowerPC code (`main.dol` plus its 18 REL modules) is translated to C++ ahead of time and compiled to x64. It runs on a reimplemented GameCube runtime, with GX graphics drawn through WebGPU (Direct3D 12 / Vulkan). There is no interpreter and no JIT. > [!IMPORTANT] > **No game assets are included.** You need your own legally obtained copy of the game. On first launch, the built-in installer reads your disc image and exports it next to the executable. ## Minimum System Requirements | | | |---|---| | **OS** | Windows 10 / 11, 64-bit | | **CPU** | x86-64 with AVX2 | | **GPU** | Direct3D 12 capable | | **Storage** | ~1.5 GB (exported game data plus the executable) | | **Game** | Sonic Heroes, GameCube NTSC-U (`G9SE8P`): ISO, RVZ, CISO, GCM, GCZ, WIA or nkit.iso | ## Features ### Installer - Launcher shown on first run. It asks for your disc image, checks that it is `G9SE8P`, and exports it to `game/` with a progress bar. - Verifies `main.dol` and every REL by SHA-1 before starting the game. - Available in English, German, French, Spanish and Italian. Supports full screen. ### PC Settings menu - Built into the game's own **Options** screen. Also opens anytime with **F1** or **Select**. - **Display:** internal resolution (native or a multiple of 640×480), MSAA, anisotropic filtering, V-Sync, full screen, window size and frame rate. - **Interface:** HUD filtering, button icon style (GameCube / Xbox / PlayStation), 2D pillarboxing. - **Sound:** per-category volumes. - **Language:** game language (written to the console's SRAM, as the game expects). - **Mods:** turn each installed mod on or off. A warning appears when a change needs a restart. ### Widescreen - True 16:9 with a wider horizontal field of view (Hor+). The 4:3 original is also available. - The HUD keeps its proportions and is anchored to the screen edges. Videos and 2D menus can stay 4:3. ### Mod support - **Dolphin texture packs** (`tex1_…` DDS/PNG). They load at startup and can be toggled live. - **Disc file replacements** (a `files/` folder or disc-relative paths). - **Gecko codes** from Dolphin `.ini` files. Codes that write data work. Codes that patch the game's machine code cannot apply, because that code is recompiled. - One folder per mod in `mods/`, extracted exactly as downloaded. ### Other improvements - Emulated memory card (`saves/MemoryCardA.raw`), written in the background so saving never stutters. - High-level emulation of the DSP's AX audio microcode (ADPCM / PCM, envelopes, looping, stereo mix). - Keyboard and controller support (SDL3). ## Controls | Action | Keyboard | Controller | |---|---|---| | Move | `W` `A` `S` `D` | Left stick | | A / B / X / Y | `J` / `K` / `U` / `I` | Face buttons | | Z / L / R | `Q` / `E` / `R` | Triggers / shoulders | | Start | `Enter` | Start | | PC Settings | `F1` | Select / Back | | Full screen | `F11` or `Alt` + `Enter` | | ## FAQ ### Where can I get the game? Dump your own GameCube disc. Download links are not provided here and must not be posted in this repository. ### Which versions are supported? Only the GameCube NTSC-U release (`G9SE8P`). The PAL, Xbox, PS2 and PC versions are different builds and will not work. ### Where are my settings and saves? Next to the executable: - `SonicHeroes.ini`: settings - `saves/`: memory card - `SonicHeroes.log`: log Shader caches go to `%APPDATA%\Sonic Heroes\`. ### The first time I enter a menu or stage it pauses for a moment. Graphics pipelines are compiled the first time they are needed. The last frame is held while that happens, and later runs load them from the cache. ### Why don't some mods work? Mods that replace `main.dol` or `.rel` files, or Gecko codes that insert assembly, change machine code. That code is recompiled ahead of time, so these mods cannot apply. The log says which ones were skipped. ### How do I report a bug? Open an issue. Say where and when it happened, and attach `SonicHeroes.log`. ## Known Issues - Stage results screen in `16:9`: a thin seam can show where the two halves of a panel meet. - HUD problems on `16:9`: some HUD elements are misplaced or stretched. Working on those actively. - Graphics pipeline caches while playing, causing stutters and fps drops. - Check the issue tracker before reporting a new bug. ## Building ### Prerequisites - Visual Studio 2022 with **Desktop development with C++**, including clang-cl. CMake and Ninja come bundled with it. - Python 3, used by `tools/make_pak.py`. - Your own Sonic Heroes disc image (`G9SE8P`). ### Steps ```bat :: 1. SDL3 source, used by the platform layer git clone --depth 1 --branch release-3.4.4 https://github.com/libsdl-org/SDL lib/SDL :: 2. Configure and build the tools tools\configure.cmd tools\build.cmd heroesrecomp shexport :: 3. Export your disc and recompile its code into ppc\ (generated locally, never committed) build\main\bin\shexport.exe "path\to\Sonic Heroes.rvz" game build\main\bin\heroesrecomp.exe game\sys\main.dol config\G9SE8P.map ppc config\recomp.ini :: 4. Build the game tools\configure.cmd tools\build.cmd SonicHeroes ``` Run `build\main\bin\SonicHeroes.exe`. `tools\package.ps1` produces a release folder and zip in `dist\`. ## Credits ### HeroesRecomp - **Reyes-gh**: creator, project lead, art and testing. ### Built on - [DolRecomp](https://github.com/ExpansionPak/DolRecomp): GameCube static recompilation tooling that this project grew from. - **GXRuntime**: game-agnostic GameCube runtime (CPU semantics, devices, GX renderer). Vendored and extended in `lib/GXRuntime`. - [Aurora](https://github.com/encounter/aurora): GX to WebGPU rendering layer. - [Dawn](https://dawn.googlesource.com/dawn): WebGPU implementation (Direct3D 12 / Vulkan). - [nod](https://github.com/encounter/nod): disc image reading. - [SDL](https://github.com/libsdl-org/SDL): input, windowing and audio output. ### Special Thanks - [Jovinull/sonicheroes](https://github.com/Jovinull/sonicheroes): Sonic Heroes decompilation, the source of symbol names and module layouts. - [Dolphin](https://github.com/dolphin-emu/dolphin): reference for hardware behavior, texture pack and Gecko formats. - [Unleashed Recompiled](https://github.com/hedge-dev/UnleashedRecomp) and [Shadow Recompiled](https://github.com/FoxWorkshop/ShadowRecomp): inspiration for what a recomp port can be. ## License Licensed under the [GNU GPL v3](LICENSE), as required by the GPL-licensed GXRuntime it is built on. Sonic Heroes and all related characters, names and marks belong to SEGA. This project is not affiliated with or endorsed by SEGA, and it contains no SEGA game code or data.