trekawek/coffee-gb

Accurate Gameboy Color emulator.

Java

1,172

1,579 commits

updated Oct 1, 2026

See the code

README

Coffee GB

A highly compatible Game Boy and Game Boy Color emulator for the desktop.

Coffee GB running Tetris DX

Coffee GB emulates the original Game Boy (GB/DMG) and Game Boy Color (GBC/CGB). It is built for high compatibility across the historic game library, unusual cartridges and accessories, and modern homebrew, demos, and diagnostic ROMs. The reusable emulation core is written in Java; the desktop application and its orchestration layer use Kotlin and Java.

Download the latest Coffee GB release

Features

  • Game Boy and Game Boy Color emulation, with Super Game Boy borders and palettes.
  • High compatibility across commercial games, unusual cartridges, homebrew, demos, and diagnostic ROMs.
  • Save states and rewind, including ten save slots, named states, previews, autosave and resume, BESS state interchange, screenshots, deterministic input recordings, and battery-backed saves.
  • Easy game loading with drag and drop and support for .gb, .gbc, and .rom files, either directly or from ZIP and 7z archives.
  • Rollback netplay for link-cable games, with synchronized infrared communication through CGB and HuC-1/HuC-3 cartridge hardware.
  • GBKiss Link for sending and receiving .gbf files through the cartridge's infrared port.
  • Customizable display and sound, including fullscreen, scaling, rotation, grayscale, color correction, LCD ghosting, audio-device selection, and volume and latency controls.
  • Keyboard and game-controller support, including independent controls for up to four players in compatible Super Game Boy games.
  • Broad cartridge and accessory support, including real-time clocks, rumble, tilt controls, Game Boy Camera, Game Boy Printer, Barcode Boy, Bardigun Reader, Full Changer, Pocket Sonar, Turbo File GB/Advance, Singer/Jaguar sewing machines, and Datel Action Replay pass-through.
  • Game Genie and GameShark cheats, with a bundled searchable libretro cheat database.

ROM files are not included.

Controls

Default keyboard controls:

ActionKey
D-padArrow keys
A / BZ / X
Start / SelectEnter / Shift
Open menu / resume paused gameEsc
PauseSpace
Save / load stateF5 / F7
Take screenshotF12
Start input recordingCtrl/Cmd+Shift+R
RewindHold Backspace
Toggle fullscreenF11

Keyboard and game-controller bindings can be changed in File > Preferences…. The same window contains display, sound, and save settings. On macOS, game-controller input requires a compatible system SDL2 installation; keyboard input works without it.

Use Game > Manage States… to choose among the ten save slots, name states, preview them, and export them. Autosave and resume settings are under File > Preferences… > Saves & Rewind. See save states, autosave, screenshots, input recording, and rewind for more details. Pause, save states, and rewind are unavailable during netplay.

Use File > Load BESS state and File > Save BESS state to exchange states with other BESS-compatible emulators. Open the matching ROM first; see the BESS compatibility notes.

Compatibility

Compatibility is a defining feature of Coffee GB. Its test profiles exercise 5,858 automated verdicts from 17 suite families, covering all popular Game Boy and Game Boy Color test suites, and every verdict passes. Coffee GB also earns the maximum score in GBEmulatorShootout.

Every exact-reference image suite is pixel-perfect: both Acid2 tests, CGB-ACID-HELL, Strikethrough, all four CasualPokePlayer tests, and all 24 Mealybug Tearoom tests.

Detailed compatibility results
Test suiteCases exercisedCurrent result
Blargg5454 / 54 pass*
Mooneye Test Suite130130 / 130 selected cases pass
RTC3Test33 / 3 menus pass
SameSuite7171 / 71 later-revision cases pass
Gambatte HWTests4,6744,674 / 4,674 canonical DMG/CGB verdicts match hardware
BullyGB22 / 2 DMG and CGB cases pass
MBC30Test11 / 1 ROM banking and SRAM case passes
GBEmulatorShootout — specific tests9Maximum score; 8 / 8 images and the ROM+RAM test pass
DMG-ACID2 and CGB-ACID222 / 2 are pixel-perfect
CGB-ACID-HELL11 / 1 is pixel-perfect
Strikethrough11 / 1 is pixel-perfect
CasualPokePlayer test ROMs44 / 4 are pixel-perfect
Mealybug Tearoom2424 / 24 are pixel-perfect
GBMicrotest482482 / 482 machine-readable verdicts pass; 31 additional diagnostics have no automated verdict
DocBoy Test Suite162162 / 162 selected machine-readable DMG, CGB, and CGB-in-DMG-mode verdicts pass
gbc-hw-tests221221 / 221 selected hardware-reference verdicts match exactly
Misc.-GB-Tests1717 / 17 pass verdicts match
Total5,8585,858 / 5,858 automated verdicts pass

* Blargg's aggregate and individual checks overlap by design.

Every automated case must produce its documented pass value, match its selected external hardware reference, or satisfy its upstream image oracle. The source revisions, archive membership, hardware models, and ROM revisions used by these profiles are fixed for reproducibility. GBMicrotest's 31 non-verdict diagnostics are tracked separately and are not included in the 5,858 automated verdicts.

Netplay

For link-cable multiplayer, open Game > Netplay…. One player selects Host > Start hosting; the other selects Join, enters the host's address, and selects Join game. Netplay uses a direct, unencrypted TCP connection, so play only with people and networks you trust. When a game is running under an SGB or SGB2 profile, starting or joining netplay restarts that game in DMG mode for the current session without changing the saved hardware-profile preference.

Project history

Coffee GB began as a six-week deep dive into how a small computer works. The 2017 origin story covers the CPU, pixel pipeline, audio, early compatibility testing, and first GBC implementation. The later rollback-netplay article explains how per-frame snapshots made high-latency link play practical.

DateMilestone
31 Dec 2016The project starts.
14 Jan 2017The first playable version runs Tetris, two weeks after the initial commit.
5–7 Feb 2017Game Boy Color support lands with double-speed mode, banked RAM and VRAM, color graphics, and the GBC boot path.
22 Dec 2017Coffee GB 1.0.0 is released.
29 Feb 2024Save-state support is added.
Jul 2025Fast mementos enable rollback netplay, released in 1.5.0.
Aug 2025Super Game Boy borders and palettes arrive alongside Super Game Boy command support and predefined game palettes.

Kudos

Coffee GB owes a great deal to the Game Boy hardware research community and to the authors of every test suite linked above.

Thanks to:

  • The authors and contributors of SuperSnes9x for their research, testing, and documentation of Game Boy and Game Boy Color link cable compatibility.
  • Shonumi for detailed research into Game Boy hardware and peripherals in the Edge of Emulation series.
  • @ScottNash042 for issue reports and feature suggestions.

License

Coffee GB is available under the MIT License.

emulator
gameboy
gameboy-emulator
z80

trekawek/coffee-gb

Accurate Gameboy Color emulator.

Java

1,172

1,579 commits

updated Oct 1, 2026

See the code

README

Coffee GB

A highly compatible Game Boy and Game Boy Color emulator for the desktop.

Coffee GB running Tetris DX

Coffee GB emulates the original Game Boy (GB/DMG) and Game Boy Color (GBC/CGB). It is built for high compatibility across the historic game library, unusual cartridges and accessories, and modern homebrew, demos, and diagnostic ROMs. The reusable emulation core is written in Java; the desktop application and its orchestration layer use Kotlin and Java.

Download the latest Coffee GB release

Features

  • Game Boy and Game Boy Color emulation, with Super Game Boy borders and palettes.
  • High compatibility across commercial games, unusual cartridges, homebrew, demos, and diagnostic ROMs.
  • Save states and rewind, including ten save slots, named states, previews, autosave and resume, BESS state interchange, screenshots, deterministic input recordings, and battery-backed saves.
  • Easy game loading with drag and drop and support for .gb, .gbc, and .rom files, either directly or from ZIP and 7z archives.
  • Rollback netplay for link-cable games, with synchronized infrared communication through CGB and HuC-1/HuC-3 cartridge hardware.
  • GBKiss Link for sending and receiving .gbf files through the cartridge's infrared port.
  • Customizable display and sound, including fullscreen, scaling, rotation, grayscale, color correction, LCD ghosting, audio-device selection, and volume and latency controls.
  • Keyboard and game-controller support, including independent controls for up to four players in compatible Super Game Boy games.
  • Broad cartridge and accessory support, including real-time clocks, rumble, tilt controls, Game Boy Camera, Game Boy Printer, Barcode Boy, Bardigun Reader, Full Changer, Pocket Sonar, Turbo File GB/Advance, Singer/Jaguar sewing machines, and Datel Action Replay pass-through.
  • Game Genie and GameShark cheats, with a bundled searchable libretro cheat database.

ROM files are not included.

Controls

Default keyboard controls:

ActionKey
D-padArrow keys
A / BZ / X
Start / SelectEnter / Shift
Open menu / resume paused gameEsc
PauseSpace
Save / load stateF5 / F7
Take screenshotF12
Start input recordingCtrl/Cmd+Shift+R
RewindHold Backspace
Toggle fullscreenF11

Keyboard and game-controller bindings can be changed in File > Preferences…. The same window contains display, sound, and save settings. On macOS, game-controller input requires a compatible system SDL2 installation; keyboard input works without it.

Use Game > Manage States… to choose among the ten save slots, name states, preview them, and export them. Autosave and resume settings are under File > Preferences… > Saves & Rewind. See save states, autosave, screenshots, input recording, and rewind for more details. Pause, save states, and rewind are unavailable during netplay.

Use File > Load BESS state and File > Save BESS state to exchange states with other BESS-compatible emulators. Open the matching ROM first; see the BESS compatibility notes.

Compatibility

Compatibility is a defining feature of Coffee GB. Its test profiles exercise 5,858 automated verdicts from 17 suite families, covering all popular Game Boy and Game Boy Color test suites, and every verdict passes. Coffee GB also earns the maximum score in GBEmulatorShootout.

Every exact-reference image suite is pixel-perfect: both Acid2 tests, CGB-ACID-HELL, Strikethrough, all four CasualPokePlayer tests, and all 24 Mealybug Tearoom tests.

Detailed compatibility results
Test suiteCases exercisedCurrent result
Blargg5454 / 54 pass*
Mooneye Test Suite130130 / 130 selected cases pass
RTC3Test33 / 3 menus pass
SameSuite7171 / 71 later-revision cases pass
Gambatte HWTests4,6744,674 / 4,674 canonical DMG/CGB verdicts match hardware
BullyGB22 / 2 DMG and CGB cases pass
MBC30Test11 / 1 ROM banking and SRAM case passes
GBEmulatorShootout — specific tests9Maximum score; 8 / 8 images and the ROM+RAM test pass
DMG-ACID2 and CGB-ACID222 / 2 are pixel-perfect
CGB-ACID-HELL11 / 1 is pixel-perfect
Strikethrough11 / 1 is pixel-perfect
CasualPokePlayer test ROMs44 / 4 are pixel-perfect
Mealybug Tearoom2424 / 24 are pixel-perfect
GBMicrotest482482 / 482 machine-readable verdicts pass; 31 additional diagnostics have no automated verdict
DocBoy Test Suite162162 / 162 selected machine-readable DMG, CGB, and CGB-in-DMG-mode verdicts pass
gbc-hw-tests221221 / 221 selected hardware-reference verdicts match exactly
Misc.-GB-Tests1717 / 17 pass verdicts match
Total5,8585,858 / 5,858 automated verdicts pass

* Blargg's aggregate and individual checks overlap by design.

Every automated case must produce its documented pass value, match its selected external hardware reference, or satisfy its upstream image oracle. The source revisions, archive membership, hardware models, and ROM revisions used by these profiles are fixed for reproducibility. GBMicrotest's 31 non-verdict diagnostics are tracked separately and are not included in the 5,858 automated verdicts.

Netplay

For link-cable multiplayer, open Game > Netplay…. One player selects Host > Start hosting; the other selects Join, enters the host's address, and selects Join game. Netplay uses a direct, unencrypted TCP connection, so play only with people and networks you trust. When a game is running under an SGB or SGB2 profile, starting or joining netplay restarts that game in DMG mode for the current session without changing the saved hardware-profile preference.

Project history

Coffee GB began as a six-week deep dive into how a small computer works. The 2017 origin story covers the CPU, pixel pipeline, audio, early compatibility testing, and first GBC implementation. The later rollback-netplay article explains how per-frame snapshots made high-latency link play practical.

DateMilestone
31 Dec 2016The project starts.
14 Jan 2017The first playable version runs Tetris, two weeks after the initial commit.
5–7 Feb 2017Game Boy Color support lands with double-speed mode, banked RAM and VRAM, color graphics, and the GBC boot path.
22 Dec 2017Coffee GB 1.0.0 is released.
29 Feb 2024Save-state support is added.
Jul 2025Fast mementos enable rollback netplay, released in 1.5.0.
Aug 2025Super Game Boy borders and palettes arrive alongside Super Game Boy command support and predefined game palettes.

Kudos

Coffee GB owes a great deal to the Game Boy hardware research community and to the authors of every test suite linked above.

Thanks to:

  • The authors and contributors of SuperSnes9x for their research, testing, and documentation of Game Boy and Game Boy Color link cable compatibility.
  • Shonumi for detailed research into Game Boy hardware and peripherals in the Edge of Emulation series.
  • @ScottNash042 for issue reports and feature suggestions.

License

Coffee GB is available under the MIT License.

emulator
gameboy
gameboy-emulator
z80

Project health

Latest release

2.1.7 · Oct 2, 2026

Releases this year

35

Significant stargazers

Fabien Villepinte

34 followers · starred May 2018

pyfisch

50 followers · starred Feb 2018

Brett Morgan

1,132 followers · starred Apr 2022

Nick Desaulniers

981 followers · starred Mar 2018