diff --git a/input/input_autodetect_builtin.c b/input/input_autodetect_builtin.c index e9fb439510..32c723b4ac 100644 --- a/input/input_autodetect_builtin.c +++ b/input/input_autodetect_builtin.c @@ -28,12 +28,16 @@ #include #endif +#ifdef WIIU +#include +#endif + #define DECL_BTN(btn, bind) "input_" #btn "_btn = " #bind "\n" #define DECL_BTN_EX(btn, bind, name) "input_" #btn "_btn = " #bind "\ninput_" #btn "_btn_label = \"" name "\"\n" #define DECL_AXIS(axis, bind) "input_" #axis "_axis = " #bind "\n" #define DECL_AXIS_EX(axis, bind, name) "input_" #axis "_axis = " #bind "\ninput_" #axis "_axis_label = \"" name "\"\n" #define DECL_MENU(btn) "input_menu_toggle_btn = " #btn "\n" -#define DECL_AUTOCONF_DEVICE(device, driver, binds) "input_device = \"" #device "\" \ninput_driver = \"" #driver "\" \n" binds +#define DECL_AUTOCONF_DEVICE(device, driver, binds) "input_device = \"" device "\" \ninput_driver = \"" driver "\" \n" binds /* TODO/FIXME - Missing L2/R2 */ @@ -546,14 +550,12 @@ const char* const input_builtin_autoconfs[] = #endif #endif #ifdef WIIU - DECL_AUTOCONF_DEVICE("WIIU Gamepad", "wiiu", WIIUINPUT_GAMEPAD_DEFAULT_BINDS), - DECL_AUTOCONF_DEVICE("WIIU Pro Controller", "wiiu", WIIUINPUT_PRO_CONTROLLER_DEFAULT_BINDS), - DECL_AUTOCONF_DEVICE("Wiimote Controller", "wiiu", WIIUINPUT_WIIMOTE_DEFAULT_BINDS), - DECL_AUTOCONF_DEVICE("Nunchuk Controller", "wiiu", WIIUINPUT_NUNCHUK_DEFAULT_BINDS), - DECL_AUTOCONF_DEVICE("Classic Controller", "wiiu", WIIUINPUT_CLASSIC_CONTROLLER_DEFAULT_BINDS), - #if defined(ENABLE_CONTROLLER_PATCHER) - DECL_AUTOCONF_DEVICE("HID Controller", "wiiu", WIIUINPUT_GAMEPAD_DEFAULT_BINDS), - #endif + DECL_AUTOCONF_DEVICE(PAD_NAME_WIIU_GAMEPAD, "wiiu", WIIUINPUT_GAMEPAD_DEFAULT_BINDS), + DECL_AUTOCONF_DEVICE(PAD_NAME_WIIU_PRO, "wiiu", WIIUINPUT_PRO_CONTROLLER_DEFAULT_BINDS), + DECL_AUTOCONF_DEVICE(PAD_NAME_WIIMOTE, "wiiu", WIIUINPUT_WIIMOTE_DEFAULT_BINDS), + DECL_AUTOCONF_DEVICE(PAD_NAME_NUNCHUK, "wiiu", WIIUINPUT_NUNCHUK_DEFAULT_BINDS), + DECL_AUTOCONF_DEVICE(PAD_NAME_CLASSIC, "wiiu", WIIUINPUT_CLASSIC_CONTROLLER_DEFAULT_BINDS), + DECL_AUTOCONF_DEVICE(PAD_NAME_HID, "wiiu", WIIUINPUT_GAMEPAD_DEFAULT_BINDS), #endif #ifdef __CELLOS_LV2__ DECL_AUTOCONF_DEVICE("SixAxis Controller", "ps3", PS3INPUT_DEFAULT_BINDS), diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index f29dd82e7f..b0f6cb7224 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -194,7 +194,17 @@ static int input_autoconfigure_joypad_try_from_conf(config_file_t *conf, if (!string_is_empty(params->name) && !string_is_empty(ident) && string_is_equal(ident, params->name)) + { score += 2; + } else { + if(string_is_empty(params->name)) + RARCH_LOG("[autoconf]: failed match because params->name was empty\n"); + else if(string_is_empty(ident)) + RARCH_LOG("[autoconf]: failed match because ident was empty\n"); + else + RARCH_LOG("[autoconf]: failed match because ident '%s' != param->name '%s'\n", + ident, params->name); + } return score; } @@ -274,8 +284,9 @@ static int input_autoconfigure_joypad_from_conf( int ret = input_autoconfigure_joypad_try_from_conf(conf, params); - if (ret) + if (ret) { input_autoconfigure_joypad_add(conf, params, task); + } config_file_free(conf); @@ -312,8 +323,10 @@ static bool input_autoconfigure_joypad_from_conf_dir( DIR_LIST_AUTOCONFIG, "cfg"); } - if(!list) + if(!list) { + RARCH_LOG("[autoconf]: No profiles found.\n"); return false; + } if (list) { @@ -347,7 +360,7 @@ static bool input_autoconfigure_joypad_from_conf_dir( config_get_config_path(conf, conf_path, sizeof(conf_path)); - RARCH_LOG("[Autoconf]: selected configuration: %s\n", conf_path); + RARCH_LOG("[autoconf]: selected configuration: %s\n", conf_path); input_autoconfigure_joypad_add(conf, params, task); config_file_free(conf); ret = 1; @@ -374,7 +387,7 @@ static bool input_autoconfigure_joypad_from_conf_internal( config_file_t *conf = config_file_new_from_string( input_builtin_autoconfs[i]); if (conf && input_autoconfigure_joypad_from_conf(conf, params, task)) - return true; + return true; } if (string_is_empty(params->autoconfig_directory)) diff --git a/wiiu/input/hidpad_driver.c b/wiiu/input/hidpad_driver.c index 18682aa6ab..e8ed2452ad 100644 --- a/wiiu/input/hidpad_driver.c +++ b/wiiu/input/hidpad_driver.c @@ -81,7 +81,7 @@ static const char *hidpad_name(unsigned pad) if(!hidpad_query_pad(pad)) return "n/a"; - return "Unknown"; + return PAD_NAME_HID; } input_device_driver_t hidpad_driver = diff --git a/wiiu/input/kpad_driver.c b/wiiu/input/kpad_driver.c index e2d9363c5d..a4097981e8 100644 --- a/wiiu/input/kpad_driver.c +++ b/wiiu/input/kpad_driver.c @@ -167,13 +167,13 @@ static const char *kpad_name(unsigned pad) switch(wiimotes[pad].type) { case WIIMOTE_TYPE_PRO: - return "WiiU Pro Controller"; + return PAD_NAME_WIIU_PRO; case WIIMOTE_TYPE_CLASSIC: - return "Classic Controller"; + return PAD_NAME_CLASSIC; case WIIMOTE_TYPE_NUNCHUK: - return "Wiimote+Nunchuk Controller"; + return PAD_NAME_NUNCHUK; case WIIMOTE_TYPE_WIIPLUS: - return "Wiimote Controller"; + return PAD_NAME_WIIMOTE; case WIIMOTE_TYPE_NONE: default: return "N/A"; diff --git a/wiiu/input/wpad_driver.c b/wiiu/input/wpad_driver.c index 8ba7a5cb92..79d671e7e8 100644 --- a/wiiu/input/wpad_driver.c +++ b/wiiu/input/wpad_driver.c @@ -190,7 +190,7 @@ static int16_t scale_touchpad(int16_t from_min, int16_t from_max, } static const char *wpad_name(unsigned pad) { - return "WiiU Gamepad"; + return PAD_NAME_WIIU_GAMEPAD; } input_device_driver_t wpad_driver =