Merge pull request #2551 from dibas/master

Detect Wii U Pro Controller properly.
This commit is contained in:
Twinaphex 2015-12-12 20:45:11 +01:00
commit b278bf69dc

View File

@ -81,8 +81,8 @@ int32_t pad_connection_pad_init(joypad_connection_t *joyconn,
pad_connection_interface_t *iface; pad_connection_interface_t *iface;
} pad_map[] = } pad_map[] =
{ {
{ "Nintendo RVL-CNT-01-UC", 1406, 816, &pad_connection_wiiupro },
{ "Nintendo RVL-CNT-01", 1406, 816, &pad_connection_wii }, { "Nintendo RVL-CNT-01", 1406, 816, &pad_connection_wii },
{ "Nintendo RVL-CNT-01-UC", 1406, 816, &pad_connection_wiiupro },
{ "Wireless Controller", 1356, 1476, &pad_connection_ps4 }, { "Wireless Controller", 1356, 1476, &pad_connection_ps4 },
{ "PLAYSTATION(R)3 Controller", 1356, 616, &pad_connection_ps3 }, { "PLAYSTATION(R)3 Controller", 1356, 616, &pad_connection_ps3 },
{ 0, 0} { 0, 0}
@ -94,14 +94,19 @@ int32_t pad_connection_pad_init(joypad_connection_t *joyconn,
for (i = 0; name && pad_map[i].name; i++) for (i = 0; name && pad_map[i].name; i++)
{ {
const char *name_match = strstr(name, pad_map[i].name); const char *name_match = strstr(pad_map[i].name, name);
if(pad_map[i].vid == 1406 && pad_map[i].pid == 816) // Never change, Nintendo.
{
if(strcmp(pad_map[i].name, name) != 0)
continue;
}
if (name_match || (pad_map[i].vid == vid && pad_map[i].pid == pid)) if (name_match || (pad_map[i].vid == vid && pad_map[i].pid == pid))
{ {
s->iface = pad_map[i].iface; s->iface = pad_map[i].iface;
s->data = s->iface->init(data, pad, ptr); s->data = s->iface->init(data, pad, ptr);
s->connected = true; s->connected = true;
return pad; return pad;
} }
} }