Mono-GB is a relatively cycle-accurate Gameboy color emulator built in modern C++. Despite the name, the emulator fully supports both DMG and CGB games in full color.
This is a hobby project with the main goal being to understand the intricacies of low-level system design.
The following is a list of fully implemented features:
- Backwards compatibility with the original Gameboy.
- Machine Cycle accurate CPU.
- Dual-speed support
- Support for MBC1, MBC2, MBC3, and MBC5.
- DMG colorization.
- Dot accurate PPU sprite & BG pipelines.
- Phase-based instruction execution.
This project is still a work in progress. The following is a list of features I am planning on implementing:
- Audio support.
- T-state based instruction execution.
- A fully functional debugger.
The accuracy of a gameboy emulator is usually determined by test ROMs that are created using the real hardware.
The following is a list of the ROM tests that Mono GB passes:
- Blargg's ROM tests:
- cpu_instrs
- halt_bug
- interrupt_time (Note: Failure is expected on CGB)
- instr_timing
- mem_timing
- mem_timing-2
- Mooneye test suite
- acceptance/add_sp_e_timing
- acceptance/call_cc_timing
- acceptance/call_cc_timing2
- acceptance/call_timing
- acceptance/call_timing2
- acceptance/div_timing
- acceptance/ei_timing
- acceptance/halt_ime0_ei
- acceptance/if_ie_registers
- acceptance/if_ie_registers
- acceptance/intr_timing
- acceptance/jp_cc_timing
- acceptance/jp_timing
- acceptance/ld_hl_sp_e_timing
- acceptance/oam_dma_restart
- acceptance/oam_dma_start
- acceptance/oam_dma_timing
- acceptance/pop_timing
- acceptance/push_timing
- acceptance/ret_cc_timing
- acceptance/ret_timing
- acceptance/reti_intr_timing
- acceptance/reti_timing
- acceptance/rst_timing
- acceptance/bits/mem_oam
- acceptance/bits/reg_f
- acceptance/instr
- acceptance/interrupts
- acceptance/oam_dma/basic
- acceptance/oam_dma/reg_read
- acceptance/timer
- acceptance/emulator-only/mbc1
- acceptance/emulator-only/mbc2
- acceptance/emulator-only/mbc5
- rtc3-test
- cgb-acid-2
- dmg-acid-2
- cgb-acid-hell
Mono-GB uses CMake presets for building. Ensure you have CMake (3.21+), Ninja, and a C++23 compatible compiler installed.
To build for release:
# Configure the project
cmake --preset unixlike-gcc-release
# Build the project
cmake --build out/build/unixlike-gcc-releaseTo build for release:
# Configure the project
cmake --preset windows-msvc-release-user-mode
# Build the project
cmake --build out/build/windows-msvc-release-user-modeAfter building, the executable can be found in the src directory within the build folder.
# Unix-like
./out/build/unixlike-gcc-release/src/mono_gb
# Windows
./out/build/windows-msvc-release-user-mode/src/RelWithDebInfo/mono_gb.exeResources:
Showcase Games:
Tests:
UI
