Skip to content

Commit

Permalink
Merge pull request #59 from bryanparadis/wavebird_support_legacy_v1
Browse files Browse the repository at this point in the history
support wavebird legacy_v1
  • Loading branch information
misteraddons authored Nov 11, 2024
2 parents 2d3946e + ce962da commit 73a900b
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions Reflex/src/NicoHoodNintendo/GamecubeAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,7 @@ bool CGamecubeController::read(void)
}


if (status.device == NINTENDO_DEVICE_GC_WIRED)
{
// Read the controller, abort if it fails.
// Additional information: If you press X + Y + Start on the controller for 3 seconds
// It will turn off unless you release the buttons. The recalibration is all done
// on the Gamecube side. If the controller resets origin will have different values for sure.
if (!gc_read(pin, &report, status.rumble))
{
reset();
return false;
}

// Check if controller reported that we read the origin values (check if it disconnected).
// The Gamecube would just request (instantly) the origin again, but we keep things simple.
if (report.origin) {
reset();
return false;
}
} else if (status.device == NINTENDO_DEVICE_GC_KEYBOARD)
if (status.device == NINTENDO_DEVICE_GC_KEYBOARD)
{
// Read the keyboard.
// The keyboard will only report 3 key presses at a time.
Expand All @@ -121,6 +103,18 @@ bool CGamecubeController::read(void)
reset();
return false;
}
} else
{
// Lets be optimistic if it's not a keyboard and try to read it. Supports Wavebird.
// Read the controller, abort if it fails.
// Additional information: If you press X + Y + Start on the controller for 3 seconds
// It will turn off unless you release the buttons. The recalibration is all done
// on the Gamecube side. If the controller resets origin will have different values for sure.
if (!gc_read(pin, &report, status.rumble))
{
reset();
return false;
}
}

// Return status information for optional use.
Expand Down

0 comments on commit 73a900b

Please sign in to comment.