improve shield portable hack

This commit is contained in:
radius 2017-04-15 17:26:04 -05:00
parent 996bb990a0
commit d70d04c473

View File

@ -949,13 +949,10 @@ static void handle_hotplug(android_input_t *android,
} }
} }
/* NVIDIA Shield Portable
* This is a simple hack, basically groups the "back"
* button with the rest of the gamepad
*/
else if(strstr(device_model, "SHIELD") && ( else if(strstr(device_model, "SHIELD") && (
strstr(device_name, "Virtual") || strstr(device_name, "gpio") || strstr(device_name, "Virtual") || strstr(device_name, "gpio") ||
strstr(device_name, "NVIDIA Corporation NVIDIA Controller v01.01"))) strstr(device_name, "NVIDIA Corporation NVIDIA Controller v01.01") ||
strstr(device_name, "NVIDIA Corporation NVIDIA Controller v01.02")))
{ {
/* only use the hack if the device is one of the built-in devices */ /* only use the hack if the device is one of the built-in devices */
RARCH_LOG("Special Device Detected: %s\n", device_model); RARCH_LOG("Special Device Detected: %s\n", device_model);
@ -967,10 +964,28 @@ static void handle_hotplug(android_input_t *android,
if ( pad_id2 > 0) if ( pad_id2 > 0)
return; return;
strlcpy (name_buf, "NVIDIA SHIELD Portable", sizeof(name_buf)); strlcpy (name_buf, "NVIDIA SHIELD Portable", sizeof(name_buf));
} }
} }
else if(strstr(device_model, "SHIELD") && (
strstr(device_name, "Virtual") || strstr(device_name, "gpio") ||
strstr(device_name, "NVIDIA Corporation NVIDIA Controller v01.03")))
{
/* only use the hack if the device is one of the built-in devices */
RARCH_LOG("Special Device Detected: %s\n", device_model);
{
if (strstr(device_name, "NVIDIA Corporation NVIDIA Controller v01.03")
&& android->pads_connected==0)
pad_id1 = id;
else if (strstr(device_name, "Virtual") || strstr(device_name, "gpio"))
{
id = pad_id1;
return;
}
strlcpy (name_buf, "NVIDIA SHIELD Gamepad", sizeof(name_buf));
}
}
/* Other ATV Devices /* Other ATV Devices
* Add other common ATV devices that will follow the Android * Add other common ATV devices that will follow the Android