There's a simple Gameboy emulator written in zig using SDL2. It can run games like Tetris, Zelda or Kirby decently, and doesn't pretend to do much more. Most basic features are implemented, like graphics, sound and controls, but there was no effort to support any complex hardware behavior or bugs.
Tetris | Zelda |
---|---|
ROM-only and MBC1 cartridge are supported, whereas MBC2 has limited support. On the other hand the codebase should be very simple to get into and hopefully very readable. Sound will accumulate lag over time under normal use, this is a known bug.
This should get you going after cloning the repo:
zig build run -- <rom_file>
Keyboard key | Gameboy |
---|---|
Esc | Exit |
WASD | DPad |
O | A |
K | B |
Enter | Start |
B | Select |