Skip to content

fix(config): add Mayflash GameCube Controller Adapter Support - #694

Open
spenoff wants to merge 1 commit into
ShadowBlip:mainfrom
spenoff:fix/mayflash-gamecube-adapter
Open

fix(config): add Mayflash GameCube Controller Adapter Support#694
spenoff wants to merge 1 commit into
ShadowBlip:mainfrom
spenoff:fix/mayflash-gamecube-adapter

Conversation

@spenoff

@spenoff spenoff commented Sep 4, 2026

Copy link
Copy Markdown

This adapter's HID report descriptor declares its top-level collection as Usage(Joystick) [0x04] rather than Usage(Gamepad) [0x05], with its 16 face/shoulder buttons reported as a plain bitmask under the generic Button usage page. Because of this, the Linux kernel assigns the legacy joystick-era evdev codes BTN_TRIGGER (0x120) through BTN_DEAD (0x12f) to these buttons instead of the modern gamepad codes (BTN_SOUTH/0x130 etc.) that InputPlumber's generic evdev translation recognizes, so none of this adapter's face/shoulder buttons produced any input at all.

Adds:

  • A capability map + device profile for this adapter, with the bit-to- button layout empirically confirmed on real hardware (adapter in PC/ DInput mode) by pressing each button in complete isolation and watching the translated output - not inferred from the original GameCube console protocol, which does not match this adapter's actual bit order.
  • Three new EventCode variants (evdev codes 0x12c-0x12e) which have no symbolic name in the Linux kernel headers but are legitimately reported by this class of hardware.
  • A test validating both new config files parse correctly and that capability_map_id is set on the source_devices entry itself, not just at the CompositeDeviceConfig level - only the former actually wires up per-event translation at runtime.

Co-developed-by: Claude Sonnet 5

AI disclosure: this fix was developed interactively with Claude Code (Sonnet 5) over an extended debugging session. The root-cause diagnosis (HID Joystick vs Gamepad usage causing legacy evdev codes) was Claude's own investigation of the InputPlumber source. The bit-to-button mapping in the capability map was NOT AI-inferred - it was determined empirically by the human author pressing each physical button on real hardware in isolation while Claude captured and reported the resulting translated evdev output; several early AI-generated assumptions about the bit layout (based on the original GameCube console protocol) turned out to be wrong and were corrected only after the human author pushed back and asked for further isolated testing. The three new EventCode enum variants and the accompanying test were written by Claude and reviewed by the human author.

…port

This adapter's HID report descriptor declares its top-level collection as
Usage(Joystick) [0x04] rather than Usage(Gamepad) [0x05], with its 16
face/shoulder buttons reported as a plain bitmask under the generic Button
usage page. Because of this, the Linux kernel assigns the legacy
joystick-era evdev codes BTN_TRIGGER (0x120) through BTN_DEAD (0x12f) to
these buttons instead of the modern gamepad codes (BTN_SOUTH/0x130 etc.)
that InputPlumber's generic evdev translation recognizes, so none of this
adapter's face/shoulder buttons produced any input at all.

Adds:
 - A capability map + device profile for this adapter, with the bit-to-
   button layout empirically confirmed on real hardware (adapter in PC/
   DInput mode) by pressing each button in complete isolation and watching
   the translated output - not inferred from the original GameCube
   console protocol, which does not match this adapter's actual bit
   order.
 - Three new EventCode variants (evdev codes 0x12c-0x12e) which have no
   symbolic name in the Linux kernel headers but are legitimately reported
   by this class of hardware.
 - A test validating both new config files parse correctly and that
   capability_map_id is set on the source_devices entry itself, not just
   at the CompositeDeviceConfig level - only the former actually wires up
   per-event translation at runtime.

Co-developed-by: Claude Sonnet 5

AI disclosure: this fix was developed interactively with Claude Code
(Sonnet 5) over an extended debugging session. The root-cause diagnosis
(HID Joystick vs Gamepad usage causing legacy evdev codes) was Claude's
own investigation of the InputPlumber source. The bit-to-button mapping
in the capability map was NOT AI-inferred - it was determined empirically
by the human author pressing each physical button on real hardware in
isolation while Claude captured and reported the resulting translated
evdev output; several early AI-generated assumptions about the bit layout
(based on the original GameCube console protocol) turned out to be wrong
and were corrected only after the human author pushed back and asked for
further isolated testing. The three new EventCode enum variants and the
accompanying test were written by Claude and reviewed by the human author.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant