Skip to main content
The core emulation engine in Source/Core/Core/ handles the fundamental hardware emulation for both GameCube and Wii systems.

Console Type Detection

Dolphin supports multiple console types defined in Core/Core.h:
enum class ConsoleType : u32
{
  // GameCube retail
  HW1 = 1,
  HW2 = 2,
  LatestProductionBoard = 3,
  
  // Wii retail  
  RVL_Retail1 = 0x21,
  RVL_Retail2 = 0x22,
  RVL_Retail3 = 0x23,
  
  // Development kits
  FirstDevkit = 0x10000004,
  NDEV2_0 = 0x10000020,
  // ... more devkit types
};
The console type affects:
  • Boot ROM behavior
  • Hardware capabilities
  • Memory map layout
  • Available peripherals

Hardware Components

The Core/HW/ directory contains emulation for all hardware subsystems:

Memory Interface

Location: Core/HW/MemoryInterface.cpp Emulates the memory controller:
  • Main RAM access (24 MB GameCube, 64 MB Wii)
  • Memory protection and address translation
  • Cache control
  • Memory refresh timing

Processor Interface

Location: Core/HW/ProcessorInterface.cpp Handles CPU-GPU communication:
  • Interrupt controller (32 interrupt sources)
  • Reset control
  • Console type configuration
  • Debug communication
Interrupt types:
// From ProcessorInterface.h
PE_TOKEN    = 0x01,  // GPU token
PE_FINISH   = 0x02,  // GPU draw done
VI          = 0x04,  // Vertical interrupt
DI          = 0x08,  // Disc interface
AI          = 0x10,  // Audio interface
DSP         = 0x20,  // DSP
MEM         = 0x40,  // Memory
// ... more interrupt types

Video Interface

Location: Core/HW/VideoInterface.cpp Emulates the video output controller:
  • Display timing generation
  • Vertical blank interrupts
  • Video mode configuration (NTSC, PAL, progressive)
  • XFB (External Framebuffer) management

Audio Interface

Location: Core/HW/AudioInterface.cpp Streams audio from RAM to output:
  • DMA from main RAM
  • Sample rate control (32 KHz default)
  • Audio interrupts
  • Streaming mode

Serial Interface (SI)

Location: Core/HW/SI/ GameCube controller port emulation:
  • 4 controller ports
  • Memory card slots (2 per controller)
  • GBA link cable support
  • Keyboard support
Supported device types:
  • Standard controller
  • GBA
  • Steering wheel
  • DK Bongos
  • GC Keyboard

EXI (External Interface)

Location: Core/HW/EXI/ Expansion port emulation:
  • Memory cards (slot A/B)
  • Broadband/modem adapter
  • Real-time clock
  • IPL/BIOS chip
  • Gecko code handler

DVD Interface

Location: Core/HW/DVD/ Disc drive emulation:
  • Disc reading and seeking
  • Drive authentication
  • Audio streaming from disc
  • Read commands and DMA

Boot Process

Location: Core/Boot/ The boot process depends on the game type:
1

Load IPL

Load GameCube BIOS (IPL.bin) or use HLE replacement
2

Initialize Hardware

Set up memory map, configure video mode
3

Load Boot ROM

Read boot.bin from disc image
4

Load DOL

Parse and load main executable (boot.dol or apploader → main.dol)
5

Start Execution

Jump to entry point and begin PowerPC execution

System Timing

Location: Core/HW/SystemTimers.cpp Dolphin uses a cycle-accurate timing system:
ComponentClock SpeedCycle Time
CPU486 MHz (GC/Wii)~2.06 ns
GPU162 MHz (GC), 243 MHz (Wii)~6.17 ns / ~4.12 ns
DSP81 MHz~12.35 ns
AI32 KHz sample rate31.25 μs
Timers synchronize:
  • Video interrupts (60 Hz NTSC, 50 Hz PAL)
  • Audio DMA
  • DSP communication
  • Peripheral polling

Configuration System

Location: Core/Config/ Hierarchical configuration with layers:
  1. Base layer: Dolphin.ini defaults
  2. Game layer: Per-game overrides (GameSettings/*.ini)
  3. Runtime layer: Temporary runtime changes
Configuration sections:
[Core]
CPUCore = 1              # 0=Interpreter, 1=JIT, 2=Cached Interpreter
CPUThread = True
SkipIdle = True
EnableDebugging = False

[DSP]
EnableJIT = True
DumpAudio = False
Backend = Cubeb

Save States

Full system state can be serialized:
  • All CPU registers (GPR, FPR, SPR, CR, etc.)
  • Main RAM contents (24/64 MB)
  • GPU state (registers, caches, command buffer)
  • DSP state (IRAM, DRAM, registers)
  • All hardware registers
  • Peripheral state (controllers, memory cards)
Binary format with version header:
// Simplified structure
struct SaveState {
  u32 version;
  u32 cpu_core_count;
  // Serialized component data...
};
Save states are not compatible across Dolphin versions due to internal changes. Use in-game saves for long-term storage.

Debugging Features

Location: Core/Debugger/ Built-in debugging tools:
  • Code Breakpoints: Break on PowerPC address execution
  • Memory Breakpoints: Watch RAM reads/writes
  • Logging: Per-component log levels
  • Disassembly: PowerPC instruction viewer
  • Register Inspector: CPU/GPU register display
  • Memory Viewer: RAM/cache browser
Enable with --debugger flag or in settings.

See Also