mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-03 10:13:11 +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_model[256];
|
||||
char name_buf[256];
|
||||
autoconfig_params_t params = {{0}};
|
||||
int vendorId = 0;
|
||||
int productId = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -889,23 +890,14 @@ static void handle_hotplug(android_input_data_t *android_data,
|
||||
if (*port < 0)
|
||||
*port = android_data->pads_connected;
|
||||
|
||||
if (settings->input.autodetect_enable)
|
||||
{
|
||||
autoconfig_params_t params = {{0}};
|
||||
strlcpy(params.name, name_buf, sizeof(params.name));
|
||||
|
||||
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);
|
||||
params.idx = *port;
|
||||
params.vid = vendorId;
|
||||
params.pid = productId;
|
||||
|
||||
strlcpy(params.name, name_buf, sizeof(params.name));
|
||||
|
||||
params.idx = *port;
|
||||
params.vid = vendorId;
|
||||
params.pid = productId;
|
||||
|
||||
strlcpy(params.driver, android_joypad.ident, sizeof(params.driver));
|
||||
input_autoconfigure_connect(¶ms);
|
||||
}
|
||||
strlcpy(params.driver, android_joypad.ident, sizeof(params.driver));
|
||||
input_autoconfigure_connect(¶ms);
|
||||
|
||||
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)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
pad_type[port] = ptype;
|
||||
|
||||
if (ptype != WPAD_EXP_NOCONTROLLER
|
||||
&& settings->input.autodetect_enable)
|
||||
if (ptype != WPAD_EXP_NOCONTROLLER)
|
||||
{
|
||||
autoconfig_params_t params = {{0}};
|
||||
|
||||
@ -498,14 +495,18 @@ static bool gx_joypad_query_pad(unsigned pad)
|
||||
static void gx_joypad_destroy(void)
|
||||
{
|
||||
#ifdef HW_RVL
|
||||
#if 0
|
||||
int i;
|
||||
for (i = 0; i < MAX_PADS; i++)
|
||||
{
|
||||
// Commenting this out fixes the Wii remote not reconnecting after core load, exit, etc.
|
||||
// WPAD_Flush(i);
|
||||
// WPADDisconnect(i);
|
||||
/* Commenting this out fixes the Wii
|
||||
* remote not reconnecting after
|
||||
* core load, exit, etc. */
|
||||
WPAD_Flush(i);
|
||||
WPADDisconnect(i);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
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));
|
||||
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;
|
||||
|
||||
strlcpy(state->name, params->name, sizeof(state->name));
|
||||
|
Loading…
x
Reference in New Issue
Block a user