mirror of
https://github.com/libretro/RetroArch
synced 2025-04-25 09:02:44 +00:00
Check if autodetect is enabled at beginning of connect task
This commit is contained in:
parent
404e3122bf
commit
2153f3f011
@ -642,6 +642,7 @@ static void handle_hotplug(android_input_data_t *android_data,
|
|||||||
char device_name[256];
|
char device_name[256];
|
||||||
char device_model[256];
|
char device_model[256];
|
||||||
char name_buf[256];
|
char name_buf[256];
|
||||||
|
autoconfig_params_t params = {{0}};
|
||||||
int vendorId = 0;
|
int vendorId = 0;
|
||||||
int productId = 0;
|
int productId = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -889,14 +890,6 @@ static void handle_hotplug(android_input_data_t *android_data,
|
|||||||
if (*port < 0)
|
if (*port < 0)
|
||||||
*port = android_data->pads_connected;
|
*port = android_data->pads_connected;
|
||||||
|
|
||||||
if (settings->input.autodetect_enable)
|
|
||||||
{
|
|
||||||
autoconfig_params_t params = {{0}};
|
|
||||||
|
|
||||||
RARCH_LOG("Pads Connected: %d Port: %d\n %s VID/PID: %d/%d\n",
|
|
||||||
android_data->pads_connected, *port, name_buf,
|
|
||||||
params.vid, params.pid);
|
|
||||||
|
|
||||||
strlcpy(params.name, name_buf, sizeof(params.name));
|
strlcpy(params.name, name_buf, sizeof(params.name));
|
||||||
|
|
||||||
params.idx = *port;
|
params.idx = *port;
|
||||||
@ -905,7 +898,6 @@ static void handle_hotplug(android_input_data_t *android_data,
|
|||||||
|
|
||||||
strlcpy(params.driver, android_joypad.ident, sizeof(params.driver));
|
strlcpy(params.driver, android_joypad.ident, sizeof(params.driver));
|
||||||
input_autoconfigure_connect(¶ms);
|
input_autoconfigure_connect(¶ms);
|
||||||
}
|
|
||||||
|
|
||||||
if (!string_is_empty(name_buf))
|
if (!string_is_empty(name_buf))
|
||||||
{
|
{
|
||||||
|
@ -140,12 +140,9 @@ static const char *gx_joypad_name(unsigned pad)
|
|||||||
|
|
||||||
static void handle_hotplug(unsigned port, uint32_t ptype)
|
static void handle_hotplug(unsigned port, uint32_t ptype)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
pad_type[port] = ptype;
|
pad_type[port] = ptype;
|
||||||
|
|
||||||
if (ptype != WPAD_EXP_NOCONTROLLER
|
if (ptype != WPAD_EXP_NOCONTROLLER)
|
||||||
&& settings->input.autodetect_enable)
|
|
||||||
{
|
{
|
||||||
autoconfig_params_t params = {{0}};
|
autoconfig_params_t params = {{0}};
|
||||||
|
|
||||||
@ -498,14 +495,18 @@ static bool gx_joypad_query_pad(unsigned pad)
|
|||||||
static void gx_joypad_destroy(void)
|
static void gx_joypad_destroy(void)
|
||||||
{
|
{
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|
#if 0
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < MAX_PADS; i++)
|
for (i = 0; i < MAX_PADS; i++)
|
||||||
{
|
{
|
||||||
// Commenting this out fixes the Wii remote not reconnecting after core load, exit, etc.
|
/* Commenting this out fixes the Wii
|
||||||
// WPAD_Flush(i);
|
* remote not reconnecting after
|
||||||
// WPADDisconnect(i);
|
* core load, exit, etc. */
|
||||||
|
WPAD_Flush(i);
|
||||||
|
WPADDisconnect(i);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
input_device_driver_t gx_joypad = {
|
input_device_driver_t gx_joypad = {
|
||||||
|
@ -394,8 +394,9 @@ bool input_autoconfigure_connect(autoconfig_params_t *params)
|
|||||||
{
|
{
|
||||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||||
autoconfig_params_t *state = (autoconfig_params_t*)calloc(1, sizeof(*state));
|
autoconfig_params_t *state = (autoconfig_params_t*)calloc(1, sizeof(*state));
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (!task || !state)
|
if (!task || !state || !settings->input.autodetect_enable)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
strlcpy(state->name, params->name, sizeof(state->name));
|
strlcpy(state->name, params->name, sizeof(state->name));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user