Core Components
Core
Central emulation engine handling GameCube/Wii hardware
PowerPC CPU
CPU emulation with multiple execution backends
Video Backends
Graphics rendering through Vulkan, D3D, OpenGL, and Metal
Audio System
DSP emulation and audio output backends
IOS/HLE
Wii operating system emulation
Disc I/O
Game image loading and disc format support
Directory Structure
Dolphin’s source code is organized inSource/Core/ with these major components:
Emulation Pipeline
The emulation process flows through these stages:Boot
Game loading and system initialization from
Core/Boot/- Parse disc image format (ISO, RVZ, GCZ, WIA)
- Load system files (BIOS, IPL)
- Initialize hardware state
CPU Execution
PowerPC instruction execution via JIT or interpreter
- Fetch and decode PowerPC instructions
- Execute through JIT compiler or interpreter
- Handle exceptions and interrupts
Hardware Emulation
Emulate GameCube/Wii hardware components
- GPU: Graphics FIFO, texture cache, shader generation
- DSP: Audio processing (HLE or LLE)
- Memory: Main RAM, embedded framebuffer, texture memory
- Peripherals: Controllers, memory cards, sensors
State Management
Dolphin manages emulation state through theCore::State enum:
Source/Core/Core/Core.cpp.
System Class
TheCore::System class (defined in Core/System.h) serves as the central coordination point:
- Owns all hardware component instances
- Manages component lifecycle
- Provides access to memory, CPU, GPU subsystems
- Coordinates save states and serialization
Thread Model
Dolphin uses multiple threads for performance:| Thread | Purpose |
|---|---|
| CPU Thread | PowerPC emulation, main game logic |
| GPU Thread | Graphics command processing |
| Audio Thread | DSP emulation and audio output |
| Video Backend Thread | API-specific rendering |
| EXI Thread | GameCube peripherals (memory cards, GBA link) |
The CPU thread is the authoritative thread. All other threads synchronize with it to maintain determinism.
Platform Abstraction
Platform-specific code is isolated in:- Video backends: Vulkan (cross-platform), D3D11/D3D12 (Windows), OpenGL (cross-platform), Metal (macOS/iOS)
- Audio backends: Cubeb (cross-platform), WASAPI (Windows), PulseAudio/ALSA (Linux), AudioUnit (macOS)
- UI frontends: DolphinQt (Qt, cross-platform), DolphinNoGUI (headless)
- Input backends: SDL, DInput, XInput, evdev
Build System
Dolphin uses CMake for cross-platform builds:ENABLE_QT: Build Qt GUI (default ON)ENABLE_NOGUI: Build headless frontend (default ON)ENABLE_VULKAN: Vulkan backend support (default ON)ENABLE_LTO: Link-time optimization (default OFF)
Performance Optimizations
JIT Compilation
JIT Compilation
PowerPC code is compiled to native x86-64 or ARM64 for speed. The JIT supports:
- Block compilation with register allocation
- Paired-single SIMD optimization
- MMU fastmem for direct memory access
Texture Cache
Texture Cache
Caches decoded textures to avoid redundant uploads:
- Hash-based lookup
- Lazy invalidation
- Arbitrary mipmap detection
Shader Cache
Shader Cache
Precompiled shaders stored on disk:
- Reduces stuttering
- Pipeline state objects
- Background compilation