Building the RSDKv4 Decompilation¶
The RSDKv4 Decompilation uses CMake, a versatile building system that supports many different compilers and platforms.
Read before proceeding¶
This guide requires basic knowledge of how to use the appropriate terminal for your OS, such as Command Prompt for Windows. If you aren't familiar with doing basic actions with terminals, such as opening one in specific directories, look up a tutorial online.
In addition, refer to these warnings depending on the platform you are compiling for:
Warning
Make sure to use Command Prompt when typing commands instead of PowerShell, as PowerShell is known to cause issues.
Notice for Steam Deck users
Due to how SteamOS handles packages, building the decompilation on the Steam Deck is highly difficult and not recommended. Instead, consider building it on another Arch Linux device and using that build on the Steam Deck.
TODO
Get the source code¶
In order to clone the repository, you need to install Git, which you can get here.
Clone the repo recursively, using:
If you've already cloned the repo, run these commands inside of the repository to ensure the clone is up-to-date:
Getting dependencies¶
Install CMake. Make sure to enable the feature to add CMake to the system PATH during the installation.
To handle dependencies, you'll need to install Visual Studio Community with the Desktop development with C++
workload. If you already have Visual Studio installed, you can manage your installed workloads by opening Visual Studio Installer from the Start Menu and clicking the Modify
button next to your Visual Studio installation.
Warning
An installation of Visual Studio with the Desktop development with C++
workload uses around 8 GB of storage space. Make sure you have the necessary space on your drive before proceeding.
You will also need to set up vcpkg. You only need to follow 1 - Set up vcpkg
in the guide.
Tip
It's recommended to clone vcpkg into a short path such as C:/src
to avoid potential file path issues.
Run the following command in the vcpkg repository:
Then, add vcpkg to your environment variables by running the following commands in the vcpkg repository:
Run the following command in the terminal:
Download and install Android Studio.
Download the ZIP archives for libogg and libvorbis from xiph.org, then extract and place the libogg-X.X.X
and libvorbis-X.X.X
folders into RSDKv4-Decompilation/dependencies/android
. Rename the folders libogg
and libvorbis
, respectively.
Download the source code for SDL version 2.28.3, then extract and place the SDL2-2.28.3
folder into RSDKv4-Decompilation/dependencies/android
. Rename the folder SDL
.
Download the binaries for GLEW from glew.sourceforge.net, then extract and place the glew-X.X.X
folder into RSDKv4-Decompilation/dependencies/android
. Rename the folder glew
.
Navigate to RSDKv4-Decompilation/android/app/jni
and delete the src
file in it, then create the symbolic links in the following table in that directory:
Symlink Name | Path |
---|---|
SDL |
Path to RSDKv4-Decompilation/dependencies/android/SDL |
src |
Path to RSDKv4-Decompilation |
How do I make a symbolic link?
You can create a symlink using the appropriate command:
- Windows:
mklink /d "[symlink-name]" "[path]"
(or use Link Shell Extension) - Linux:
ln -s "[path]" "[symlink-name]"
Compiling¶
Enter the following commands in the RSDKv4 decompilation repository directory:
The resulting build will be located somewhere in build/
depending on your system.
You can set build flags by adding -D[flag-name]=[value]
to the end of the first command. For example, to build with RETRO_DISABLE_PLUS
set to on, add -DRETRO_DISABLE_PLUS=on
to the command.
Enter the following commands in the RSDKv4 decompilation repository directory:
The resulting build will be located somewhere in build/
depending on your system.
You can set build flags by adding -D[flag-name]=[value]
to the end of the first command. For example, to build with RETRO_DISABLE_PLUS
set to on, add -DRETRO_DISABLE_PLUS=on
to the command.
TODO: Be more descriptive
Open RSDKv4-Decompilation/android/
in Android Studio, install the NDK and everything else that it asks for, and build.
Build Flags¶
Warning
These build flags modify certain aspects of the decomp; only use these if you know what you're doing!
Flag | Description | Value Type | Default Value |
---|---|---|---|
RETRO_REVISION | The RSDKv4 revision to compile. Datapacks for certain versions of Sonic 1/2 only work on older revisions. | Integer (See Revisions) | 3 |
RETRO_DISABLE_PLUS | Disables access to content from Sonic Origins's Plus Expansion Pack. Any publicly distributed builds must have this flag enabled. | Boolean | off |
RETRO_FORCE_CASE_INSENSITIVE | Forces case insensivity when loading files. | Boolean | off |
RETRO_MOD_LOADER | Enables the ability the load mods and certain features related to them. | Boolean | on |
RETRO_NETWORKING | Enables networking features used for Sonic 2's 2P VS mode. | Boolean | on |
RETRO_USE_HW_RENDER | Enables the Hardware Renderer used for native menus and objects. The main menu, pause menu, and touch controls will not be visible if this is disabled. | Boolean | on |
RETRO_SDL_VERSION | Switches between using SDL 1.2 or SDL 2. | Integer (1 or 2 ) |
2 |
Revisions¶
Flag Value | Revision |
---|---|
0 | REV00 (Initial Sonic 1 Release) |
1 | REV01 (Initial Sonic 2 Release) |
2 | REV02 (Sega Forever) |
3 | REV03 (RSDKv5U Legacy v4 Mode) |