A group of coders has decompiled the source code for Sonic the Hedgehog and its 1992 sequel from their well-regarded 2013 smartphone ports. That means these heavily enhanced versions of the early ’90s Genesis games—developed by Christian Whitehead using the same revamped Retro/Star Engine that powers Sonic Mania—can now be easily recompiled for play on new platforms including the PlayStation Vita, the Nintendo Switch, and Windows/Mac computers.
That’s an interesting-enough hacking/coding achievement on its own. But with a little tinkering, the PC versions also let players scale the game window to any arbitrary resolution, expanding the visible playfield without scaling up the games’ core pixel graphics. As you can see in the pictures and videos included in this article, this tweak effectively zooms out the standard in-game camera to show huge chunks of a stage at once, giving players an exciting new perspective on these classic titles.
Filling your PC screen with a playable Sonic map isn’t exactly as simple as dragging the corner of the gameplay window. First, you have to take a legally obtained copy of one of the 2013 Sonic games (which are still available on Google Play and the iOS App Store) and extract the “RSDK” file to your computer (this handy video tutorial can be of assistance there). From there, you can run the precompiled Windows release and edit the settings file to extend the playfield horizontally with relative ease (you can also edit the pixel scale if you want to effectively zoom the game’s camera back in on a large monitor).
Unfortunately, the game’s vertical height remains hardcoded at 240 pixels in this build, which means the game looks like a long, thin strip when extended across the width of a modern PC monitor. To extend the playfield vertically, you have to dive into the decompiled source code, change “SCREEN_YSIZE” in the retroengine.hpp, then recompile a fresh new executable (there are some tricky dependencies involved in getting this to work; much thanks to @CodeNameGamma for her assistance in my attempts).
The thousand-foot view
Once you get things working, however, the effect of this “zoomed out” view is immediately striking. The standard 32×48 pixel Sonic sprite becomes a tiny, Where’s Waldo-esque speck on a 2560×1440 monitor (or even tinier if you have a 4K or widescreen display). The new viewpoint lets players see well past the cramped 320×224 screen area they may be used to on the Genesis, allowing them to take in the scale and design of these massive levels all at once. Hidden paths and secrets that once flew by in a blur become immediately apparent when you can take an ultra high-level view of a stage at a glance.
These 2013 mobile ports were originally designed to run at “full screen” resolution on a variety of different smartphones, so the engine handles all this rescaling pretty smoothly on its own. Enemies, moving platforms, and animated background elements all generally work, even if Sonic is thousands of pixels away on the opposite corner of the screen. The in-game physics still work as expected, and everything is rendered with pixel-perfect authenticity at 60 frames per second, too (assuming your machine can handle all those pixels at these expanded resolutions).
Still, there are some odd gameplay and visual artifacts when you try to scale a game originally designed for ’90s standard-definition TVs to modern computer resolutions. This is most apparent at the end of many levels, where Sonic can get stuck on a newly obstructive invisible wall and the game hits an infinite loop waiting for him to run off-screen. On flat levels, the background tiles and even the level architecture itself can sometimes repeat in a vertical pattern, too. And the AI for Dr. Robotnik’s boss battle also tends to freak out a little thanks to the new, much larger playfield.
These issues may get ironed out as hackers continue to tinker with the source code and build new versions of these freshly decompiled games. In the meantime, though, we’ll never look at classic Sonic the same way again.
Listing image by Sega