$ show OffBroadway/cubeboot
Cubeboot is a GameCube bootloader/firmware project that enhances the boot process by restoring customizable boot animations, enabling SD card-based software loading, and providing fallback mechanisms. It patches the system's Initial Program Loader (IPL) to inject custom functionality while maintaining compatibility with official hardware. The project supports multiple GameCube hardware revisions (NTSC/PAL variants), various storage adapters (SDGecko, SD2SP2, RP2040-based PicoBoot), and runtime configuration via INI files. Key features include boot animation customization (colors, logo replacement), button-triggered DOL loading, progressive scan support, and fallback to secondary bootloaders like Swiss. The architecture combines bare-metal C/assembly with modular components for filesystem access, ELF/DOL parsing, and hardware abstraction, built using the devkitPPC toolchain.
The LLM identified 4 files worth highlighting for reuse:
Universal File Fat (UFF) abstraction layer providing a unified API for both Petit FatFs and standard FatFs implementations. Enables runtime switching between FAT libraries via compile-time configuration, demonstrating clean separation of concerns and portable filesystem access in embedded systems.
Lightweight, single-header INI file parser (derived from rxi/ini) for runtime configuration loading. Zero-dependency, stack-based parsing with robust error handling, easily extractable to any C project needing simple configuration management.
Implementation of the PCG (Permuted Congruential Generator) algorithm for high-quality random number generation. Used for generating randomized boot animation colors via RTC entropy. Stateless, compact, and suitable for reuse in any project requiring cryptographically secure PRNGs.
State machine module for detecting button hold sequences (used to trigger alternative DOL loading). Implements debouncing, timing-based press detection, and configurable button mapping. Demonstrates reusable pattern for reliable input handling in bare-metal embedded systems.