mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Avoid set_controller_port unless we use something other than JOYPAD.
Some cores do not properly range check. Avoid needlessly breaking.
This commit is contained in:
parent
f1db922c26
commit
f5b8ccff4b
12
retroarch.c
12
retroarch.c
@ -1271,11 +1271,17 @@ static void init_controllers(void)
|
||||
}
|
||||
|
||||
if (device == RETRO_DEVICE_NONE)
|
||||
{
|
||||
RARCH_LOG("Disconnecting device from port %u.\n", i + 1);
|
||||
else
|
||||
pretro_set_controller_port_device(i, device);
|
||||
}
|
||||
else if (device != RETRO_DEVICE_JOYPAD)
|
||||
{
|
||||
// Some cores do not properly range check port argument.
|
||||
// This is broken behavior ofc, but avoid breaking cores needlessly.
|
||||
RARCH_LOG("Connecting %s (ID: %u) to port %u.\n", ident, device, i + 1);
|
||||
|
||||
pretro_set_controller_port_device(i, device);
|
||||
pretro_set_controller_port_device(i, device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user