$ show GaryOderNichts/Bloopair
Bloopair is a Wii U homebrew project that enables the use of third-party Bluetooth controllers (Nintendo Switch Pro/Joy-Con, Xbox One, DualShock 3/4, DualSense) on the console. It achieves this by patching the Wii U's IOS (the ARM-based operating system that handles Bluetooth) at runtime via a kernel exploit. The project consists of four main components: a loader that triggers the exploit and installs custom ARM code into IOS; an IOS kernel module that patches kernel error handlers and maps memory; an IOS pad module that intercepts Bluetooth HID reports, converts them to the Wii U Pro Controller format, and manages controller pairing and configuration; and a companion GUI application (Koopair) that allows users to test controllers, remap buttons and sticks, and manage per-controller settings. The system communicates between the PowerPC (PPC) application and the patched IOS via a custom IPC library (libbloopair). The architecture is modular: the loader is a one-shot exploit, the IOS modules are injected binary blobs, and the Koopair app is a standard SDL2-based homebrew application. The controller drivers are implemented as a set of function pointers (init, data, rumble, etc.) per controller type, providing a clean abstraction. The configuration system uses a linked list of entries with fallback logic, supporting per-controller-type and per-BDA settings. The project demonstrates significant reverse engineering of the Wii U's Bluetooth stack, including Wiimote cryptography, SDP, and HID report parsing. It is actively maintained with recent commits and CI builds, though it relies on hardcoded memory addresses specific to certain firmware versions, making it fragile but stable on the frozen Wii U platform.
The LLM identified 3 files worth highlighting for reuse:
Provides a clean, general-purpose IPC library for communicating with the patched IOS module. Exposes functions like Bloopair_Open, Bloopair_AddControllerPairing, Bloopair_GetControllerInformation, and Bloopair_ReadControllerData. It abstracts the low-level ioctlv calls and can be reused by any Wii U homebrew application that needs to interact with the custom Bluetooth stack. The API is well-defined and independent of the internal IOS implementation.
Implements the controller driver for Nintendo Switch controllers (Pro, Joy-Con, generic, N64). Demonstrates a reusable driver pattern: a struct with function pointers for init, data, rumble, setPlayerLed, deinit, and update. Contains detailed HID report parsing, calibration logic, and SPI flash reading. The code is self-contained and could be extracted as a reference for implementing HID drivers on embedded systems. It shows non-obvious skill in reverse-engineering the Switch controller protocol.
Implements a flexible configuration system using a linked list of ConfigurationEntry structs. Supports fallback, per-controller-type, and per-BDA (Bluetooth device address) configurations. Includes functions for loading, saving, and applying configurations. The design is generic and could be reused in any embedded project that needs hierarchical, overridable settings. It demonstrates clean data structure design and memory management in a constrained environment.