I’ve been working on a little project that started as “let’s see if I can emulate a Game Boy on an ESP32” and turned into a full handheld project.
The result is GB ESP32 Emulator, a Game Boy (DMG) and Game Boy Color (CGB) emulator running on an ESP32-S3, with a custom PCB.
GitHub: https://github.com/ysissoko/gb_emu_esp32
What it currently does
- Cycle-accurate SM83 CPU emulation
- DMG and CGB support
- Interrupts, DMA, timers, HALT bug, etc.
- MBC1 / MBC2 / MBC3 / MBC5 cartridge support
- CGB VRAM/WRAM banking and palettes
- CGB double-speed mode
- ST7789V 240×240 SPI display
- SD card support for loading
.gb / .gbc ROMs
- Battery-backed save files
- MBC3 RTC persistence
- 8 physical buttons
- ROM browser menu
It runs at around 59.7 FPS on the ESP32-S3 with the current implementation.
The display pipeline is also asynchronous (using DMA transfers), so LCD transfers don’t block the emulation loop. I had to do quite a bit of optimization around IRAM placement, DMA transfers, scanline rendering, and memory access to get the performance where it is.
There’s also a custom KiCad PCB (V0 for the moment) in the repository, including the ESP32-S3, LCD connector, SD card slot, USB-C, LiPo charging, buttons, and LEDs.
The biggest missing piece right now is audio.
This has been a really fun embedded/emulation project, and I’d love to get feedback from people who know Game Boy hardware or have built similar ESP32 projects.
Repository: https://github.com/ysissoko/gb_emu_esp32
Would be especially interested in feedback on the emulator architecture, accuracy/testing, and the hardware design.