Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/SMGCommunity/Petari/llms.txt

Use this file to discover all available pages before exploring further.

Super Mario Galaxy 1 sits on top of several layers of system software that are included in Petari’s source tree. The lowest layer is the RVL SDK — Nintendo’s official Wii platform SDK, covering the operating system, graphics hardware, audio DSP, input, networking, and more. Above that sits the Metrowerks Standard Library (MSL_C) and the CodeWarrior C++ runtime (Runtime), which provide the C standard library and C++ language support. Finally, MetroTRK is the Metrowerks Target Resident Kernel, a debugger stub embedded in shipping Wii executables to support on-target debugging.
The RVL SDK source in this repository is sourced from the doldecomp/sdk_2009-12-11 project. Credit goes to the doldecomp team for their SDK decompilation work.

RVL SDK (src/RVL_SDK/)

The RVL SDK exposes 36 subsystem directories. Most are used indirectly by the game layer through thin wrapper APIs. The table below lists every module found in the source tree.
ModulePurpose
osOperating system: threads, alarms, interrupts, memory, and IPC
viVideo interface: frame buffer management and video mode setup
gxGraphics: GX command buffer, display lists, and state management
gdGraphics display list helpers
mtxMatrix and vector math (hardware-accelerated PSQ instructions)
baseSDK initialization and version info
dbDebug output and assertions
ModulePurpose
axAX DSP audio mixer: voices, effects bus, and callback scheduling
axfxAX effect plug-ins (reverb, chorus, delay)
aiAudio interface: DMA to the audio DAC
dspDSP task queue and ARAM management
ModulePurpose
padGameCube controller input
wpadWii Remote input (core + extensions)
kpadWii Remote extension library (Nunchuk, Classic Controller)
siSerial interface — low-level controller communication
ModulePurpose
dvdDVD drive: file open, read, and async I/O
arcARC archive format (Nintendo’s ROM filesystem)
nandNAND flash filesystem
fsHigh-level filesystem abstraction
vfVirtual filesystem utilities
rsoRelocatable shared object loader
ModulePurpose
netTCP/IP networking stack
nwc24Nintendo Wi-Fi Connection 24 (WiiConnect24)
bteBluetooth stack (sourced from doldecomp/sdk_2009-12-11)
wudWii USB Dongle (wireless controller adapter)
usbUSB host driver
exiEXternal Interface — memory card and serial communications
ipcInter-processor communication between Broadway and Starlet
ModulePurpose
thpTHP video decoder
tplTexture palette library (.tpl texture format)
memExpanded heap allocators (frame heap, unit heap)
scSystem configuration (region, parental controls, etc.)
espe-Shop / save data protection
euartEXI UART (debug serial port)
wencWii encoder (video scaler/encoder)
araltARAM alternative access utilities

MSL_C — Metrowerks Standard Library (src/MSL_C/)

MSL_C is the C runtime library shipped with CodeWarrior and linked into every Wii executable. It provides the standard C library: printf/scanf family, malloc/free, string functions, math.h, locale, wide-character support, and file I/O adapters for the Wii’s DVD backend. Key source files: printf.c, scanf.c, alloc.c, mem_funcs.c, string.c, math_ppc.c, wprintf.c, ctype.c, float.c
// MSL_C plugs into the RVL SDK's DVD layer for file I/O.
// All standard FILE* operations ultimately call through dvd_fread / dvd_fwrite.
MSL_C files are generally considered infrastructure — they are either fully matched or excluded from active decompilation work. The focus of the Petari project is the game-specific code under src/Game/.

Runtime — CodeWarrior C++ runtime (src/Runtime/)

The CodeWarrior runtime provides the C++ language machinery that the compiler depends on but does not inline: global constructor and destructor chains, C++ exception handling (Nintendo’s NMWException / Gecko_ExceptionPPC), va_arg support, and the default operator new/operator delete implementations.
FilePurpose
__init_cpp_exceptions.cppRegisters the C++ exception fragment with the OS linker
global_destructor_chain.cDrives atexit-style global destructors at shutdown
NMWException.cppMetrowerks exception table walking
Gecko_ExceptionPPC.cppPPC-specific exception propagation
GCN_mem_alloc.cDefault heap allocator backing new/delete
ptmf.cPointer-to-member-function call thunks
__va_arg.cVariable-argument list support

MetroTRK — Metrowerks Target Resident Kernel (src/MetroTRK/)

MetroTRK is a compact debugger stub embedded directly in the game’s DOL binary. It communicates with the CodeWarrior IDE over a hardware connection (EXI or USB) and supports breakpoints, memory inspection, and register access. The stub is organized into debugger/ (the portable TRK core with OS and processor back-ends) and gamedev/ (the custom connection layer for the Wii target). In a shipping game, MetroTRK is present but largely inert — it initializes only when the debugger handshake is detected. Its decompilation is tracked alongside the other system libraries.

Build docs developers (and LLMs) love