Hazelnut, a Game Boy Color Emulator Written in Python, Runs 200+ Games at Up to 8x Speed
Solo developer atifcodesalot spent months hand-writing a pygame handheld emulator that trades cycle-exact accuracy for PyPy speed and leaves only one known classic Game Boy title stuck.

Writing a Game Boy Color emulator in Python sounds like entering a tractor in a drag race, yet solo developer atifcodesalot built one over several months using Python and pygame. On standard CPython, Hazelnut can dip below the real handheld’s 60 frames per second, which is about what anyone expects from an interpreted language chewing through console instructions. Switch to the PyPy runtime, though, and the emulator runs at up to 8x native hardware speed with room to spare.
You do not even have to hunt down PyPy yourself. Running the package prompts an automatic PyPy setup out of the box, or you can grab it with pip install hazelnut-gb-emu and launch the built-in GUI via python3 -m hazelnut_gb_emu (or py -m hazelnut_gb_emu on Windows). For a hobby repo released under the MIT license, that onboarding is nicer than half the enterprise CLI tools shipping this quarter.
The trick that keeps Python from choking on Nintendo’s handheld hardware lives in the timing model. Real Game Boy hardware runs its SM83 processor, Picture Processing Unit (PPU), and Audio Processing Unit (APU) concurrently. Hazelnut steps its CPU and timers per instruction, then triggers PPU mode boundaries after longer CPU and timer bursts, making it effectively scanline-mode stepped. That shortcut saves a pile of Python loop overhead while keeping almost every original Game Boy game playable.
Game Boy Color complicates that truce with double-speed mode, which doubles the SM83 processor from roughly 4 MHz to 8 MHz while leaving the PPU at its original pace. Twice as many CPU cycles pack into the gap between PPU mode boundaries, widening the timing drift whenever software expects lockstep hardware behavior. In theory, that is where a scanline-stepped emulator starts glitching out; in practice, all 200-plus Game Boy Color titles tested so far still run functionally.
Crack open the nut’s feature list and the gaps are refreshingly blunt. Memory bank switching covers MBC1, MBC2, MBC3 (including real-time clock registers), and MBC5, with MBC6 and MBC7 queued up next. Audio works, though the APU remains in development. Under known bugs, the Game Boy Color column sits empty, while the original Game Boy list holds a single casualty: The Smurfs, which refuses to advance because it relies directly on the hardware’s OAM DMA bug (somehow, a licensed Smurfs cartridge is the toughest QA engineer in emulation).
The author also drew a bright line around how the codebase came together, describing it as “handwritten” and stating 99% of the code—including the full CPU and PPU implementations—was written solo without generated-from-scratch or agentic code. AI only showed up for bug hunting, disassembly, and occasional optimization passes. Next on a roadmap ranked “from the most possible to insane” are finishing the APU, making the PPU instruction-stepped so the double-speed quirk finally disappears, and chasing clock-cycle atomicity, a goal the author labels “very hard”.
If atifcodesalot follows that roadmap into an instruction-stepped PPU—or dares attempt full clock-cycle atomicity—the speed headroom PyPy buys today is likely to shrink fast. Tighter per-cycle synchronization multiplies dispatch overhead on every tick, so an emulator that coasts at 8x speed right now could easily end up fighting for a steady 60 fps once every hardware quirk gets honored.
Expect more indie repos to hang out that “not vibecoded” sign, too. As generated boilerplate floods GitHub, developers who actually wrestled an SM83 instruction set and four memory bank controllers into submission have a real incentive to prove a human wrote the hard parts.
Just keep The Smurfs on the shelf.