mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Merge pull request #7334 from m4xw/libnx
[LIBNX] Add Split Joycon support
This commit is contained in:
commit
c8a764177e
@ -154,21 +154,24 @@ static void switch_joypad_destroy(void)
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
int lastMode = 0; // 0 = handheld, 1 = whatever
|
||||
|
||||
static void switch_joypad_poll(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
hidScanInput();
|
||||
|
||||
// TODO: Options via menu
|
||||
/*if (settings->bools.split_joycon && !hidGetHandheldMode())
|
||||
if (!hidGetHandheldMode())
|
||||
{
|
||||
if (lastMode != 1)
|
||||
{
|
||||
RARCH_LOG("[HID] Enable Split Joycon!\n");
|
||||
hidSetNpadJoyAssignmentModeSingleByDefault(CONTROLLER_PLAYER_1);
|
||||
hidSetNpadJoyAssignmentModeSingleByDefault(CONTROLLER_PLAYER_2);
|
||||
int i = 0;
|
||||
for(i = 0; i < MAX_USERS; i += 2){
|
||||
if(settings->uints.input_split_joycon[i]) // CONTROLLER_PLAYER_X, X == i++
|
||||
{
|
||||
hidSetNpadJoyAssignmentModeSingleByDefault(i);
|
||||
hidSetNpadJoyAssignmentModeSingleByDefault(i + 1);
|
||||
}
|
||||
}
|
||||
lastMode = 1;
|
||||
}
|
||||
}
|
||||
@ -176,12 +179,17 @@ static void switch_joypad_poll(void)
|
||||
{
|
||||
if (lastMode != 0)
|
||||
{
|
||||
RARCH_LOG("[HID] Disable Split Joycon!\n");
|
||||
hidSetNpadJoyAssignmentModeDual(CONTROLLER_PLAYER_1);
|
||||
hidSetNpadJoyAssignmentModeDual(CONTROLLER_PLAYER_2);
|
||||
int i = 0;
|
||||
for(i = 0; i < MAX_USERS; i += 2){
|
||||
if(settings->uints.input_split_joycon[i]) // CONTROLLER_PLAYER_X, X == i++
|
||||
{
|
||||
hidSetNpadJoyAssignmentModeDual(i);
|
||||
hidSetNpadJoyAssignmentModeDual(i + 1);
|
||||
}
|
||||
}
|
||||
lastMode = 0;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_PADS; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user