Resources and links

Everything we read while building this, grouped by layer, with a note on what each one told us. Started 2026-11-03. Every external link was checked that day. dolphin-emu.org refuses scripted requests, but it opens fine in a browser.

Wii homebrew in general

  • WiiBrew: the community wiki. Start here for anything about the console, its hardware, or homebrew tools.
  • Homebrew Channel: the launcher homebrew runs from, and the apps/<name>/boot.dol + meta.xml layout it reads from SD or USB.
  • wii.hacks.guide: the softmod guide most people follow to install the Homebrew Channel.
  • wiiload: sends a .dol to the Homebrew Channel over the network. It ships in the devkitPPC image at /opt/devkitpro/tools/bin/wiiload.
  • Running GameCube homebrew on the Wii and Gcube: the Wii-mode versus GameCube-mode split. We target Wii mode, which is what gives us the Wiimote and MEM2.

Toolchain

Two toolchain facts that each cost a probe:

  • powerpc-eabi-gcc -mrvl defines __wii__, HW_RVL, __PPC__, PPC and __BIG_ENDIAN__, but not __powerpc__.
  • The image only puts devkitPPC on PATH for a login shell. docker run image cmd doesn't get it, so our scripts pass PATH explicitly.

Dolphin

  • Dolphin: installed with brew install --cask dolphin (build 2609a here). Dolphin --help lists the command-line options, and -C System.Section.Key=Value sets any config value for one run, which is how scripts/dolphin-shot turns on MMU emulation and logging without touching ini files.

Scripting Dolphin's emulated Wiimote

  • Dolphin Core.cpp, UpdateInputGate: every controller expression reads 0 while the game window isn't focused, unless background input is on.
  • Dolphin MainSettings.cpp: MAIN_INPUT_BACKGROUND_INPUT, Input.BackgroundInput, default false. We set it with -C Dolphin.Input.BackgroundInput=True.
  • Dolphin WiimoteEmu.cpp, Wiimote::LoadDefaults: the Mac's default mapping (left click A, right click B, arrows for the D-pad, Return for HOME, middle click to shake, no tilt keys).
  • Dolphin QuartzKeyboardAndMouse.mm: the Mac key names an expression can use, such as Space and Return.
  • Dolphin FunctionExpression.cpp: the functions a controller mapping can use (timer, sin, toggle, pulse, ...). timer(s) is a 0-to-1 sawtooth every s seconds.
  • Dolphin WiimoteSettings.cpp: Wiimote 1 defaults to the emulated source.

raylib

  • raylib: we vendor the 6.0 release source unmodified.
  • raylib #1732: an older GL 1.1 build regression. Not a problem in 6.0, but it explains why GL 1.1 builds are rare.
  • raylib-extras game-premake: the one place we found pairing raylib's SDL backend with GL 1.1.
  • No earlier raylib port to the Wii turned up on GitHub or WiiBrew.

The keyboard crash, source by source:

  • libwiikeyboard keyboard.c: KEYBOARD_Init returns before __lwp_queue_init_empty(&_queue) when USB init fails, and KEYBOARD_GetEvent doesn't check.
  • SDL SDL_ogcvideo.c: calls KEYBOARD_Init(NULL) and ignores the result.
  • SDL SDL_wii_main.c: SDL's own main for the Wii, which calls WPAD_Init(). A raylib app has to include SDL_main.h to get it.
  • SDL SDL_ogcevents.c: every remote's IR pointer is sent as the same SDL mouse.
  • SDL SDL_ogckeyboard.c: calls KEYBOARD_GetEvent every frame.
  • The only open libogc issue mentioning keyboards, #256, is about something else.

Chez Scheme

  • Chez Scheme: we build tag v10.4.1 from a local clone.
  • ChezScheme/BUILDING: the --pb, --pbarch and Emscripten sections, which describe portable bytecode and booting from embedded boot files.
  • ChezScheme/s/cmacros.ss: the machine type list where pb32b / tpb32b live.
  • ChezScheme/c/version.h: per-OS kernel configuration. The __EMSCRIPTEN__ branch is what our __wii__ branch is modelled on.
  • devkitPro newlib's sys/iosupport.h (in the image, and in devkitPro/newlib on the devkitPro branch): the __syscall_tls_* and __syscall_thread_detach hooks libogc leaves unimplemented.

jolt

  • jolt, and #375, the cross-compilation issue that produced jolt build --target.
  • jolt/tools/cross-compile/README.md: target packs, make-pack.sh, and the cross builds that were verified before this one.
  • jolt/host/chez/hasheq.ss: define-width-op and its comment about cross builds to narrower targets.
  • jolt's CHANGELOG.md, the #801 entry: the 32-bit hash engine fix, and the note that other host code still uses checked fx ops on int-width values.
  • jolt/host/chez/build.ss: the generated compile.ss and main.c, and where $JOLT_TARGET_CC, link-libs and the xpatch come in.

Prior art in our own trees

  • ~/dev/jlt-commons/raylib-ios: jolt on tpb64l with raylib and SDL2 statically linked, and the "who owns thread 0" design notes. The closest relative of this project.
  • jasalt/jolt-wasm-raylib-experiment: jolt on tpb32l under Emscripten. It found that jolt needs the threaded machine type (the non-threaded pb aborts at make-mutex), and it's where the #801 hash fix came from.

libogc source we read for the console bug

  • libogc/exi.c, WriteUARTN: rewrites \n to \r in the caller's buffer.
  • libogc/console.c, consolePrintChar: \n starts a new row, \r only returns to column 1.