Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libultraship/libultra/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ int32_t osContInit(OSMesgQueue* mq, uint8_t* controllerBits, OSContStatus* statu
}

SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should already be set

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS4

The default is the value of SDL_HINT_JOYSTICK_HIDAPI

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI

"1": HIDAPI drivers are used (the default)

SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't come without side-effects

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE

Extended input reports allow rumble on Bluetooth PS4 controllers, but break DirectInput handling for applications that don't use SDL.

Once extended reports are enabled, they can not be disabled without power cycling the controller.

SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as HIDAPI_PS4

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS5

The default is the value of SDL_HINT_JOYSTICK_HIDAPI

SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as HIDAPI_PS4_RUMBLE

if (SDL_Init(SDL_INIT_GAMECONTROLLER) != 0) {
SPDLOG_ERROR("Failed to initialize SDL game controllers ({})", SDL_GetError());
exit(EXIT_FAILURE);
Expand Down