here's one of the bigger projects i've been working on. there's an overarching future goal, but also work worth sharing right now. the overarching goal is to produce a native c port of sonic 1, such that it could be ported and hacked on like doom or the sm64 decomp. i consider it to be a culmination of my knowledge of this game and of emulation in general. to get there, i've created the work worth sharing right now: my own minimal mega drive emulator. while it's designed only to run this game, it has a couple interesting features:
- semi-hardware accelerated rendering. each layer is rendered in software by the emulated display processor, but composited on the gpu, which allows for applying certain shader effects to individual layers. for example, here i'm applying a blur shader to the background to make the foreground action stand out more
- support for "hooking" subroutines and replacing them with calls into a dll loaded at runtime. this is how i intend to make the c port happen; by gradually patching the game with code written in a higher-level language (which can be seen in the lower left). with a command line switch the emulator can verify the accuracy of every patch by running a "control" emulator without scripting side-by-side, and checking that registers and memory match after running every hook