(RARCH_CONSOLE) Cleanup autoconf implementations

This commit is contained in:
twinaphex 2014-06-14 05:14:38 +02:00
parent a7cddecb2c
commit b9bf87c5f0
6 changed files with 20 additions and 242 deletions

View File

@ -97,131 +97,20 @@ DECL_AXIS(r_y_minus, +3)
// Some hardcoded autoconfig information. Will be used for pads with no autoconfig cfg files.
const char* const input_builtin_autoconfs[] =
{
"input_device = \"GameCube Controller (Player 1)\" \n"
"input_device = \"GameCube Controller\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
"input_device = \"GameCube Controller (Player 2)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
"input_device = \"GameCube Controller (Player 3)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
"input_device = \"GameCube Controller (Player 4)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
"input_device = \"GameCube Controller (Player 5)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
"input_device = \"GameCube Controller (Player 6)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
"input_device = \"GameCube Controller (Player 7)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
"input_device = \"GameCube Controller (Player 8)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_GAMECUBE_DEFAULT_BINDS,
#ifdef HW_RVL
"input_device = \"Wiimote Controller (Player 1)\" \n"
"input_device = \"Wiimote Controller\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"Wiimote Controller (Player 2)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"Wiimote Controller (Player 3)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"Wiimote Controller (Player 4)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"Wiimote Controller (Player 5)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"Wiimote Controller (Player 6)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"Wiimote Controller (Player 7)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"Wiimote Controller (Player 8)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_WIIMOTE_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 1)\" \n"
"input_device = \"NunChuk Controller\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 2)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 3)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 4)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 5)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 6)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 7)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"NunChuk Controller (Player 8)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_NUNCHUK_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 1)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 2)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 3)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 4)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 5)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 6)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 7)\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
"input_device = \"Classic Controller (Player 8)\" \n"
"input_device = \"Classic Controller\" \n"
"input_driver = \"gx\" \n"
GXINPUT_CLASSIC_DEFAULT_BINDS,
#endif

View File

@ -45,35 +45,7 @@ DECL_AXIS(r_y_minus, +3)
// Some hardcoded autoconfig information. Will be used for pads with no autoconfig cfg files.
const char* const input_builtin_autoconfs[] =
{
"input_device = \"SixAxis Controller (Player 1)\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,
"input_device = \"SixAxis Controller (Player 2)\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,
"input_device = \"SixAxis Controller (Player 3)\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,
"input_device = \"SixAxis Controller (Player 4)\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,
"input_device = \"SixAxis Controller (Player 5)\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,
"input_device = \"SixAxis Controller (Player 6)\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,
"input_device = \"SixAxis Controller (Player 7)\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,
"input_device = \"SixAxis Controller (Player 8)\" \n"
"input_device = \"SixAxis Controller\" \n"
"input_driver = \"ps3\" \n"
PS3INPUT_DEFAULT_BINDS,

View File

@ -44,19 +44,7 @@ DECL_AXIS(r_y_minus, +3)
// Some hardcoded autoconfig information. Will be used for pads with no autoconfig cfg files.
const char* const input_builtin_autoconfs[] =
{
"input_device = \"XInput Controller (Player 1)\" \n"
"input_driver = \"xdk\" \n"
XINPUT_DEFAULT_BINDS,
"input_device = \"XInput Controller (Player 2)\" \n"
"input_driver = \"xdk\" \n"
XINPUT_DEFAULT_BINDS,
"input_device = \"XInput Controller (Player 3)\" \n"
"input_driver = \"xdk\" \n"
XINPUT_DEFAULT_BINDS,
"input_device = \"XInput Controller (Player 4)\" \n"
"input_device = \"XInput Controller\" \n"
"input_driver = \"xdk\" \n"
XINPUT_DEFAULT_BINDS,

View File

@ -180,65 +180,6 @@ static void gx_input_free_input(void *data)
free(data);
}
static const char* const GC_CONTROLLER_NAMES[NUM_DEVICES][MAX_PLAYERS] =
{
{
"GameCube Controller (Player 1)",
"GameCube Controller (Player 2)",
"GameCube Controller (Player 3)",
"GameCube Controller (Player 4)",
"GameCube Controller (Player 5)",
"GameCube Controller (Player 6)",
"GameCube Controller (Player 7)",
"GameCube Controller (Player 8)"
},
#ifdef HW_RVL
{
"Wiimote Controller (Player 1)",
"Wiimote Controller (Player 2)",
"Wiimote Controller (Player 3)",
"Wiimote Controller (Player 4)",
"Wiimote Controller (Player 5)",
"Wiimote Controller (Player 6)",
"Wiimote Controller (Player 7)",
"Wiimote Controller (Player 8)"
},
{
"NunChuk Controller (Player 1)",
"NunChuk Controller (Player 2)",
"NunChuk Controller (Player 3)",
"NunChuk Controller (Player 4)",
"NunChuk Controller (Player 5)",
"NunChuk Controller (Player 6)",
"NunChuk Controller (Player 7)",
"NunChuk Controller (Player 8)"
},
{
"Classic Controller (Player 1)",
"Classic Controller (Player 2)",
"Classic Controller (Player 3)",
"Classic Controller (Player 4)",
"Classic Controller (Player 5)",
"Classic Controller (Player 6)",
"Classic Controller (Player 7)",
"Classic Controller (Player 8)"
},
#endif
#ifdef HAVE_LIBSICKSAXIS
{
"SixAxis Controller (Player 1)",
"SixAxis Controller (Player 2)",
"SixAxis Controller (Player 3)",
"SixAxis Controller (Player 4)",
"SixAxis Controller (Player 5)",
"SixAxis Controller (Player 6)",
"SixAxis Controller (Player 7)",
"SixAxis Controller (Player 8)"
},
#endif
};
static const char *gx_joypad_name(unsigned pad)
{
gx_input_t *gx = (gx_input_t*)driver.input_data;
@ -247,18 +188,18 @@ static const char *gx_joypad_name(unsigned pad)
{
#ifdef HW_RVL
case WPAD_EXP_NONE:
return GC_CONTROLLER_NAMES[1][pad];
return "Wiimote Controller";
case WPAD_EXP_NUNCHUK:
return GC_CONTROLLER_NAMES[2][pad];
return "Nunchuk Controller";
case WPAD_EXP_CLASSIC:
return GC_CONTROLLER_NAMES[3][pad];
return "Classic Controller";
#ifdef HAVE_LIBSICKSAXIS
case WPAD_EXP_SICKSAXIS:
return GC_CONTROLLER_NAMES[4][pad];
return "Sixaxis Controller";
#endif
#endif
case WPAD_EXP_GAMECUBE:
return GC_CONTROLLER_NAMES[0][pad];
return "Gamecube Controller";
default:
return NULL;
}
@ -272,18 +213,18 @@ static const char *gx_joypad_name_static(void *data, unsigned pad)
{
#ifdef HW_RVL
case WPAD_EXP_NONE:
return GC_CONTROLLER_NAMES[1][pad];
return "Wiimote Controller";
case WPAD_EXP_NUNCHUK:
return GC_CONTROLLER_NAMES[2][pad];
return "Nunchuk Controller";
case WPAD_EXP_CLASSIC:
return GC_CONTROLLER_NAMES[3][pad];
return "Classic Controller";
#ifdef HAVE_LIBSICKSAXIS
case WPAD_EXP_SICKSAXIS:
return GC_CONTROLLER_NAMES[4][pad];
return "Sixaxis Controller";
#endif
#endif
case WPAD_EXP_GAMECUBE:
return GC_CONTROLLER_NAMES[0][pad];
return "Gamecube Controller";
default:
return NULL;
}

View File

@ -370,21 +370,9 @@ const input_driver_t input_ps3 = {
ps3_input_get_joypad_driver,
};
static const char* const PS3_CONTROLLER_NAMES[8] =
{
"SixAxis Controller (Player 1)",
"SixAxis Controller (Player 2)",
"SixAxis Controller (Player 3)",
"SixAxis Controller (Player 4)",
"SixAxis Controller (Player 5)",
"SixAxis Controller (Player 6)",
"SixAxis Controller (Player 7)",
"SixAxis Controller (Player 8)"
};
static const char *ps3_joypad_name(unsigned pad)
{
return PS3_CONTROLLER_NAMES[pad];
return g_settings.input.device_names[pad];
}
static bool ps3_joypad_init(void)
@ -393,7 +381,7 @@ static bool ps3_joypad_init(void)
for (autoconf_pad = 0; autoconf_pad < MAX_PLAYERS; autoconf_pad++)
{
strlcpy(g_settings.input.device_names[autoconf_pad], ps3_joypad_name(autoconf_pad), sizeof(g_settings.input.device_names[autoconf_pad]));
strlcpy(g_settings.input.device_names[autoconf_pad], "SixAxis Controller", sizeof(g_settings.input.device_names[autoconf_pad]));
input_config_autoconfigure_joypad(autoconf_pad, ps3_joypad_name(autoconf_pad), ps3_joypad.ident);
}

View File

@ -296,7 +296,7 @@ static const char* const XBOX_CONTROLLER_NAMES[4] =
static const char *xdk_joypad_name(unsigned pad)
{
return XBOX_CONTROLLER_NAMES[pad];
return g_settings.input.device_names[pad];
}
static bool xdk_joypad_init(void)
@ -305,7 +305,7 @@ static bool xdk_joypad_init(void)
for (autoconf_pad = 0; autoconf_pad < MAX_PLAYERS; autoconf_pad++)
{
strlcpy(g_settings.input.device_names[autoconf_pad], xdk_joypad_name(autoconf_pad), sizeof(g_settings.input.device_names[autoconf_pad]));
strlcpy(g_settings.input.device_names[autoconf_pad], "XInput Controller", sizeof(g_settings.input.device_names[autoconf_pad]));
input_config_autoconfigure_joypad(autoconf_pad, xdk_joypad_name(autoconf_pad), xdk_joypad.ident);
}