From 9b8daf02ffa1bb78745e34a6c47974785776f175 Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 31 Jul 2015 22:37:03 -0500 Subject: [PATCH 1/7] fix messages --- configuration.c | 4 ++-- dynamic.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration.c b/configuration.c index f7e063b055..8f6174bfbd 100644 --- a/configuration.c +++ b/configuration.c @@ -1712,13 +1712,13 @@ static bool config_load_file(const char *path, bool set_defaults) if (!config_get_path(conf, "system_directory", settings->system_directory, sizeof(settings->system_directory))) { - RARCH_WARN("SYSTEM DIR is empty, fill assume CONTENT DIR\n"); + RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR\n"); *settings->system_directory = '\0'; } if (!strcmp(settings->system_directory, "default")) { - RARCH_WARN("SYSTEM DIR is empty, fill assume CONTENT DIR\n"); + RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR\n"); *settings->system_directory = '\0'; } diff --git a/dynamic.c b/dynamic.c index 3d62694de7..fa75f79fc6 100644 --- a/dynamic.c +++ b/dynamic.c @@ -754,7 +754,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) case RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY: if (!settings->system_directory || settings->system_directory[0] == '\0') { - RARCH_WARN("SYSTEM DIR is empty, fill assume CONTENT DIR %s\n",global->path.fullpath); + RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR %s\n",global->path.fullpath); fill_pathname_basedir(buf, global->path.fullpath, sizeof(buf)); From 4097f971316b69a05f96faea76051c4c4e8df41d Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 31 Jul 2015 22:37:22 -0500 Subject: [PATCH 2/7] add hack for remote type devices --- input/drivers/android_input.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index f1f75fe808..49d14dc08a 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -656,6 +656,22 @@ static void handle_hotplug(android_input_t *android, *port = 0; strlcpy(name_buf, "Generic GPIO Device", sizeof(name_buf)); } + else if (strstr(device_name, "Amazon Fire TV Remote") + || strstr(device_name, "Nexus Remote")) + { + /* hack for remote control type devices, set them always to port 0 */ + *port = 0; + strlcpy(name_buf, device_name, sizeof(name_buf)); + } + else if ( *port==1 && ( strstr(android->pad_states[0].name,"Amazon Fire TV Remote") + || strstr(android->pad_states[0].name,"Nexus Remote"))) + { + /* and then when we are binding a new controller in port 1 and one of those remotes + * was bound to port 0, bind the device as port 0 too + */ + *port = 0; + strlcpy(name_buf, device_name, sizeof(name_buf)); + } else if ( strstr(device_name, "PLAYSTATION(R)3") || strstr(device_name, "Dualshock3") || From 65081a0f9d1e817864159b2d9fdc95de7b0fa9a2 Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 31 Jul 2015 23:09:25 -0500 Subject: [PATCH 3/7] reduce OSD spam --- input/drivers/android_input.c | 16 ++++++++++------ input/input_autodetect.c | 32 ++++++++++++++++++++++---------- input/input_driver.c | 6 ++++++ 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 49d14dc08a..547b18a613 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -654,20 +654,24 @@ static void handle_hotplug(android_input_t *android, { /* If built-in shield controller is detected bind the virtual and gpio devices to the same port*/ *port = 0; - strlcpy(name_buf, "Generic GPIO Device", sizeof(name_buf)); + strlcpy(name_buf, "Generic I/O Device", sizeof(name_buf)); } - else if (strstr(device_name, "Amazon Fire TV Remote") - || strstr(device_name, "Nexus Remote")) + else if (strstr(device_name, "Amazon Fire TV Remote") + || strstr(device_name, "Nexus Remote") + || strstr(device_name, "SHIELD Remote")) { /* hack for remote control type devices, set them always to port 0 */ *port = 0; strlcpy(name_buf, device_name, sizeof(name_buf)); } - else if ( *port==1 && ( strstr(android->pad_states[0].name,"Amazon Fire TV Remote") - || strstr(android->pad_states[0].name,"Nexus Remote"))) + else if ( *port==1 && ( strstr(android->pad_states[0].name,"Amazon Fire TV Remote") + || strstr(android->pad_states[0].name,"Nexus Remote") + || strstr(android->pad_states[0].name,"SHIELD Remote"))) { /* and then when we are binding a new controller in port 1 and one of those remotes - * was bound to port 0, bind the device as port 0 too + * was bound to port 0, bind the device as port 0 too, it causes all the controllers to + * rebind on the first button press but at least the remotes can be used to navigate + * the user interface */ *port = 0; strlcpy(name_buf, device_name, sizeof(name_buf)); diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 41ce193da5..fc57a23258 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -37,6 +37,7 @@ enum AUTODETECT_MATCH_NAME }; #endif +bool remote_is_bound = false; static void input_autoconfigure_joypad_conf(config_file_t *conf, struct retro_keybind *binds) @@ -112,10 +113,12 @@ static void input_autoconfigure_joypad_add( autoconfig_params_t *params) { char msg[PATH_MAX_LENGTH] = {0}; - char buf[PATH_MAX_LENGTH] = {0}; + char display_name[PATH_MAX_LENGTH] = {0}; + char device_type[PATH_MAX_LENGTH] = {0}; settings_t *settings = config_get_ptr(); - config_get_array(conf, "input_display_name", buf, sizeof(buf)); + config_get_array(conf, "input_device_display_name", display_name, sizeof(display_name)); + config_get_array(conf, "input_device_type", device_type, sizeof(device_type)); /* This will be the case if input driver is reinitialized. * No reason to spam autoconfigure messages every time. */ @@ -124,20 +127,29 @@ static void input_autoconfigure_joypad_add( if (!settings) return; - + settings->input.autoconfigured[params->idx] = true; input_autoconfigure_joypad_conf(conf, settings->input.autoconf_binds[params->idx]); - if (buf[0] != '\0' || strcmp(buf, "")) - snprintf(msg, sizeof(msg), "%s configured in port #%u.", - buf, params->idx); + if (!strcmp(device_type,"remote")) + { + snprintf(msg, sizeof(msg), "%s configured for gui navigation", + params->name, params->idx); + remote_is_bound = true; + } else - snprintf(msg, sizeof(msg), "%s configured in port #%u.", - params->name, params->idx); + { + if (display_name[0] != '\0' || strcmp(display_name, "")) + snprintf(msg, sizeof(msg), "%s configured in port #%u.", + display_name, params->idx); + else + snprintf(msg, sizeof(msg), "%s configured in port #%u.", + params->name, params->idx); + } - if (!block_osd_spam) - rarch_main_msg_queue_push(msg, 0, 60, false); + if (!block_osd_spam) + rarch_main_msg_queue_push(msg, 0, 60, false); RARCH_LOG("%s\n", msg); } diff --git a/input/input_driver.c b/input/input_driver.c index 61b426cdc1..5a94202d10 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -214,7 +214,10 @@ retro_input_t input_driver_keys_pressed(void) state = input->key_pressed(driver->input_data, key); if (key >= RARCH_FIRST_META_KEY) + { state |= input->meta_key_pressed(driver->input_data, key); + RARCH_LOG("TEST1 \n TEST1 \n"); + } #ifdef HAVE_OVERLAY state |= input_overlay_key_pressed(key); @@ -222,7 +225,10 @@ retro_input_t input_driver_keys_pressed(void) #ifdef HAVE_COMMAND if (driver->command) + { state |= rarch_cmd_get(driver->command, key); + RARCH_LOG("TEST2 \n TEST2 \n"); + } #endif if (state) From 028b28bf6b8331e7b11c200b1169a411cebe464a Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 31 Jul 2015 23:19:57 -0500 Subject: [PATCH 4/7] remove bogus messages that I shouldn't have commited --- input/input_driver.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index 5a94202d10..61b426cdc1 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -214,10 +214,7 @@ retro_input_t input_driver_keys_pressed(void) state = input->key_pressed(driver->input_data, key); if (key >= RARCH_FIRST_META_KEY) - { state |= input->meta_key_pressed(driver->input_data, key); - RARCH_LOG("TEST1 \n TEST1 \n"); - } #ifdef HAVE_OVERLAY state |= input_overlay_key_pressed(key); @@ -225,10 +222,7 @@ retro_input_t input_driver_keys_pressed(void) #ifdef HAVE_COMMAND if (driver->command) - { state |= rarch_cmd_get(driver->command, key); - RARCH_LOG("TEST2 \n TEST2 \n"); - } #endif if (state) From 6fbfc27a1f5cbc7d1cffbcde04f05afb496843fc Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 31 Jul 2015 23:40:30 -0500 Subject: [PATCH 5/7] reduce OSD spam --- input/input_autodetect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index fc57a23258..1b0940b1ad 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -127,14 +127,14 @@ static void input_autoconfigure_joypad_add( if (!settings) return; - + settings->input.autoconfigured[params->idx] = true; input_autoconfigure_joypad_conf(conf, settings->input.autoconf_binds[params->idx]); - if (!strcmp(device_type,"remote")) + if (!strcmp(device_type,"remote") && !remote_is_bound) { - snprintf(msg, sizeof(msg), "%s configured for gui navigation", + snprintf(msg, sizeof(msg), "%s configured", params->name, params->idx); remote_is_bound = true; } From 801ad5c4ff409f92038d7d9a9c05491e37846f7d Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 31 Jul 2015 23:49:38 -0500 Subject: [PATCH 6/7] reduce OSD spam --- input/input_autodetect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 1b0940b1ad..5c2277e6c8 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -148,7 +148,7 @@ static void input_autoconfigure_joypad_add( params->name, params->idx); } - if (!block_osd_spam) + if (!block_osd_spam && !remote_is_bound) rarch_main_msg_queue_push(msg, 0, 60, false); RARCH_LOG("%s\n", msg); From 916190e6832de2288c76b4acd31a52526c7f9cf6 Mon Sep 17 00:00:00 2001 From: radius Date: Sat, 1 Aug 2015 00:07:28 -0500 Subject: [PATCH 7/7] cleaner approach to reduce OSD spam --- input/input_autodetect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 5c2277e6c8..09d2e3f553 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -132,10 +132,13 @@ static void input_autoconfigure_joypad_add( input_autoconfigure_joypad_conf(conf, settings->input.autoconf_binds[params->idx]); - if (!strcmp(device_type,"remote") && !remote_is_bound) + if (!strcmp(device_type,"remote")) { snprintf(msg, sizeof(msg), "%s configured", params->name, params->idx); + + if(!remote_is_bound) + rarch_main_msg_queue_push(msg, 0, 60, false); remote_is_bound = true; } else @@ -146,11 +149,10 @@ static void input_autoconfigure_joypad_add( else snprintf(msg, sizeof(msg), "%s configured in port #%u.", params->name, params->idx); + if (!block_osd_spam) + rarch_main_msg_queue_push(msg, 0, 60, false); } - if (!block_osd_spam && !remote_is_bound) - rarch_main_msg_queue_push(msg, 0, 60, false); - RARCH_LOG("%s\n", msg); }