Skip to content

sjp761/gameboy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameBoy Emulator

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

Dependencies

  • 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

Building

  1. Clone the repository
  2. Configure with CMake: cmake -S . -B build && cmake --build build
  3. Run ./build/sdl-gameboy-qt on Linux or ./build/sdl-gameboy-qt.app/Contents/MacOS/sdl-gameboy-qt on Mac

Testing

  1. Follow build instructions
  2. Run ./build/opcode-test on both Linux and Mac

Facts about this emulator

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors