A Nintendo Game Boy emulator written in C++.
There are many PC-based emulators that have existed for some time including VBA and BGB. This project was intentionally started independently as a hobby/practice exercise.
Emu Boy has been built using Game Boy hardware information available online, primarily:
The repo includes a binary of GBSnake.
Emu Boy uses SFML for outputting video & audio, and Google Test for unit testing.
Install the dependencies with Homebrew, then build with CMake:
brew install cmake boost sfml@2 googletest
cmake -S . -B build -DSFML_DIR="$(brew --prefix sfml@2)/lib/cmake/SFML" -DCMAKE_PREFIX_PATH="$(brew --prefix boost);$(brew --prefix googletest)"
cmake --build build
./build/EmuBoy ROMs/gb-snake.gbRun the unit tests with ctest --test-dir build (or run ../../build/Tests from src/tests). Google Test is optional;
without it, only the emulator is built.
EmuBoy [rom] [record-file] [scale]: scale sets the window size as a multiple of the Game Boy's 160x144 screen
(default 4). If record-file is given, every frame is appended to it as raw 160x144 RGBA, which is useful for making
screen captures.
As of now Emu Boy is still in its early stages and is very much a work in progress. It currently supports the following:
- Fairly cycle-accurate emulation of the LR35902 CPU (all documented instructions + interrupts)
- Full graphics implementation (sprites + background + window support)
- Runs (at least) the included snake and Super Mario Land
- Sound: all four channels of the original Game Boy's sound hardware, including its documented quirks. Passes all of blargg's dmg_sound test ROMs
- Unit testing of most CPU instructions and the sound hardware
- Windows (Visual Studio 2015 solution) and macOS (CMake)
- Simulates the slow response-time of the Game Boy LCD screen and smoothes upsized jagged pixels
- Keyboard input
Various features remain to be added including:
- Menus & ROM file selector
- Linux support
- Performance optimisation
