EmuGBSharp is an educational Game Boy (DMG) emulator written in C# using Windows Forms. It is intended as a readable reference for learning about CPU emulation, memory banking, graphics timing, input, and Game Boy audio—not as a replacement for mature emulators.
- Passes Blargg's CPU instruction tests.
- Supports plain cartridges and MBC1 banking, including ROMs larger than 32 KB.
- Implements the four-shade DMG display and four audio channels.
- Audio timing and accuracy remain experimental.
- Tested with BGBtest, Tetris, and Super Mario Land.
Game Boy Color features and serial/link-cable transfers are not implemented.
- Windows
- .NET 10 SDK
dotnet build EmuGBSharp.sln
dotnet run --project EmuGBSharp.csproj -- "C:\path\to\game.gb"You can also drag a ROM file onto the built executable. When no path is supplied, the fallback ROM configured in MainForm_Load is loaded.
| Keyboard | Game Boy |
|---|---|
| Arrow keys | D-pad |
| A | A |
| S | B |
| Backspace | Start |
| Enter | Select |
The emulator is a hand-written interpreter. Program opens MainForm, which owns an Emulator composed of the CPU, video, memory, cartridge, and sound components.
Cpu.csfetches and executes instructions and advances timers.Memory.csacts as the system bus and handles memory-mapped I/O, MBC1 banking, DMA, palettes, timers, and sound triggers.Video.csmodels scanline states and renders the framebuffer.Sound.csimplements a pull-based four-channel APU using NAudio.MainForm.cshandles ROM loading, keyboard input, the emulation worker, and framebuffer presentation.
There is currently no automated test project. CPU correctness is checked with Blargg test ROMs; the commented test list in MainForm_Load records the known results.
See LICENSE.txt.