Skip to content
PORTSNATIVE.
HomeCatalog
Web GamesEmulatorsToolsNews
PORTSNATIVE.

A catalog for discovering ports and related projects. We link to official sources and do not host original game files.

ExploreCatalogMy list
InformationAbout usSuggest a portSupportDonationsLegal notice
© 2026 PortsNative
Back to catalog
Sonic the Hedgehog
PORTSNATIVE

Sonic the Hedgehog

NATIVE PORTRACING / DRIVINGWINDOWSALPHA

Sonic the Hedgehog

TechnologyNative C/C++ port (engine reimplementation)

Available forWindows

View official project

About the project

Sonic the Hedgehog es un videojuego de plataformas desarrollado y publicado por Sega para la consola Mega Drive. Salió a la venta en las regiones PAL el 21 de junio, en Norteamérica dos días después, el 23 de junio, y en Japón al mes siguiente. El jugador controla a Sonic, un erizo que puede correr a velocidades supersónicas. La historia lo sigue en su intento de frustrar los planes del científico loco Dr. Robotnik, que busca las poderosas Chaos Emeralds.

4 versions of Sonic the Hedgehog

You're viewing: Sonic the Hedgehog

Sonic the Hedgehoggithub.com/foreverWIP/s1-port
Windows
Current
Sonic the Hedgehog (2006)github.com/rjkiv/sonic06
Windows
›
Sonic the Hedgehog (sonic-j2me-decompilation)github.com/yowari/sonic-j2me-decompilation
Windows
›
Sonic the Hedgehog Recompiledgithub.com/mstan/SonicTheHedgehogRecomp
Windows
Linux
macOS
›

Official project information

Author's original READMEOpen on GitHub ↗

Sonic 1 C Port

This is a work-in-progress full port of Sonic the Hedgehog for the Mega Drive (revision 1) to C.

What's ported:

  • All "core" game code (graphics management, collision handling (object/level and object/object), level-specific code)
  • All game objects, including the entire Sonic object
  • Sound driver, integrating code from CKDEV's reimplementation of the sound driver (used with permission)

What's not ported:

  • Horizontal blank handling (tile drawing will be corrupted when interrupting demo playback and while Labyrinth Zone's water surface is onscreen)

A REV01 ROM of the original game is required, for reading data from it. Place it in the same folder as the executable and name it sonic1.bin.

I accomplished this by writing a program that generates "nearly-correct" C code from all the code it can find in the original ROM, assisted by a symbol map from a disassembly and a few heuristics. Then, I go through all the generated code and manually fix any issues from the generator that would be too complex to fix automatically (dynamic jumps, complex control flow, code that wasn't picked up by the converter). I compile the resulting C with TCC (though other compilers will probably work), and load it through a separate program written in Rust.

The program acts as a specialized "frontend" for speedshoes, a minimal Mega Drive emulation framework I wrote for this project. Speedshoes is capable of running the original ROM, albeit with some slight runtime patching to accomodate for extra features. Notably, it can detect whenever 68k subroutines are called, and is able to intercept those calls with calls into C "scripts". For the sake of accuracy with the game, the C scripts hold their own copy of game state, and after every hook, the state of the C side is compared with the emulator. Additionally, Speedshoes supports checking accuracy at the level of individual instructions, allowing one to construct a perfect reimplementation of a Mega Drive game down to the CPU register, without interpreting a single byte of code in ROM.

I intend for this port to be a basis from which myself and others can create derivative works of the game, retaining faithfulness to the original gameplay while not having to work in the original's 68000 assembly language.

Informal build instructions (out of date)

To build the game DLL:

  • Grab a distribution of TCC and put it at the repo root, such that the path to TCC is <repo root>/tcc/tcc.exe
  • Enter the sonic1c folder and run build_game.cmd. (If you want faster code without any accuracy checking, run build_game_release.cmd).
  • You'll end up with sonic1.dll and sonic1.def (Windows)/libsonic1.so (*nix) in the repo root.

To build Speedshoes and the game runner:

  • Install Rust. If you already have Rust installed, make sure you're using the 2021 edition.
  • Enter the repo root and cargo build for a debug build, or cargo build --release for a release build.
  • Enter the sonic1 folder and cargo run fo a debug build, or cargo run --release for a release build. Release builds expect the game DLL to be in the same folder as it, so copy the DLL over as well.
Read official guide
CALIFICACIÓN
—
Loading votes…
Advertisement

PROJECT FILE

Project type
NATIVE PORT
Genre
Racing / Driving
Status
alpha
Original platform
—
Technology
Native C/C++ port (engine reimplementation)
Version
—
Updated
—

Target platforms 1

Windows
View on GitHub
Advertisement