Skip to content

sadekin/stoicgb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stoicgb

A Game Boy emulator written in C++ to develop a better understanding of how certain machines work together in a precisely synchronized fashion in order to keep a gaming addict like myself addicted.

It's not the most accurate emulator out there, but it's accurate enough to play some of the games I grew up with, such as my beloved Pokémon Yellow.

Usage

Tested on MacOS so far.

Dependencies

cmake, SDL2, SDL2_ttf, tinyfiledialogs (included in repo)

TODO: My CMakeLists.txt is not the most sophisticated in finding SDL2. I'll work on that. For now, we have to manually set the paths to SDL2_ttf.

Building

cmake . 

Running

./stoicgb          Opens a file dialog for selecting a standard Game Boy ROM

Features

  • Accurate CPU with correct opcode implementations and timings. It is the CPU, at least in my implementation, that is central to synchronizing all components.
  • PPU (whose timings are accurate enough to render many games).
  • Working stereo audio using SDL_QueueAudio (again, timings are accurate enough for many games).
  • Memory Bank Controllers: MBC0 (no MBC), MBC1, MBC2, MBC3, MBC5 (no RTC support) .
  • Battery for saving (via external RAM dumps).
  • Loading of save files (automatically attempts to load from the same directory as a battery-supported ROM).
  • Disassembler (for debugging).

I still have a lot of work to do in terms of accuracy, and I also plan on adding more features, but I'm happy with the progress I've made so far.

Controls

Key Action
Enter Start
Space Select
Up
Down
Left
Right
Z A
X B
esc Quit

Tests

Blargg's

Test Result
cpu_instrs
instr_timing
interrupt_time ✅ (DMG only)
mem_timing
mem_timing-2
dmg_sound
oam_bug
halt_bug

Gekkio's Mooneye

Test Result
bits
instr
interrupts
oam_dma
ppu
timer

TODO:

List all the tests.

Many pass. Alas, much fail.

Matt Currie's dmg-acid2 ✅

Game GIFs

Pikachu Pokémon
Pokémon Yellow Pokémon Yellow (yes, again)
DK Land Super Mario Land
Donkey Kong Land Super Mario Land
linksawakening.gif metroid.gif
The Legend of Zelda: Link's Awakening Metroid II: Return of Samus
tetris.gif drmario.gif
Tetris Dr. Mario

Resources

I'm grateful to those who have made Game Boy documentations available to the public. I've learned a lot from them, and I could not have made this emulator without them. Here is a non-exhaustive list roughly categorized by topic of some of the resources I used:

CPU

PPU

APU

Timings

and, of course, Pan Docs.

About

A Game Boy emulator written in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published