Skip to content

JeffRuLz/Sonic-1-2-2013-Decompilation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sonic the Hedgehog 1 & 2 for New 3DS

This is a fork of Rubberduckycooly's Retro Engine v4 decompilation, ported to the New 3DS.

Requirements

Setup

  1. Create these folders (which I'll refer to as "the game folders") on your SD card: sd:/3ds/Sonic1/ and sd:/3ds/Sonic2/
  2. Place your Data.rsdk files inside of the game folders.
  3. Download the latest builds from the releases page.
    • Download the .cia files to install onto your home screen. Or scan the QR codes.
    • Download the .3dsx files to run from the homebrew launcher. Place into the game folders.
    • Use the rev01 versions only if you encounter problems with the regular versions.
  4. (Optional) Follow these steps if you want to use mods:
    1. Download the decompiled scripts and place them in the game folders.
    2. Create a mods folder inside of the game folders. Your mods go there.
    3. Read the About Mods section below.

Your Sonic1 folder should look something like this:

About Mods

  • You must install the decompiled scripts before using mods, otherwise you'll encounter many errors.
  • There are many outdated mods that do not work on v1.3.0. Make sure they work on the PC version before reporting they do not work on the 3DS port.
    • Some mods are simply missing a mod.ini file.
    • Other mods are based on outdated scripts and need a lot more work to fix.
  • Some mods need to be loaded before others. Edit the mods/modconfig.ini file to change the order mods are loaded in.
    • Mods higher on the list will have higher priority.
  • Not all mods are compatible with each other. Remember your modding common sense.

Limitations

  • A New 3DS is required. It does not run (well) on an old 3DS.
  • These do not feature the fancy 3D menus.
  • The Sonic 2 special stages run at a low frame rate.
  • It does not support the data files from Sonic Origins.
  • Load times are a bit slow. Most notably, the Sonic 1 credits scene will go out of sync.
  • There are no multiplayer or networking features.
  • There is no 3D effect of any kind.

Building for 3DS

  • Install DevkitPro with devkitARM and libctru.
  • Install bannertool.
  • Install dependencies: pacman -S 3ds-libvorbisidec 3ds-tinyxml2
  • Install stb-image into the dependencies/all/ directory.
  • Enter one of the build directories: cd ./Sonic1Decomp.3DS or cd ./Sonic2Decomp.3DS
  • To just build a 3dsx file, run make
  • To build a cia file, install MakeROM and run make cia
  • To build the REV01 version add REV01=1 to the make command. Ex: make cia REV01=1

(The original readme continues below.)

SUPPORT THE OFFICIAL RELEASE OF SONIC 1 & SONIC 2

Even if your platform isn't supported by the official releases, you must buy it for the assets (you don't need to run the official release, you just need the game assets)

If you want to transfer your save from the official mobile versions, the Android pre-forever file path is Android/data/com.sega.sonic1 or 2/SGame.bin (other versions may have different file paths). Copy that file to the SData.bin in the EXE folder.

Additional Tweaks

  • Added a built in script compiler. Similar to the one found in RSDKv3, but tweaked up to match the new syntax for the scripts used in RSDKv4.
  • Added a built in mod loader and API allowing to easily create and play mods with features such as save file redirection, custom achievements and XML GameConfig/StageConfig data.
  • Custom menu and networking system for Sonic 2 multiplayer, allowing anyone to host and join servers and play 2P VS.
  • There is now a settings.ini file that the game uses to load all settings, similar to Sonic Mania.
  • Dev menu can now be accessed from anywhere by pressing the ESC key if enabled in the config.
  • The F12 pause, F11 step over & fast forward debug features from Sonic Mania have all been ported and are enabled if devMenu is enabled in the config.
  • If devMenu is enabled in the config, pressing F9 will visualize hitboxes, and F10 will activate a palette overlay that shows the game's 8 internal palettes in real time.
  • Added the idle screen dimming feature from Sonic Mania Plus, as well as allowing the user to disable it or set how long it takes for the screen to dim.

How to build:

Windows:

  • Clone the repo, then follow the instructions in the depencencies readme for Windows to setup dependencies, then build via the visual studio solution
  • or grab a prebuilt executable from the releases section

Windows via MSYS2 (64-bit Only):

Decompilation

  • Download the newest version of the MSYS2 installer from here and install it.
  • Run the MINGW64 prompt (from the windows Start Menu/MSYS2 64-bit/MSYS2 MinGW 64-bit), when the program starts enter pacman -Syuu in the prompt and hit Enter. Press Y when it asks if you want to update packages. If it asks you to close the prompt, do so, then restart it and run the same command again. This updates the packages to their latest versions.
  • Now install the dependencies with the following command: pacman -S make git mingw-w64-i686-gcc mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-libogg mingw-w64-x86_64-libvorbis mingw-w64-x86_64-glew
  • Clone the repo with the following command: git clone https://github.com/Rubberduckycooly/Sonic-1-2-2013-Decompilation.git
  • Go into the repo you just cloned with cd Sonic-1-2-2013-Decompilation
  • Then run make -f Makefile.msys2 CXX=x86_64-w64-mingw32-g++ CXXFLAGS=-static -j4 (-j switch is optional but will make building faster, it's based on the number of cores you have +1 so 8 cores wold be -j9)

Server (Only required to host Sonic 2 multiplayer servers)

  • Go into Server directory using the command cd Server when in the root of the decompilation source folder.
  • Then run make -f Makefile.msys2 CXXFLAGS=-static -j4 to create the Server executable (-j switch is optional but will make building faster, it's based on the number of cores you have +1 so 8 cores wold be -j9)

Windows UWP (Phone, Xbox, etc.):

  • Clone the repo, then follow the instructions in the depencencies readme for Windows and depencencies readme for UWP to setup dependencies, copy your Data.rsdk folder into Sonic1Decomp.UWP or Sonic2Decomp.UWP depending on the game, then build and deploy via Sonic12Decomp.UWP.sln
  • You may also need to generate visual assets, to do so, open the Package.appxmanifest file in the designer, under the Visual Assets tab, select an image of your choice and click generate.

Linux:

  • To setup your build enviroment and library dependecies run the following commands:
  • Ubuntu (Mint, Pop!_OS, etc...): sudo apt install build-essential git libsdl2-dev libvorbis-dev libogg-dev libglew-dev libasio-dev
  • Arch Linux: sudo pacman -S base-devel git sdl2 libvorbis libogg libglew libasio
  • Clone the repo with the following command: git clone https://github.com/Rubberduckycooly/Sonic-1-2-2013-Decompilation.git
  • Go into the repo you just cloned with cd Sonic-1-2-2013-Decompilation
  • Clone the following repos with these commands:
  • Tinyxml2: git clone https://github.com/leethomason/tinyxml2.git ./dependencies/all/tinyxml2
  • Stb-image: git clone https://github.com/nothings/stb.git ./dependencies/all/stb-image
  • Run make -j5 , if your distro is using gcc 8.x.x then add the argument LIBS=-lstdc++fs
  • (-j switch is optional but will make building faster, it's based on the number of cores you have +1 so 8 cores wold be -j9)

Mac:

  • Clone the repo, then follow the instructions in the depencencies readme for Mac to setup dependencies, then build via the xcode project.
  • A Mac build of v1.1.2 by sappharad can be found here.

Android:

  • Clone the repo, then follow the instructions in the depencencies readme for Android.
  • Ensure the symbolic links in android/app/jni are correct. If not, fix them with the following on Windows:
    • mklink /D src ..\..\..
    • mklink /D SDL ..\..\..\dependencies\android\SDL
  • Open android/ in Android Studio, install the NDK and everything else that it asks for, and build.

Vita

Switch:

  • Head on over to heyjoeway's fork and follow the installation instructions in the readme.

Web:

  • Head on over to mattConn's fork and follow the installation instructions in the readme.

Other platforms:

Currently the only supported platforms are the ones listed above, however the backend uses libogg, libvorbis & SDL2 to power it, so the codebase is very multiplatform. if you've cloned this repo and ported it to a platform not on the list or made some changes you'd like to see added to this repo, submit a pull request and it'll most likely be added

FAQ

Q: The screen is tearing, how do I fix it?

A: Try turning on vsync, that worked for me (tested on mac)

Q: I found a bug/I have a feature request!

A: Submit an issue in the issues tab and I'll fix/add (if possible) it as soon as I can

Q: Will you do a decompilation for Sonic CD (2011)?

A: I already have! you can find it here!

Q: Will you do a decompilation for Sonic Mania?

A: No. Sonic Mania is a ton bigger and requires that I'd decompile not only how the (far more complex) RSDKv5 works, but also all 600+ objects work

Special Thanks

  • RMGRich for helping me fix bugs, tweaking up my sometimes sloppy code and generally being really helpful and fun to work with on this project
  • The Weigman for creating the header you see up here along with similar assets
  • Everyone in the Retro Engine Modding Server for being supportive of me and for giving me a place to show off these things that I've found

Contact:

Join the Retro Engine Modding Discord Server for any extra questions you may need to know about the decompilation or modding it.

About

Sonic 1/2 (2013) Decompilation for New 3DS

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • C 62.5%
  • C++ 33.6%
  • Java 3.4%
  • Other 0.5%