Fixed initializing the Nyko and EVORETRO GameCube adaptors

This requires root on most Linux distributions, as we have to directly send USB messages to the devices to enable input reports.
This commit is contained in:
Sam Lantinga
2021-01-21 22:30:34 -08:00
parent b6ae9a7cba
commit 3527b49459
3 changed files with 82 additions and 0 deletions

View File

@@ -32,6 +32,7 @@
#include "../SDL_sysjoystick.h"
#include "SDL_hidapijoystick_c.h"
#include "SDL_hidapi_rumble.h"
#include "../../hidapi/SDL_hidapi.h"
#ifdef SDL_JOYSTICK_HIDAPI_GAMECUBE
@@ -129,6 +130,8 @@ HIDAPI_DriverGameCube_InitDevice(SDL_HIDAPI_Device *device)
Uint8 initMagic = 0x13;
Uint8 rumbleMagic = 0x11;
SDL_EnableGameCubeAdaptors();
ctx = (SDL_DriverGameCube_Context *)SDL_calloc(1, sizeof(*ctx));
if (!ctx) {
SDL_OutOfMemory();