A Go library of reusable components for retro-computing tools: emulators, debuggers, disassemblers, and system-specific utilities.
- CPU emulation - Chip-8, 6502-family, and Z80 emulators with tested instruction implementations
- Instruction definitions - x86 definitions from the 8086 through the 80486 for static analysis tools
- System helpers - NES cartridge, mapper, register, and parameter support
- CGO-free GUI support - Cross-platform rendering through SDL3 with SDL2 fallback on Linux, Windows, macOS, and FreeBSD
- CGO-free audio support - PCM playback through SDL3 with SDL2 fallback, concurrency-safe controls, and asynchronous error reporting
- MCP server toolkit - Model Context Protocol server that exposes tools, resources, and prompts through stdio or streamable HTTP
- Tooling utilities - Packages for CLI applications, configuration, structured logging, input, assertions, and sets
- Small dependency footprint - Go 1.25+ with only
ebitengine/puregoas an external dependency
Add the module to an existing Go project:
go get github.com/retroenv/retrogolibThen import the package needed by your tool:
import "github.com/retroenv/retrogolib/arch/cpu/cpu6502"├─ app common application and service helpers
├─ arch shared architecture constants and types
│ ├─ cpu
│ │ ├─ chip8 Chip-8 virtual machine
│ │ ├─ cpu6502 MOS 6502-family emulator, including NMOS and 65C02 variants
│ │ ├─ x86 Intel x86 instruction definitions from 8086 through 80486
│ │ └─ z80 Zilog Z80 emulator, including prefixed and undocumented opcodes
│ └─ system/nes Nintendo Entertainment System support
│ ├─ cartridge .nes ROM loading and saving
│ ├─ codedatalog Raw FCEUX NES code/data logs
│ ├─ parameter assembler-compatible instruction parameter formatting
│ └─ register NES memory-register constants
├─ assert test assertion helpers
├─ audio PCM formats and playback controls
│ ├─ sdl2 SDL2 audio backend
│ └─ sdl3 SDL3 audio backend
├─ buildinfo release metadata reading and version formatting
├─ cli subcommands, aliases, global flags, and positional arguments
├─ config configuration loading, parsing, and persistence
├─ gui CGO-free GUI rendering abstractions
│ ├─ internal/framebuffer frame-buffer helpers for GUI backends
│ ├─ sdl2 SDL2 GUI backend
│ └─ sdl3 SDL3 GUI backend
├─ host frame presentation, audio playback, and headless operation
├─ input keyboard and controller input helpers
├─ internal shared dynamic-library, SDL subsystem, and renderer registry helpers
├─ log nil-safe structured logging built on log/slog
├─ mcp Model Context Protocol server for tools, resources, and prompts
├─ renderer shared types to register and select audio and GUI renderers
└─ set generic set data structures and operations
For package-level APIs and examples, see the Go package documentation.