mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2025-01-11 18:59:07 +01:00
improved controllers default assignation
This commit is contained in:
parent
c012b71248
commit
7a28802085
@ -639,20 +639,40 @@ void ogc_input__set_defaults(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* set default device assigantion */
|
||||
/* default device assignation */
|
||||
for (i=0; i<MAX_DEVICES; i++)
|
||||
{
|
||||
#ifdef HW_RVL
|
||||
if (i < 4)
|
||||
{
|
||||
/* detect wiimote expansion controller */
|
||||
/* autodetect connected controller */
|
||||
exp = 255;
|
||||
if (WPAD_Probe(0, &exp) == WPAD_ERR_NONE)
|
||||
WPAD_Probe(i, &exp);
|
||||
if (exp <= WPAD_EXP_CLASSIC)
|
||||
{
|
||||
config.input[i].device = (exp <= WPAD_EXP_CLASSIC) ? (exp + 1) : 1;
|
||||
/* set expansion controller (or wiimote if no expansion) as default */
|
||||
config.input[i].device = exp + 1;
|
||||
config.input[i].port = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* set gamepad as default */
|
||||
config.input[i].device = 0;
|
||||
config.input[i].port = i;
|
||||
|
||||
/* look for unassigned wiimotes */
|
||||
int j;
|
||||
for (j=0; j<i; j++)
|
||||
{
|
||||
/* expansion is used, wiimote is free */
|
||||
if (config.input[j].device > 1)
|
||||
{
|
||||
/* assign wiimote */
|
||||
config.input[i].device = 1;
|
||||
config.input[i].port = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* set gamepad as default */
|
||||
else config.input[i].device = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -664,9 +684,6 @@ void ogc_input__set_defaults(void)
|
||||
/* set gamepad as default */
|
||||
config.input[i].device = (i < 4) ? 0 : -1;
|
||||
#endif
|
||||
|
||||
/* set device port */
|
||||
config.input[i].port = i % 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user