Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Platform:Nintendo GameCube

From ReverseEngineering.wiki
Platform
Vendor Nintendo
Uses Library:Dolphin SDK, Library:JSystem
Versions DOL-001, DOL-101; Wii (backward compatible, same formats)
Endianness big
On this wiki Facts · Code · Notes · Topics

Nintendo's sixth-generation home console (2001 JP/NA, 2002 EU), code-named Dolphin. An IBM Gekko CPU (PowerPC 750 derivative with paired-single floating point, big endian) and the Flipper GPU share 24 MiB of 1T-SRAM mapped at 0x80000000 (cached) and 0xC0000000 (uncached); hardware registers sit at 0xCC000000. Games are a main executable (sys/main.dol, Format:DOL executable) plus optional Format:REL relocatable modules, built with Tool:Metrowerks CodeWarrior against the Library:Dolphin SDK.

Overview

The GameCube (development name Dolphin, hence the SDK's dolphin/ headers and the emulator's name) runs one program at a time with no operating system beyond the SDK's OS library linked into the game. Everything a reverse engineer meets is big endian.

  • CPU: IBM Gekko, a PowerPC 750CXe derivative (32-bit PowerPC, -proc gekko in CodeWarrior) with paired singles: two 32-bit floats in one FPR, loaded and stored through quantization registers GQR0-GQR7 (set up by __OSPSInit at boot).
  • Memory: 24 MiB main RAM (0x1800000, the size checked in OSMemory.c), visible at 0x80000000-0x817FFFFF cached and 0xC0000000-0xC17FFFFF uncached through BAT registers; 16 MiB auxiliary RAM (ARAM) reachable only by DMA (AR*/ARQ* functions, JSystem's JKRAram*).
  • Hardware registers: 0xCC000000 and up, e.g. Processor Interface 0xCC003000 (interrupt cause/mask), Memory Interface 0xCC004000, DSP/ARAM DMA 0xCC005000, Audio Interface 0xCC006C00 (all from the decompiled SDK headers).
  • Discs: miniDVD-based optical discs; the first 0x20 bytes of the disc header are the DVDDiskID that the boot ROM copies to 0x80000000.

The Wii (Broadway CPU, a faster Gekko) runs the same DOL/REL formats and SDK lineage (Revolution SDK); most of this page applies to Wii games too. Unverified for Wii-specific memory (MEM2 at 0x90000000).

Game IDs

Every disc has a 6-character ID: a 4-character game code and a 2-character maker code (the game_name[4] and company[2] fields of DVDDiskID). The first letter is the console/type (G GameCube game, D demo/kiosk disc), the last letter of the game code is the region (E USA, P PAL, J Japan), and 01 is Nintendo. Example: GZLE01 = Software:The Legend of Zelda: The Wind Waker, USA. Decompilation projects name their configuration directories after this ID.

Low memory (OS globals)

The boot ROM and apploader leave an OSBootInfo block at 0x80000000 (disc ID 0x00-0x1F, boot code 0x0D15EA5E at 0x20, version 0x24, physical memory size 0x28, console type 0x2C, arena low/high 0x30/0x34, FST location 0x38, FST max length 0x3C). Other fixed addresses the SDK reads: exception mask 0x80000044, physical/current OSContext pointers 0x800000C0/0x800000D4, current FPU context 0x800000D8, thread queue 0x800000DC, current thread 0x800000E4, BI2 (debug info) pointer 0x800000F4, bus clock 0x800000F8, core clock 0x800000FC, REL module list 0x800030C8, REL string table 0x800030D0, system time 0x800030D8, PAD3 buttons 0x800030E4, DVD device code 0x800030E6, debug flag 0x800030E8. The timer (time base) runs at bus clock / 4.

Boot and startup

The IPL (boot ROM) loads the disc's apploader, which loads sys/main.dol sections to their addresses and jumps to the DOL entry point, normally __start in .init (DOL text section 0 at 0x80003100). __start (CodeWarrior runtime + SDK, __start.c):

  1. __init_registers: r1 = _stack_addr, r2 = _SDA2_BASE_, r13 = _SDA_BASE_ (the PowerPC EABI small-data anchors; code addresses .sdata/.sbss as r13 + d and .sdata2/.sbss2 as r2 + d).
  2. __init_hardware: enables the FPU, __OSPSInit (paired singles, GQRs), __OSCacheInit.
  3. __init_data: copies sections listed in _rom_copy_info and zeroes the ones in _bss_init_info.
  4. Optionally starts the MetroTRK debug monitor, then DBInit, OSInit, __init_user (C++ static constructors from .ctors), main(argc, argv), exit.

Recognizing these in a stripped DOL gives r2/r13 immediately, which a disassembler needs to resolve every small-data access: see the byte signature of __init_registers on Library:Dolphin SDK.

File formats

  • Format:DOL executable: the main executable (no magic; a 0x100-byte header with 7 text and 11 data sections).
  • Format:REL relocatable module: dynamically linked modules (.rel, loaded by OSLink).
  • Format:Yaz0 and Format:Yay0: Nintendo's LZ compression (.szs, .yaz0; Yay0 in earlier SDK titles).
  • Format:RARC archive: JSystem's resource archive (.arc), often Yaz0-compressed.
  • Disc images: GCM/ISO (1:1 dump) with a file system table (FST) located through OSBootInfo; not covered here yet.

Decompilation projects

Matching decompilations (Technique:Matching decompilation) of GameCube games use decomp-toolkit (dtk) to split the DOL and RELs, Metrowerks CodeWarrior (GC/1.x) through wibo on Linux/macOS, and objdiff. Each project keeps config/<GAMEID>/build.sha1 (SHA-1 of every original DOL/REL), config/<GAMEID>/symbols.txt (one line per symbol: name = .section:0xADDRESS; // type:function size:0x40 scope:global) and splits.txt (address ranges of every source file): together an exact memory map of that build. Projects under CC0-1.0 include zeldaret/tww, zeldaret/tp, PrimeDecomp/prime, projectPiki/pikmin2, doldecomp/sms, bfbbdecomp/bfbb and Cuyler36/ac-decomp (checked on GitHub 2026-10-17).

Code & repositories

  • https://github.com/zeldaret/tww @ 8b93b372dc8e841f12ddfb7e0215626f62b05417 · license: CC0-1.0
    Matching decompilation of The Wind Waker for all GameCube releases (GZLE01, GZLP01, GZLJ01, D44J01), CC0-1.0. Decompiled JSystem (JKernel archives and Yaz0/Yay0 decoders), Dolphin SDK (OS, OSLink REL linker, DVD, GX), CodeWarrior runtime; config/<ID>/build.sha1, symbols.txt and splits.txt map every build.
    Tested on: Read at commit 8b93b37: config/GZLE01 (build.sha1, config.yml, symbols.txt, splits.txt), include/dolphin/os/OSLink.h, src/dolphin/os/OSLink.c, src/dolphin/os/__start.c, include/JSystem/JKernel/JKRArchive.h, src/JSystem/JKernel/JKRDecomp.cpp, JKRArchivePri.cpp, JKRCompArchive.cpp; no game files used. · checked 2026-10-17; last activity 2026-10-14
  • https://github.com/encounter/decomp-toolkit @ 0645e16511814920ffb05b25615dd71f1af73e4c · license: Apache-2.0
    decomp-toolkit (dtk, Rust, MIT OR Apache-2.0): splits GameCube/Wii DOLs and RELs into objects for matching decompilations, reads and writes DOL, REL, RARC, U8, Yaz0/Yay0 and the CodeWarrior .comment section, and generates symbols.txt/splits.txt configurations.
    Tested on: Read at commit 0645e16: src/util/dol.rs (DolHeader), src/util/rel.rs (R_DOLPHIN_* types), src/util/rarc.rs, src/util/comment.rs; not built. · checked 2026-10-17; last activity 2026-09-10; Note: the latest release ships binaries; the wiki links only the source, never the binaries

Open questions

  • Disc image layout (boot.bin, bi2.bin, apploader, FST) has no page yet.