How drhelius/gearboy works
Gearboy is a cross-platform Game Boy, Game Boy Color, and Super Game Boy emulator. The main workflow is loading a ROM through a desktop, iOS, or libretro frontend, running it in the shared emulation core, and presenting video/audio while accepting input. The graph also preserves documented debugger/MCP, link-cable, save-state, rewind, run-ahead, shader, and barcode capabilities. Relationships are limited to indexed references, shown calls, or README statements; some feature links are dashed where implementation wiring was not sampled.
Main entry points: GearboyCore.cpp Emulator core · emu.cpp Desktop emulator host · application.cpp Desktop application · RomListViewController.swift iOS ROM library
Components 32
User frontends
- Desktop entry
platforms/shared/desktop/main.cpp - Desktop application
platforms/shared/desktop/application.cpp - iOS ROM library
platforms/ios/Gearboy/RomListViewController.swift - iOS gameplay
platforms/ios/Gearboy/EmulationViewController.swift - iOS settings
platforms/ios/Gearboy/SettingsViewController.swift - iOS ROM store
platforms/ios/Gearboy/DataStore.swift - ROM metadata
platforms/ios/Gearboy/Rom.swift - Screen and controls
platforms/ios/Gearboy/GameControlsView.swift - iOS emulator bridge
platforms/ios/Gearboy/GearboyEmulator.h - Libretro core
platforms/libretro/libretro.cpp - Libretro API
platforms/libretro/libretro.h
Emulation core
- Emulator core
src/GearboyCore.cpp - Cartridge handling
src/Cartridge.cpp - Memory and mappers
src/Memory.cpp - CPU execution
src/Processor.cpp - Video rendering
src/Video.cpp - Audio synthesis
src/Audio.cpp
Desktop runtime
- Desktop emulator host
platforms/shared/desktop/emu.cpp - Desktop configuration
platforms/shared/desktop/config.cpp - Desktop interface
platforms/shared/desktop/gui.cpp
Emulator features
- Link cable
platforms/shared/desktop/link_cable/link_cable_manager.cpp - Save and rewind
platforms/shared/desktop/rewind.cpp - Run-ahead
platforms/shared/desktop/runahead.cpp - Shader chain
platforms/shared/desktop/ogl_shader_chain.cpp - Barcode Boy
src/BarcodeBoy.cpp
Debug interfaces
- Profiler
src/Profiler.cpp - Trace logger
src/TraceLogger.cpp - Desktop debugger UI
platforms/shared/desktop/gui_debug.cpp - MCP server
platforms/shared/desktop/mcp/mcp_manager.h
Other components
- Player
- AI debugging client
- Libretro frontend
Connections 34
- Player → Desktop entry: launches
README.md - Desktop entry → Desktop application: starts
platforms/shared/desktop/main.cpp - Desktop application → Desktop emulator host: updates
platforms/shared/desktop/application.cpp - Desktop application → Desktop configuration: uses
platforms/shared/desktop/application.cpp - Desktop application → Desktop interface: initializes
platforms/shared/desktop/application.cpp - Desktop emulator host → Emulator core: hosts
- Desktop interface → Player: presents controls
- Player → iOS ROM library: chooses ROM
platforms/ios/Gearboy/RomListViewController.swift - iOS ROM library → iOS ROM store: refreshes
platforms/ios/Gearboy/RomListViewController.swift - iOS ROM library → ROM metadata: lists
platforms/ios/Gearboy/RomListViewController.swift - iOS ROM library → iOS gameplay: opens gameplay
platforms/ios/Gearboy/RomListViewController.swift - Player → iOS settings: configures
platforms/ios/Gearboy/SettingsViewController.swift - iOS gameplay → Screen and controls: uses views
platforms/ios/Gearboy/EmulationViewController.swift - iOS gameplay → iOS emulator bridge: drives
- iOS emulator bridge → Emulator core: runs emulation
- Libretro frontend → Libretro core: calls core API
- Libretro core → Libretro API: implements API
platforms/libretro/libretro.cpp - Libretro core → Emulator core: uses shared core
platforms/libretro/libretro.cpp - Emulator core → Cartridge handling: loads cartridges
src/GearboyCore.cpp - Emulator core → Memory and mappers: configures memory
src/GearboyCore.cpp - Emulator core → CPU execution: runs CPU
src/GearboyCore.cpp - Emulator core → Video rendering: produces frames
src/GearboyCore.cpp - Emulator core → Audio synthesis: produces audio
src/GearboyCore.cpp - Emulator core → Profiler: profiles execution
- Emulator core → Trace logger: logs execution
- Desktop emulator host → Link cable: supports connection
- Desktop emulator host → Save and rewind: supports states
- Desktop emulator host → Run-ahead: supports prediction
- Desktop application → Shader chain: supports shaders
README.md - Emulator core → Barcode Boy: supports barcode input
README.md - Desktop interface → Desktop debugger UI: exposes debugger
README.md - Desktop debugger UI → Emulator core: inspects execution
README.md - AI debugging client → MCP server: sends debug requests
README.md - MCP server → Desktop emulator host: controls emulator
platforms/shared/desktop/mcp/mcp_manager.h