From a6b24b4d4270e04c0832d44aca86d80fbbc30d92 Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 4 Aug 2017 00:35:42 -0500 Subject: [PATCH 1/5] fire tv hack --- .../gl_shaders/pipeline_bokeh.glsl.frag.h | 2 +- input/drivers/android_input.c | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h b/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h index 4bba0f339c..9a88c64fb0 100644 --- a/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h +++ b/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h @@ -11,7 +11,7 @@ static const char* stock_fragment_xmb_bokeh = GLSL( uv.x *= OutputSize.x / OutputSize.y; vec3 color = vec3(0.0); - for( int i=0; i < 8; i++ ) + for( int i=0; i < 48; i++ ) { float pha = sin(float(i) * 546.13 + 1.0) * 0.5 + 0.5; float siz = pow(sin(float(i) * 651.74 + 5.0) * 0.5 + 0.5, 4.0); diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 70f80f75b9..a0b38f66b9 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -1072,6 +1072,29 @@ static void handle_hotplug(android_input_t *android, } } + /* Amazon Fire TV & Fire stick */ + else if(strstr(device_model, "AFTM") || strstr(device_model, "AFTS")) + { + RARCH_LOG("Special Device Detected: %s\n", device_model); + { + /* always map remote to port #0 */ + if (strstr(device_name, "Amazon Fire TV Remote") + { + android->pads_connected = 0; + *port = 0; + strlcpy(name_buf, device_name, sizeof(name_buf)); + } + /* remove the remote when a gamepad enters */ + else if(strstr(android->pad_states[0].name,"Amazon Fire TV Remote")) + { + android->pads_connected = 0; + *port = 0; + strlcpy(name_buf, device_name, sizeof(name_buf)); + } + else + strlcpy(name_buf, device_name, sizeof(name_buf)); + } + /* Other uncommon devices * These are mostly remote control type devices, bind them always to port 0 * And overwrite the binding whenever a controller button is pressed From 2ef75cb300742fef461d7980ab2b948aa28b93bb Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 4 Aug 2017 00:50:23 -0500 Subject: [PATCH 2/5] buildfix --- gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h | 2 +- input/drivers/android_input.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h b/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h index 9a88c64fb0..4bba0f339c 100644 --- a/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h +++ b/gfx/drivers/gl_shaders/pipeline_bokeh.glsl.frag.h @@ -11,7 +11,7 @@ static const char* stock_fragment_xmb_bokeh = GLSL( uv.x *= OutputSize.x / OutputSize.y; vec3 color = vec3(0.0); - for( int i=0; i < 48; i++ ) + for( int i=0; i < 8; i++ ) { float pha = sin(float(i) * 546.13 + 1.0) * 0.5 + 0.5; float siz = pow(sin(float(i) * 651.74 + 5.0) * 0.5 + 0.5, 4.0); diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index a0b38f66b9..18f945bb2e 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -1078,7 +1078,7 @@ static void handle_hotplug(android_input_t *android, RARCH_LOG("Special Device Detected: %s\n", device_model); { /* always map remote to port #0 */ - if (strstr(device_name, "Amazon Fire TV Remote") + if (strstr(device_name, "Amazon Fire TV Remote")) { android->pads_connected = 0; *port = 0; @@ -1093,6 +1093,7 @@ static void handle_hotplug(android_input_t *android, } else strlcpy(name_buf, device_name, sizeof(name_buf)); + } } /* Other uncommon devices From f5360d0d8250636a74dd58fa52053d38d65f414e Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 4 Aug 2017 01:17:32 -0500 Subject: [PATCH 3/5] extra devices --- input/drivers/android_input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 18f945bb2e..adf3f18404 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -1073,7 +1073,9 @@ static void handle_hotplug(android_input_t *android, } /* Amazon Fire TV & Fire stick */ - else if(strstr(device_model, "AFTM") || strstr(device_model, "AFTS")) + else if(strstr(device_model, "AFTB") || strstr(device_model, "AFTT") || + strstr(device_model, "AFTS") || strstr(device_model, "AFTM") || + strstr(device_model, "AFTRS")) { RARCH_LOG("Special Device Detected: %s\n", device_model); { From 3a3d9cd41e54771292d68b6e69f3ab0bbac88900 Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 4 Aug 2017 01:37:16 -0500 Subject: [PATCH 4/5] if swap override is not specified it should be false --- tasks/task_autodetect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index e3da649000..b43bf8e87e 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -189,6 +189,8 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, { if (config_get_bool(conf, "input_swap_override", &tmp)) input_autoconfigure_swap_override = tmp; + else + input_autoconfigure_swap_override = false; } if (!block_osd_spam) From ceaeee33e0ae4d6e15fc12eba26247c8598bdc98 Mon Sep 17 00:00:00 2001 From: radius Date: Fri, 4 Aug 2017 01:40:36 -0500 Subject: [PATCH 5/5] update CHANGES.md --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index a1fa5e4865..ff6cb64f98 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # 1.6.4 (future) +- ANDROID: Fire Stick & Fire TV remote overrides gamepad port 0 on button press and viceversa like SHIELD devices +- INPUT: input swap override flag (for remotes) is cleared correctly + # 1.6.3 - IOS: Fix GL regression - 32bit color format cores were no longer rendering - CHEEVOS: Add support for N64 cheevos and other small fixes.