# SonicColorsRecomp ## [WHILE THIS RECOMP IS AI ASSISTED (especially on the github presentation) YOU CAN BE ASSURED ALL CODE RELATED TO THIS PROJECT IS THOUROUGHLY CHECKED OVER BY A HUMAN, NO AI SLOP ALLOWED 🫡] Native **Linux and Windows** static recompilation of **Sonic Colors (Wii)** — PAL `SNCP8P` revision 00. You must own the game. No disc image or assets are shipped in this repository or in published builds. [![Get it on RecompLauncher](https://recomplauncher.com/badge/get-it-on-recomplauncher.svg)](https://recomplauncher.com) ## Known Issues | Issue | State | |---|---| | Ridiculous input latency when using Xbox controllers on Windows | fixed in v0.4.0 (freshness); I1 adds short-tap edge latch — see `docs/I1_WINDOWS_INPUT_RELIABILITY_AND_LATENCY.md` | | Degraded performance the longer you play | fix in progress | | Degraded performance in general | fix in progress | | Playing at higher than 30fps introduces some physics issues in certain stages | fix in progress | | Stomping repeatedly in certain portions of specific stages causes a black screen (can be temporarily fixed by restarting the stage) | fix not started | | Some laser diamonds can put the player in an infinite loop when laser is used on them (example, end of Tropical resort act 5) | fix not started | ## How to play 1. Own **Sonic Colors (Wii) Europe / PAL** — disc ID `SNCP8P` (ISO, RVZ, WIA, WBFS, or GCZ). 2. Install a build from [Releases](https://github.com/VoltTMC/SonicColorsRecomp/releases), or use [RecompLauncher](https://recomplauncher.com) (Easy Setup picks your disc and extracts game data). 3. Or run the built-in launcher and choose **Install from disc image…**. ## Play a build (no compile) Download a package from [Releases](https://github.com/VoltTMC/SonicColorsRecomp/releases) when available: | Platform | What to run | |---|---| | Linux | `chmod +x SonicColorsRecomp-*-linux-x86_64.AppImage` then run it | | Windows | Run `SonicColorsRecomp-Setup-v*.exe` (Start Menu). Optional portable ZIP also available. | The launcher installs from **your own** disc image (ISO / RVZ / WIA / WBFS). Do not redistribute game files. Useful flags: `--help`, `--version`, `--portable`, `--check-updates`, `--download-update`, `--save-diagnostics`, `--list-gamepads`, `--input-i1`, `--input-latency`, `--verify-data`, `--prepare --game `. If the game goes black after a graphics driver update, try System → Clear shader cache. Precompiled shaders (A3w/A3z): the packaged portable DXBC cache under `shadercache/` loads **automatically** at startup (no flags). `--precompile-shaders` is for building/updating that cache. Diagnostics: `--no-shader-preload`. See [`docs/A3W_OFFLINE_SHADER_PRECOMPILATION.md`](docs/A3W_OFFLINE_SHADER_PRECOMPILATION.md). Device Vulkan/DXVK pipeline caches are **not** universal. Performance (A4a): on weak integrated GPUs, default `internal_scale=3` is often GPU-bound (~37 unique frames/s measured on Radeon 610M / RADV). Prefer scale 1–2 for 60-class play. Profile with `--perf` and optional `SCR_FRAME_PROFILE=1`. Clean GPU runners: `tools/run_nvidia_clean.sh`, `tools/run_amd_clean.sh`. See [`docs/A4A_PERFORMANCE_INVESTIGATION.md`](docs/A4A_PERFORMANCE_INVESTIGATION.md). Vulkan (A4b–A5g): Stage A smoke (`--list-vulkan-devices`, `--vk-smoke`); opt-in GX via `--renderer=vulkan` / `SCR_RENDERER=vulkan`. A4e TEV; A4f EFB→texture + mips; A4g TR1 entry + XF ring; A4h outdoor orientation (EFB-copy Y); A4i sky RCA; A4j **CW front-face cull**; A4k TR1 visual audit; A4l **GPU-ordered inline EFB copies**; A4m **frame-pipeline profiling + XF dedup**; A4n **0x680 XF payload** + dynamic UBO (desc cache / present chain opt-in); A5a–A5e **native front-end** + opt-in direct XF (`SCR_A5A_DIRECT`), BP-nop/`SCR_A5B_PROF`, TEV/blend/Z (`SCR_A5C_DIRECT_BP`), hot IND/SU/TX_INVAL + KSEL (`SCR_A5D_DIRECT_HOT` / `SCR_A5D_DIRECT_KSEL`), texture-object TX BP (`SCR_A5E_DIRECT_TEXOBJ`); A5f **deferred derived BP** (`SCR_A5F_DEFERRED_BP`, default off); A5g **indexed XF Pos/Nrm** (`SCR_A5G_DIRECT_INDEXED_XF`, default off); A5h **idx XF playback** (`SCR_A5H_INDEXED_XF_PLAYBACK`, default off; `SCR_A5H_DIRECT_INDEXED_XF_EXT` reserved, no `0x30`/`0x38` adapters); A5i **idx XF apply** (`SCR_A5I_INDEXED_XF_APPLY`, default off — identical dirty skip / bulk BE); A5j **idx XF dispatch** (`SCR_A5J_INDEXED_XF_DISPATCH`, default off — consecutive decode / batched notes); A5k **idx XF flush opt** (`SCR_A5K_INDEXED_XF_FLUSH_OPT`, default off — Vulkan tex-decode skip on cache hit; mandatory geometry drain retained); A5l **Vulkan draw opt** (`SCR_A5L_VULKAN_DRAW_OPT`, default off — sticky in-CB descriptor reuse + bind skip); A5m **geometry stream opt** (`SCR_A5M_VULKAN_GEOMETRY_STREAM_OPT`, default off — larger VB/IB rings + geom-only mid-frame reclaim); A5n **XF upload opt** (`SCR_A5N_VULKAN_XF_UPLOAD_OPT`, default off — dirty-range exact compare + single post-copy hash; A4n full-slot bind retained). Full pixel/FPS parity **not** claimed. D3D11 remains default/reference. Prefer `tools/run_nvidia_clean.sh` + `SCR_VK_DEVICE=3080`; validation: `tools/run_nvidia_vk_validation.sh`. Docs: [`A5G_NATIVE_INDEXED_XF_ADAPTERS.md`](docs/A5G_NATIVE_INDEXED_XF_ADAPTERS.md), [`A5F_DEFERRED_BP_STATE_PROPAGATION.md`](docs/A5F_DEFERRED_BP_STATE_PROPAGATION.md), [`A5E_NATIVE_TEXTURE_OBJECT_ADAPTERS.md`](docs/A5E_NATIVE_TEXTURE_OBJECT_ADAPTERS.md), [`A5D_NATIVE_BP_HOT_PATH_OPTIMISATION.md`](docs/A5D_NATIVE_BP_HOT_PATH_OPTIMISATION.md), [`A5C_NATIVE_BP_SHADOW_AND_SDK_ADAPTERS.md`](docs/A5C_NATIVE_BP_SHADOW_AND_SDK_ADAPTERS.md), [`A5B_NATIVE_GX_SDK_ADAPTERS_AND_DECODE.md`](docs/A5B_NATIVE_GX_SDK_ADAPTERS_AND_DECODE.md), [`A5A_NATIVE_GRAPHICS_FRONTEND.md`](docs/A5A_NATIVE_GRAPHICS_FRONTEND.md), [`A4N_VULKAN_DRAW_STATE_AND_SUBMISSION_OPTIMISATION.md`](docs/A4N_VULKAN_DRAW_STATE_AND_SUBMISSION_OPTIMISATION.md), [`A4M_VULKAN_FRAME_SUBMISSION_AND_THROUGHPUT.md`](docs/A4M_VULKAN_FRAME_SUBMISSION_AND_THROUGHPUT.md), [`A4L_VULKAN_EFB_COPY_SYNCHRONISATION_AND_PERFORMANCE.md`](docs/A4L_VULKAN_EFB_COPY_SYNCHRONISATION_AND_PERFORMANCE.md), [`A4K_TROPICAL_RESORT_VISUAL_SIGNOFF.md`](docs/A4K_TROPICAL_RESORT_VISUAL_SIGNOFF.md), [`A4J_TROPICAL_RESORT_SKY_COVERAGE.md`](docs/A4J_TROPICAL_RESORT_SKY_COVERAGE.md), [`A4I_SKY_BACKGROUND_AND_EFB_ORDERING.md`](docs/A4I_SKY_BACKGROUND_AND_EFB_ORDERING.md), [`A4H_TROPICAL_RESORT_OUTDOOR_PARITY.md`](docs/A4H_TROPICAL_RESORT_OUTDOOR_PARITY.md), [`A4G_TROPICAL_RESORT_VULKAN_PARITY.md`](docs/A4G_TROPICAL_RESORT_VULKAN_PARITY.md), [`A4F_EFB_COPIES_AND_TEXTURE_COMPLETENESS.md`](docs/A4F_EFB_COPIES_AND_TEXTURE_COMPLETENESS.md), [`A4E_GX_TEV_AND_MULTITEXTURE_PARITY.md`](docs/A4E_GX_TEV_AND_MULTITEXTURE_PARITY.md), [`A4D_VULKAN_STABILITY_AND_RADV.md`](docs/A4D_VULKAN_STABILITY_AND_RADV.md) (AMD/RADV deferred), [`A4B_NATIVE_VULKAN_RENDERER.md`](docs/A4B_NATIVE_VULKAN_RENDERER.md), [`A4C_VULKAN_GX_DRAW_PIPELINE.md`](docs/A4C_VULKAN_GX_DRAW_PIPELINE.md). ## Status (2026-11-20) | Area | State | |---|---| | Recompilation | **Done** — Broadway/Gekko → native x86-64 | | Runtime | OS / IOS / GX / AX / WPAD / PAD HLE | | Boot → title → Tropical Resort Act 1 | **Verified** (Linux) | | Windows | Cross-build + Wine smoke; **native** Windows play still checklist-open | | Music Library (launcher) | Catalog, preview, WAV export, file-based replacement prep | | PC polish | Launcher, RecompLauncher Easy Setup, update download + release notes, diagnostics (`--save-diagnostics`), log rotation, crash recovery banner, free-space install check, FPS overlay, save backups — see [`docs/DEVELOPMENT_ROADMAP.md`](docs/DEVELOPMENT_ROADMAP.md) | | Known deferred | H7 black-world after stomp; AP1 opening spiral at 60 Hz; H8 in-game music listen | | Full-game matrix | **Not** claimed — many stages / abilities `NT` | Architecture: [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) · Progress: [`docs/PROGRESS.md`](docs/PROGRESS.md) · Compatibility: [`docs/GAME_COMPATIBILITY.md`](docs/GAME_COMPATIBILITY.md) · Frame rate: [`docs/FRAME_RATE.md`](docs/FRAME_RATE.md) · Performance: [`docs/PERFORMANCE.md`](docs/PERFORMANCE.md) · Shaders: [`docs/A3W_OFFLINE_SHADER_PRECOMPILATION.md`](docs/A3W_OFFLINE_SHADER_PRECOMPILATION.md) · Parity: [`docs/WINDOWS_FEATURE_PARITY.md`](docs/WINDOWS_FEATURE_PARITY.md) · Music: [`docs/MUSIC_MODDING.md`](docs/MUSIC_MODDING.md) · Roadmap: [`docs/DEVELOPMENT_ROADMAP.md`](docs/DEVELOPMENT_ROADMAP.md) ## Foundation Adapted from [BlackKnightRecomp](https://github.com/yunophilia/BlackKnightRecomp) (GPL-2.0-only): PPC→C++ tools and Wii runtime. [DolRecomp](https://github.com/ExpansionPak/DolRecomp) is pinned under `external/` for instruction-coverage cross-checks only. ## Prerequisites - Clang/LLVM, CMake ≥ 3.21, Ninja, Python 3.10+, `wit` (Wiimms ISO Tools) - Runtime link deps: see Black Knight’s Linux list in `external/BlackKnightRecomp/docs/linux.md` (Vulkan, Wayland/X11, audio, bison/flex for vkd3d) - Optional for music tooling: `ffmpeg`, `vgmstream-cli` / cricodecs as documented in `docs/MUSIC_MODDING.md` **CMake note:** Cursor’s AppImage can break stock `cmake` module discovery. Use: ```bash ./scripts/cmake.sh ... ``` ## Quick start ```bash # 1. Extract your disc (if game/SNCP8P is missing) wit EXTRACT "/path/to/Sonic2010 [SNCP8P].iso" --DEST game/SNCP8P/ --overwrite # 2. Configure + build (first run fetches SDL3 / dxvk / vkd3d / nod) ./scripts/cmake.sh --preset linux-clang ./scripts/cmake.sh --build --preset linux-clang # 3. Launch the launcher (Install / locate data → Play) ./out/SonicColorsRecomp ``` ### Launching the launcher The same binary opens the **launcher** by default (omit `--skip-launcher`). | Platform | Command | |---|---| | Linux (dev build) | `./out/SonicColorsRecomp` | | Linux (staged AppDir) | `./dist/AppDir/AppRun` | | Linux (AppImage) | `./SonicColorsRecomp-*.AppImage` | | Windows (dev build) | `out\SonicColorsRecomp.exe` | Windows build presets: `windows-clang` (preferred) or `windows-msvc` (output under `out\`). MSVC builds use `-j 2` and target `SonicColorsRecomp` only by default — full parallel `/Zi` RelWithDebInfo OOMs `cl` (C1002) on the huge `ppc_recomp.*.cpp` TUs. If you still hit C1002, rebuild with `-j 1`. Skip the launcher once data is configured: ```bash # Linux ./out/SonicColorsRecomp --data game/SNCP8P --skip-launcher # Windows out\SonicColorsRecomp.exe --data game\SNCP8P --skip-launcher ``` User data (config, NAND saves, music cache, **movie replacements**): Windows **installer** → `%APPDATA%\SonicColorsRecomp`; Linux AppImage → `$XDG_DATA_HOME/SonicColorsRecomp`; portable ZIP / `--portable` / `SCR_PORTABLE=1` → next to the exe. See [`docs/WINDOWS_INSTALLER.md`](docs/WINDOWS_INSTALLER.md). Cutscene `.sfd` overrides: [`docs/A3Y_MOVIE_REPLACEMENTS.md`](docs/A3Y_MOVIE_REPLACEMENTS.md) (`…/movie/*.sfd`, singular **movie**). ## Music replacement (file-based) Do **not** use host MixInto / AX mute overlays. Workflow: 1. Open **Music Library** in the launcher. 2. Assign WAV replacements; prepare patched CPKs via `tools/music_asset`. 3. Runtime registers overrides with `Disc_RegisterHostOverride`. See [`docs/MUSIC_MODDING.md`](docs/MUSIC_MODDING.md). ## Packaging (test shares / AppImage) **Linux** (this host): ```bash ./scripts/cmake.sh --build --preset linux-clang ./tools/package_linux.sh -S # stage dist/AppDir (no game data) # optional: ./tools/package_linux.sh -A dist/AppDir -c /path/to/shadercache # Shareable test archive (folder + .tar.zst/.tar.gz under dist/): ./tools/package_test_linux.sh ``` **Windows** (cross-build from Linux, or native): ```bash cmake --build --preset windows-mingw --target SonicColorsRecomp music_asset ./tools/package_windows_installer.sh -v 0.3.7 # Setup.exe (primary; Wine+Inno or ISCC) ./tools/package_windows_cross.sh -v 0.3.7 # optional portable ZIP ./tools/package_windows_install_check.sh ``` Native Windows: `tools/package.ps1` still stages a folder; prefer the Inno Setup path above for distribution. Redistributable builds must **not** include `game/` or copyrighted assets. ## Layout ``` tools/ PPC analysis + recomp + music_asset runtime/ Wii OS / GX / AX / IOS / Linux platform + launcher UI generated/ Recompiled SNCP8P C++ (gitignored) game/ Extracted disc data (gitignored) mods/music/ catalog.json (tracked); your tracks/manifest (local) external/ Pinned upstream checkouts docs/ Architecture, progress, compatibility, quality audit out/ Built SonicColorsRecomp + shared libs ``` ## Licence Project runtime/tools derived from BlackKnightRecomp: **GPL-2.0-only** — see `licenses/`. Preserve upstream notices when copying further. Game code/data remain your property and must not be redistributed.