Generic Game Boy Emulator, abbreviated as GGBE, is a cycle accurate Game Boy emulator which strives to not compromise code quality and readability for the sake of performance. This is a hobby project written as a learning opportunity to balance readability and performance.
In its current state, the emulator can run DMG games and some CGB games,i.e. it functions as a DMG emulator and a partial CGB emulator at the moment.
Requirements:
- A compiler which can compile C++17
- SDL2 development libraries
- CMake should be installed
Move to src directory using
cd src
The GGBE executable can be generated by running the following commands in terminal
chmod u+x run.sh
./run.sh
This should generate the build directory.
The emulator can then be launched by the following command
./build/GGBE <absolute-path-to-rom>/<relative-path-from-root>
For example if tetris.gb were in roms directory, the command
./build/GGBE roms/tetris.gb
should start up tetris.
The boot rom is taken from https://github.com/Hacktix/Bootix.
Game Boy | Key |
---|---|
Dpad | Arrow Keys |
A | Z |
B | X |
Select | A |
Start | S |
The Emulator is planned to be divided into 4 major components as of now:
- CPU : Deals with everything related to instructions and interrupts.
- GPU/PPU : Deals with everything related to getting pixels onto the screen
- APU (work in progress) : Deals with everything related to Audio generation and Mixing
- MMU : Takes care of Memory Mapping and Bank Switching
These components are represented as classes and are consolidated as member objects of a class Console, which represents the Console itself. This modular approach makes it easy to write and test code.
Test | GGBE |
---|---|
cpu instrs | 👍 |
dmg sound | ❌ |
instr timing | 👍 |
mem timing | 👍 |
mem timing 2 | 👍 |
Test | GGBE |
---|---|
div_write | 👍 |
rapid_toggle | 👍 |
tim00 div trigger | 👍 |
tim00 | 👍 |
tim01 div trigger | 👍 |
tim01 | 👍 |
tim10 div trigger | 👍 |
tim10 | 👍 |
tim01 div trigger | 👍 |
tim01 | 👍 |
tim11 div trigger | 👍 |
tim11 | 👍 |
tima_reload | 👍 |
tima_write_reloading | 👍 |
tma_write_reloading | 👍 |
Test | GGBE |
---|---|
bits bank1 | 👍 |
bits bank2 | 👍 |
bits mode | 👍 |
bits ramg | 👍 |
rom 512kb | 👍 |
rom 1Mb | 👍 |
rom 2Mb | 👍 |
rom 4Mb | 👍 |
rom 8Mb | 👍 |
rom 16Mb | 👍 |
ram 64kb | 👍 |
ram 256kb | 👍 |
multicart rom 8Mb | ❌ |
Test | GGBE |
---|---|
bits ramg | 👍 |
bits romb | 👍 |
bits unused | 👍 |
rom 512kb | 👍 |
rom 1Mb | 👍 |
rom 2Mb | 👍 |
ram | 👍 |
Test | GGBE |
---|---|
rom 512kb | 👍 |
rom 1Mb | 👍 |
rom 2Mb | 👍 |
rom 4Mb | 👍 |
rom 8Mb | 👍 |
rom 16Mb | 👍 |
rom 32Mb | 👍 |
rom 64Mb | 👍 |