Skip to content

Commit f08a43e

Browse files
Detect WaveBird as a separate Style (and surface its no-rumble flag).
Adds STYLE_WAVEBIRD distinct from STYLE_GCN. Detection mirrors libogc's SI_DecodeType: if (SI_GetType(p) & SI_GC_WAVEBIRD) == SI_GC_WAVEBIRD the controller is an active wireless WaveBird, not a wired Standard controller. WaveBirds have SI_GC_NOMOTOR set, so we mark rumble_supported=false for them — the Rumble field will read 'Unavailable' instead of 'Idle'.
1 parent 3359017 commit f08a43e

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

gamecube/ppc/main.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ typedef enum {
147147
STYLE_NONE,
148148
STYLE_N64,
149149
STYLE_GCN,
150+
STYLE_WAVEBIRD,
150151
STYLE_MOUSE,
151152
STYLE_KEYBOARD,
152153
} pad_style_t;
@@ -155,6 +156,7 @@ static const char *format_style(pad_style_t s) {
155156
switch (s) {
156157
case STYLE_N64: return "N64 ";
157158
case STYLE_GCN: return "GCN ";
159+
case STYLE_WAVEBIRD: return "WaveBird";
158160
case STYLE_MOUSE: return "Mouse ";
159161
case STYLE_KEYBOARD: return "Keyboard";
160162
default: return "None ";
@@ -310,8 +312,15 @@ static void snap_n64(pad_snap_t *out, int chan, const N64State *s) {
310312
}
311313

312314
static void snap_gc(pad_snap_t *out, int p, u16 buttons) {
313-
out->style = STYLE_GCN;
314-
out->rumble_supported = true; // GC controllers have built-in rumble motor
315+
// libogc's SI_DecodeType test: when the wavebird-specific flag mix
316+
// matches, this is an active wireless controller paired with its
317+
// receiver. Otherwise it's a wired Standard GC controller.
318+
u32 t = SI_GetType(p);
319+
out->style = ((t & SI_GC_WAVEBIRD) == SI_GC_WAVEBIRD) ? STYLE_WAVEBIRD
320+
: STYLE_GCN;
321+
// WaveBird ships without a rumble motor (SI_GC_NOMOTOR is set in
322+
// wireless types). Standard GC controllers have it built in.
323+
out->rumble_supported = !(t & SI_GC_NOMOTOR);
315324
out->stick_x = PAD_StickX(p);
316325
out->stick_y = PAD_StickY(p);
317326
out->cstick_x = PAD_SubStickX(p);

0 commit comments

Comments
 (0)