This is a gameboy emulator I made for personal advancement. Mainly coded in C++, using Qt and for the GUI and SDL for rendering, and eventually, audio and input. This supports both Linux and Mac
Finished Components
- Pixel Processing Unit
- CPU
- Timer
- MBC1 implementation
- GUI
- DMA
- LCD
Still need to finish
- Other MBCs
- Audio
- Input
- SDL3 and SDL3_ttf
- Qt6
- JSONCpp (for the test suite only)
- On Mac, you can install using homebrew
brew install qt sdl3 sdl3_ttf jsoncpp
- Clone the repository
- Configure with CMake:
cmake -S . -B build && cmake --build build - Run
./build/sdl-gameboy-qton Linux or./build/sdl-gameboy-qt.app/Contents/MacOS/sdl-gameboy-qton Mac
- Follow build instructions
- Run
./build/opcode-teston both Linux and Mac
- The SDL window is embedded into a Qt widget. This is how I render the emulator screen into the Qt window. Right now it supports Linux (only Xorg or Xwayland) and mac
- I have a custom test suite to (found under
/tests) in order to verify the correctness of the CPU. Uses Single Step Tests which verifies the CPU behavior by setting the state before, running the instruction, then comparing what it would be after. - This emulator is multithreaded. The Emulator code itself runs in a separate thread from the GUI. I have 2 buffers, front and back. The emulator continuously writes to the back buffer. When a new frame is drawn, it copies the VRAM to the front buffer to serve as a static copy for the frame. Maybe I can utilize buffer switching in the near future