Skip to content
tekrPublic

About

A Game Boy emulator written in C++

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emu Boy

A Nintendo Game Boy emulator written in C++.

Why another emulator?

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.

Acknowledgments

Emu Boy has been built using Game Boy hardware information available online, primarily:

Game Boy CPU manual

CPU opcodes

Pan Docs

GB boot ROM

The repo includes a binary of GBSnake.

Dependencies

Emu Boy uses SFML for outputting video & audio, and Google Test for unit testing.

Building on macOS

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.gb

Run 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.

Current status

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

 

To-do list

Various features remain to be added including:

  • Menus & ROM file selector
  • Linux support
  • Performance optimisation

About

A Game Boy emulator written in C++

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages