Me, Leandro, as a handdraw logo

CameBoy

A minimalist Game Boy emulator written in C99

CameBoy is a raw dive into retro computing: a Game Boy emulator built in C99, pieced together from a patchwork of online insights to reveal the bare mechanics behind the classic handheld. No bells, no whistles; every line tries to be a lesson in minimalism.

CameBoy running the bgbtest.gb demo ROM

It already passes Blargg’s cpu_instrs hardware test ROM, with instruction and memory timing still being brought in line.

Features

  • C99 core, separated from the front-end
  • SDL2 front-end for video, input, and text (SDL2 + SDL2_ttf)
  • Test-ROM driven: progress is measured against Blargg’s hardware test ROMs
  • CI builds and tests on GitHub Actions

Tech

  • C99 with CMake (3.26+), dependencies managed by CPM.cmake
  • SDL2 and SDL2_ttf
  • Project notes kept (in Portuguese) on Notion

What I learned

  • The Game Boy’s memory map, and why emulation is mostly bookkeeping done honestly.
  • Instruction accuracy versus timing accuracy: passing cpu_instrs is the easy half.
  • Using hardware test ROMs as an executable specification.

CC BY-NC-SA 4.0 2020–2026 © Leandro Peres. All rights reversed.