explaingit

victorgomes/gb

Analysis updated 2026-05-18

2CAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

A readable C emulator for the original Game Boy and Game Boy Color, running natively or in the browser, with accurate CPU, graphics, and sound emulation.

Mindmap

mindmap
  root((repo))
    What it does
      Emulates Game Boy and Color
      Runs natively or in browser
      Accurate CPU graphics and sound
    Tech stack
      C
      SDL3
      WebAssembly
    Use cases
      Play classic Game Boy ROMs
      Study emulator source code
      Local two player link cable play
    Audience
      Emulation hobbyists
      C developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Play original Game Boy and Game Boy Color ROMs natively or in a browser.

USE CASE 2

Study a readable C implementation of a cycle accurate CPU and pixel-FIFO PPU.

USE CASE 3

Play locally with a friend using the simulated link cable split screen mode.

What is it built with?

CSDL3WebAssembly

How does it compare?

victorgomes/gbalisharafiiii/sauron-eyecode-my-spec/ear_witness
Stars222
LanguageCCC
Setup difficultymoderatehardhard
Complexity4/55/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a C23 compiler and SDL3, installed via brew or apt, a web build needs the Emscripten SDK.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Leiksveinn GameBoy is an emulator that lets you play original Game Boy and Game Boy Color games on a computer or in a web browser. It is written in C and built to be readable and easy to modify, favoring straightforward code over layers of abstraction, with a companion architecture document that explains how the pieces fit together. Under the hood, it reimplements the original hardware's central processor, its pixel by pixel graphics processing, and its full four channel sound system, and the project reports passing a wide range of standard accuracy test suites used by the emulation community to validate correctness. It also supports Game Boy Color features, including color palettes and the higher speed mode those games can use, and it can be forced to run in a specific hardware mode if needed. A long list of cartridge types are supported as well, covering the different memory bank switching chips real Game Boy cartridges used, including ones with a built in real time clock for keeping track of in game time even when the game is off. Beyond emulating the console itself, it supports save files and full save states, screenshots, fast forwarding through gameplay, an on screen frames per second display, and even the physical Game Boy Printer accessory, with printed images saved as bitmap files. Two people can also play together locally using a simulated link cable connection, split across two windows. The emulator runs natively on a computer using SDL3, but it can also be compiled into WebAssembly to run directly inside a web browser, including as an installable app that keeps working offline, complete with on screen touch controls for playing on a phone. Importantly, this project does not include any actual Nintendo code or game files. You must supply your own game ROMs, which are never included in the repository. The emulator's own code is released under the MIT license, one of the most permissive open source licenses available.

Copy-paste prompts

Prompt 1
Help me build the gb emulator from source on macOS with SDL3.
Prompt 2
Explain how the pixel-FIFO PPU in this Game Boy emulator works.
Prompt 3
Help me compile the WebAssembly build of gb so it runs in my browser.
Prompt 4
Walk me through adding a new mapper type to this Game Boy emulator.

Frequently asked questions

What is gb?

A readable C emulator for the original Game Boy and Game Boy Color, running natively or in the browser, with accurate CPU, graphics, and sound emulation.

What language is gb written in?

Mainly C. The stack also includes C, SDL3, WebAssembly.

What license does gb use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is gb to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is gb for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.