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,12 +1271,18 @@ static void init_controllers(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device == RETRO_DEVICE_NONE)
|
if (device == RETRO_DEVICE_NONE)
|
||||||
|
{
|
||||||
RARCH_LOG("Disconnecting device from port %u.\n", i + 1);
|
RARCH_LOG("Disconnecting device from port %u.\n", i + 1);
|
||||||
else
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void load_save_files(void)
|
static inline void load_save_files(void)
|
||||||
|
|
Loading…
Reference in New Issue