# Sonic Mania Decompilation: rebuilding the 2017 game from C source

> This repository is a complete decompilation of Sonic Mania, reconstructed in C and built with CMake across Windows, Linux, Switch and Android. It will not run without assets from an official release, and the README is unambiguous that it exists for study and modding, not as a way to obtain the game.

**RSDKModding/Sonic-Mania-Decompilation** — A complete decompilation of Sonic Mania (2017)

- Repository: https://github.com/RSDKModding/Sonic-Mania-Decompilation
- Stars: 821 · Forks: 201
- Language: C
- License: NOASSERTION
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/rsdkmodding-sonic-mania-decompilation

## The assets come from a purchase, not from this repository

The first thing the README says is that the decompilation will not run without assets from the official releases, and the second is a request to support the official release of Sonic Mania Plus. The purchase links are listed per platform: Windows via Steam and via The Epic Games Store, Switch via the eShop, PS4 via the Store and Xbox One via the Store. The instruction is strict even for people whose platform has no official release, because in that case they must buy it for the assets anyway, and the Netflix Games version is explicitly not supported. That is the shape of the whole project. The source is here, but the art, audio and other assets are not, so the repository is a decompilation with a deliberate dependency on a commercial purchase. The README also asks users not to use the project as a means to pirate the game, and gives the reason it exists at all, saying it was made with love and care for the game it reconstructs, for purely educational purposes and would not exist without the work of Sega, Headcannon and Evening Star.

## Clone it recursively or the build will not work

The build instructions are specific about one thing and it is the thing people get wrong. The README says not to download the source ZIP archive from GitHub, because the archives do not include the submodules required to build the decompilation. Instead you clone the repository recursively:

```bash
git clone --recursive https://github.com/RSDKModding/Sonic-Mania-Decompilation
```

If the repository is already cloned without submodules, the fix is one command inside it:

```bash
git submodule update --init --recursive
```

The repository layout explains why the submodules matter. The top level holds Game, LICENSE.md, README.md, a dependencies/ directory, a CMakeLists.txt, a SonicMania.sln and a SonicMania.xcodeproj/ directory, the SonicMania/ source tree, a .clang-format file and clang-format-commands.txt, and a switch-icon.jpg. The dependencies/ directory is where the RSDK engine and the third-party libraries live, and it is populated by submodules, which is why the ZIP route is broken rather than merely inconvenient. The Visual Studio solution and the Xcode project at the root tell you the project is expected to be opened in a real IDE as well as built from the command line.

## CMake with two commands, and per-platform dependency chains

Once the dependencies are in place, compiling is described as simple. In the root repository directory:

```bash
cmake -B build
cmake --build build --config release
```

The output location depends on what you built. The Mania build lands somewhere under build/, and if you built with RSDKv5(U) the Mania and RSDK executables are likely in build/dependencies/RSDKv5/. The dependency chain per platform is the part that takes time. On Windows you need Visual Studio Community with the Desktop development with C++ package, plus vcpkg, and the README asks you to run a vcpkg install for libtheora, libogg, glew, glfw3 and sdl2 with the x64-windows-static triplet, then pass the vcpkg toolchain file and target triplet to cmake -B build. On Linux the package lists differ by distribution, with pacman for Arch, apt for Debian and Ubuntu, dnf for Fedora and xbps for Void, each pulling cmake, glew, glfw, libtheora and the usual build tools. Switch uses devKitPro and a Switch.cmake toolchain file. Android follows the RSDK build instructions. The project uses CMake, and the README asks you to enable adding CMake to the system PATH during installation on Windows.

## Flags decide whether you build Plus, whether you build RSDK, and whether mods load

The CMake flags are the real configuration surface, and they are documented as a list. `RETRO_REVISION` takes an integer and defaults to 3, which is RSDKv5U. `RETRO_DISABLE_PLUS` is a boolean defaulting to off, and the README says to build with on when compiling for distribution. `RETRO_MOD_LOADER` enables or disables the mod loader and defaults to on, and `RETRO_MOD_LOADER_VER` sets the mod loader version manually, defaulting to the current latest. `RETRO_SUBSYSTEM` changes the subsystem RSDKv5 is built for, defaults to the most standard one for the platform, and the README marks it with a note to only change it if you know what you are doing. The Sonic Mania flags sit alongside. `WITH_RSDK` decides whether RSDKv5 is built alongside the game and defaults to on, `GAME_STATIC` decides whether Mania is built into the resulting RSDKv5 executable with defaults that change depending on the system, and `MANIA_FIRST_RELEASE` switches to the first console release of Sonic Mania and defaults to off. Flags are passed as -D[flag-name]=[value] appended to the cmake -B build command.

## The mod loader is the reason this fork exists

The Additional Tweaks section explains what this particular decompilation adds over a plain reconstruction of the shipped game. First, a built-in mod loader and API calls to enable a much smoother modding experience. Second, support for targeting RSDKv5U rather than standalone RSDKv5, which is the newer engine revision. Third, support for building almost all released versions of the game, listing 1.00 for the initial console release, 1.03 for the initial PC release and 1.06 for the Plus update. This is the part that makes the repository more than a static decompilation. A mod loader built into the executable means a mod does not have to patch the binary or hook functions at runtime, which is the difference between a modding scene that works and one that breaks every time the game updates. It also explains why the project still moves: the mod loader and its API have to track whatever the engine is doing.

## Save transfer is a file copy, and the repo is not archived

Two practical notes close out the README. On saves, if you want to transfer your save from the official PC versions you can just copy your savedata into the folder containing the decompilation, which is a far friendlier answer than the reverse-engineered-save-conversion projects usually give. On the repository itself, it is not archived and the last push was on 2026-09-21, so it is still receiving work. The release history shows v1.0.0-win on 2022-08-15, v1.1.0 labelled The SHC2024 Update on 2024-09-08, and v1.1.1 on 2025-11-01. The gap between the first and second of those is over two years and the version numbers barely moved, so the numbering understates how much changed. The licence is a custom one that GitHub cannot classify, with the terms in LICENSE.md at the repository root, and for a project built from Sega, Headcannon and Evening Star work that file is the thing to read before redistributing anything built from it.

## Conclusion

Adopt this repository if you want to study a shipped game as reconstructed source, build a mod against it, or use the RSDKv5 engine it embeds. Do not adopt it as a way to obtain Sonic Mania without owning it, because the project requires assets from an official purchase and states plainly that it must not be used for piracy. Before you commit, read the Additional Tweaks and RSDKv5 flags sections, confirm you have a supported official release for the assets, and check the CMake flags for your target because the default build is not the one you want for distribution.

## FAQ

### What is the Sonic Mania Decompilation repository?

It is a complete decompilation of Sonic Mania from 2017, reconstructed in C and built with CMake. The project will not run without assets from an official release of the game, and the README asks users not to use it as a means to pirate the game.

### How do I get the source code for Sonic Mania Decompilation?

Clone it recursively with git clone --recursive https://github.com/RSDKModding/Sonic-Mania-Decompilation. The README says not to download the GitHub ZIP archive, because the archives do not include the submodules required to build, and to run git submodule update --init --recursive in an existing clone.

### How do I compile the Sonic Mania Decompilation?

From the repository root, run cmake -B build and then cmake --build build --config release. The README also documents dependency installation per platform, including vcpkg on Windows, distribution package managers on Linux, and devKitPro for Switch.

### What CMake flags does Sonic Mania Decompilation support?

The RSDKv5 flags are RETRO_REVISION, RETRO_DISABLE_PLUS, RETRO_MOD_LOADER, RETRO_MOD_LOADER_VER and RETRO_SUBSYSTEM, and the Sonic Mania flags include WITH_RSDK, GAME_STATIC and MANIA_FIRST_RELEASE. Each takes a value passed with -D[flag-name]=[value] on the cmake -B build command.

## Sources

- [Issues](https://github.com/RSDKModding/Sonic-Mania-Decompilation/issues)
- [README](https://github.com/RSDKModding/Sonic-Mania-Decompilation/blob/master/README.md)
- [Releases](https://github.com/RSDKModding/Sonic-Mania-Decompilation/releases)
- [RSDKModding/Sonic-Mania-Decompilation on GitHub](https://github.com/RSDKModding/Sonic-Mania-Decompilation)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/rsdkmodding-sonic-mania-decompilation
