A Game Boy emulator written in C++17.
gbglow includes CPU, PPU, audio, cartridge, input, save-state, and debugger components.
The current release target is Ubuntu 24.04. Release builds stay portable by default. Host-specific tuning is available when you explicitly ask for it.
Supported cartridge families:
- ROM-only
- MBC1
- MBC3
- MBC5
git clone https://github.com/byteshiftlabs/gbglow.git
cd gbglow
./build.sh
# Optional: enable host-specific tuning for a personal build on this machine
./build.sh --native-tuning
# 3. Run a ROM
./run.sh path/to/game.gbIf you are new to the emulator, use this order:
- Run
./build.shand launch a known-good ROM with./run.sh path/to/game.gb. - Run
cd build && ctest --output-on-failureso you understand the current automated test surface. - Rebuild the docs only if you are changing public documentation or developer docs.
- Read ROADMAP.md before opening larger emulator accuracy or tooling changes so you stay aligned with the current priorities.
| Key | Action |
|---|---|
| Arrow keys | D-pad |
| Z | A button |
| X | B button |
| Enter | Start |
| Shift | Select |
| Ctrl+O | Open ROM dialog |
| Ctrl+R | Reset emulator |
| F1-F9 | Save state |
| Shift+F1-F9 | Load state |
| F11 | Toggle debugger |
| F12 | Capture screenshot |
| ESC | Exit |
Current support target: Ubuntu 24.04.
Dear ImGui is fetched automatically during CMake configure.
Release builds stay portable by default. If you want -march=native and -mtune=native, opt in explicitly with ./build.sh --native-tuning or -DGBGLOW_ENABLE_NATIVE_TUNING=ON during CMake configure.
Install on Ubuntu 24.04:
sudo apt install build-essential cmake libsdl2-dev pkg-config cppcheck zenityRequired tools:
- GCC or Clang with C++17 support
- CMake 3.14 or newer
- SDL2 development package
- pkg-config, used to detect the SDL2 development package and provide the compiler/linker flags for it
- cppcheck
The debugger UI uses Dear ImGui. It is fetched automatically during CMake configure, so no separate manual install is needed.
Screenshots are supported in the emulator with F12 and are saved to a local gbglow screenshot directory.
./build.shTo run the exact same pinned cppcheck version that CI uses:
./build.sh --bootstrap-cppcheck --cleanManual test run:
cd build && ctest --output-on-failureCurrent test targets:
test_coretest_persistencetest_ppu
Build the docs with:
python3 -m venv .docs-venv
source .docs-venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt
make -C docs html
# Open docs/_build/html/index.html in your browserOn Ubuntu 24.04, prefer the virtualenv path above instead of installing Sphinx into the system interpreter.
See ROADMAP.md for the current validation, documentation, and follow-up work priorities.