diff --git a/test/testcontroller.c b/test/testcontroller.c index 6b5874156b35d..2d09072fca78c 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -910,8 +910,10 @@ static void AddController(SDL_JoystickID id, bool verbose) new_controller->id = id; new_controller->joystick = SDL_OpenJoystick(id); - new_controller->num_axes = SDL_GetNumJoystickAxes(new_controller->joystick); - new_controller->axis_state = (AxisState *)SDL_calloc(new_controller->num_axes, sizeof(*new_controller->axis_state)); + if (new_controller->joystick) { + new_controller->num_axes = SDL_GetNumJoystickAxes(new_controller->joystick); + new_controller->axis_state = (AxisState *)SDL_calloc(new_controller->num_axes, sizeof(*new_controller->axis_state)); + } joystick = new_controller->joystick; if (joystick) { @@ -2002,8 +2004,7 @@ int main(int argc, char *argv[]) } SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI, "1"); - SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); - SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); + SDL_SetHint(SDL_HINT_JOYSTICK_ENHANCED_REPORTS, "auto"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_STEAM, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ROG_CHAKRAM, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");