PKG-retroarch: use "menu_unified_controls" & fix input polling (#166)

- u can use real keyboard on OSK (when searching for e.g.)
- add hack for "Swap OK/Cancel buttons in menu" when using OSK
- using "Unified menu controls" for keystrokes so will behave the same as controller which is to expect

refactor commits log
This commit is contained in:
Apaczer
2025-05-12 16:57:13 +02:00
committed by GitHub
parent 2a71e32c30
commit 8037d1c1e2
10 changed files with 204 additions and 61 deletions

View File

@@ -1,5 +1,14 @@
From a5fdd63c17a1410c5a81c4d55faebfe45305550c Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Mon, 10 Mar 2025 20:39:21 +0100
Subject: [PATCH] Makefile.miyoo: use STAGING dir of BR2
---
Makefile.miyoo | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile.miyoo b/Makefile.miyoo
index 751cdf2639..df9c37fc33 100644
index 2880af10ad..68e047898c 100644
--- a/Makefile.miyoo
+++ b/Makefile.miyoo
@@ -3,7 +3,7 @@
@@ -27,3 +36,6 @@ index 751cdf2639..df9c37fc33 100644
#########################
#########################
--
2.45.2.windows.1

View File

@@ -1,5 +1,16 @@
From ca93a57b99cc028d2870a95ac81163335c84481e Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Mon, 10 Mar 2025 20:40:29 +0100
Subject: [PATCH] config.def.h: disable Vsync
Makefile.miyoo: add optimize flags
---
Makefile.miyoo | 2 +-
config.def.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile.miyoo b/Makefile.miyoo
index 2880af10ad..f1a785f818 100644
index 68e047898c..a026317e6a 100644
--- a/Makefile.miyoo
+++ b/Makefile.miyoo
@@ -124,7 +124,7 @@ DEF_FLAGS += -I. -Ideps -Ideps/stb -DMIYOO=1 -DDINGUX -MMD
@@ -12,10 +23,10 @@ index 2880af10ad..f1a785f818 100644
ASFLAGS :=
LDFLAGS := -Wl,--gc-sections
diff --git a/config.def.h b/config.def.h
index 25f0dbe463..a53076361c 100644
index 0eea764ee3..6c0d0abcd9 100644
--- a/config.def.h
+++ b/config.def.h
@@ -356,7 +356,7 @@
@@ -364,7 +364,7 @@
#define DEFAULT_DISABLE_COMPOSITION false
/* Video VSYNC (recommended) */
@@ -24,7 +35,7 @@ index 25f0dbe463..a53076361c 100644
/* Vulkan specific */
#define DEFAULT_MAX_SWAPCHAIN_IMAGES 3
@@ -513,7 +513,7 @@
@@ -541,7 +541,7 @@
#if defined(DINGUX)
/* Enables aspect ratio correction (1:1 PAR) when
* using the IPU hardware scaler in Dingux devices */
@@ -33,3 +44,6 @@ index 25f0dbe463..a53076361c 100644
/* Sets image filtering method when using the
* IPU hardware scaler in Dingux devices */
#if defined(RETROFW)
--
2.45.2.windows.1

View File

@@ -1,16 +1,18 @@
Subject: [PATCH] change sdl_dingux gamepad to sdl & add joypad bind
From 3cbcc816cb4840d60b2cfe7620364c4fe4fc0cd1 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Mon, 10 Mar 2025 20:42:53 +0100
Subject: [PATCH] Change def gamepad driver (sdl_dingux to sdl) & rebind
Signed-off-by: Apaczer <94932128+Apaczer@users.noreply.github.com>
add -DMIYOO flag
---
Makefile.miyoo | 2 +-
config.def.h | 4 ++-
config.def.keybinds.h | 60 +++++++++++++++++++++----------------------
configuration.c | 12 ++++-----
input/input_driver.c | 4 +--
5 files changed, 42 insertions(+), 40 deletions(-)
4 files changed, 40 insertions(+), 38 deletions(-)
diff --git a/Makefile.miyoo b/Makefile.miyoo
index 2880af10ad..b343697d2d 100644
index a026317e6a..4c4d92b208 100644
--- a/Makefile.miyoo
+++ b/Makefile.miyoo
@@ -120,7 +120,7 @@ OBJ :=
@@ -23,7 +25,7 @@ index 2880af10ad..b343697d2d 100644
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE
LIBS := -ldl -lz -lrt -pthread -lasound
diff --git a/config.def.h b/config.def.h
index 0eea764ee3..8a8d35789a 100644
index 6c0d0abcd9..6b67763eae 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1605,8 +1605,10 @@
@@ -301,3 +303,6 @@ index b8f947273e..84ab3480fc 100644
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL;
#elif defined(DJGPP)
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_DOS;
--
2.45.2.windows.1

View File

@@ -1,8 +1,17 @@
From b3000a0120290c36f6fbb11f87d1642796dbc58b Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Mon, 10 Mar 2025 20:43:32 +0100
Subject: [PATCH] config.def.h: reduce audio delay to 64
---
config.def.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 25f0dbe463..a4aa1cc802 100644
index 6b67763eae..673219ae5f 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1112,7 +1112,7 @@
@@ -1165,7 +1165,7 @@
/* Desired audio latency in milliseconds. Might not be honored
* if driver can't provide given latency. */
@@ -11,3 +20,6 @@ index 25f0dbe463..a4aa1cc802 100644
/* For most Android devices, 64ms is way too low. */
#define DEFAULT_OUT_LATENCY 128
#define DEFAULT_IN_LATENCY 128
--
2.45.2.windows.1

View File

@@ -1,39 +1,17 @@
Subject: [PATCH] remove input polling from sdl_input.c
From c52584d8b2bc796c20c8853e47c518686c32c5d1 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Wed, 30 Apr 2025 23:08:23 +0200
Subject: [PATCH] input/driver: correct Miyoo mapping in MENU
fix double events register in e.g. on screen keyboard (osk)
correct Miyoo mapping in MENU
Signed-off-by: Apaczer <94932128+Apaczer@users.noreply.github.com>
---
input/drivers/sdl_input.c | 2 ++
input/input_driver.c | 42 ++++++++++++++++++++++++++++++++++++++-
2 files changed, 43 insertions(+), 1 deletion(-)
input/input_driver.c | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c
index 3774c82421..c0b7ec5111 100644
--- a/input/drivers/sdl_input.c
+++ b/input/drivers/sdl_input.c
@@ -370,6 +370,7 @@ static void sdl_input_poll(void *data)
sdl_poll_mouse(sdl);
+#ifndef MIYOO
#ifdef HAVE_SDL2
while (SDL_PeepEvents(&event, 1,
SDL_GETEVENT, SDL_KEYDOWN, SDL_MOUSEWHEEL) > 0)
@@ -445,6 +446,7 @@ static void sdl_input_poll(void *data)
}
#endif
}
+#endif
}
static uint64_t sdl_get_capabilities(void *data)
diff --git a/input/input_driver.c b/input/input_driver.c
index 177d5df2b8..459aabb6e3 100644
index 8be3dcd294..a7f930f86d 100644
--- a/input/input_driver.c
+++ b/input/input_driver.c
@@ -6298,6 +6298,22 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
@@ -7116,6 +7116,22 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
unsigned i;
unsigned ids[][2] =
{
@@ -56,7 +34,7 @@ index 177d5df2b8..459aabb6e3 100644
{RETROK_RETURN, RETRO_DEVICE_ID_JOYPAD_A },
{RETROK_BACKSPACE, RETRO_DEVICE_ID_JOYPAD_B },
{RETROK_DELETE, RETRO_DEVICE_ID_JOYPAD_Y },
@@ -6312,6 +6328,7 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
@@ -7130,6 +7146,7 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
{RETROK_PAGEDOWN, RETRO_DEVICE_ID_JOYPAD_R },
{RETROK_HOME, RETRO_DEVICE_ID_JOYPAD_L3 },
{RETROK_END, RETRO_DEVICE_ID_JOYPAD_R3 },
@@ -64,7 +42,7 @@ index 177d5df2b8..459aabb6e3 100644
{0, RARCH_QUIT_KEY }, /* 14 */
{0, RARCH_FULLSCREEN_TOGGLE_KEY },
{0, RARCH_UI_COMPANION_TOGGLE },
@@ -6357,7 +6374,11 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
@@ -7175,7 +7192,11 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
unsigned i;
unsigned ids[][2] =
{
@@ -76,7 +54,7 @@ index 177d5df2b8..459aabb6e3 100644
{RETROK_UP, RETRO_DEVICE_ID_JOYPAD_UP },
{RETROK_DOWN, RETRO_DEVICE_ID_JOYPAD_DOWN },
{RETROK_LEFT, RETRO_DEVICE_ID_JOYPAD_LEFT },
@@ -6523,10 +6544,28 @@ void input_keyboard_event(bool down, unsigned code,
@@ -7341,10 +7362,28 @@ void input_keyboard_event(bool down, unsigned code,
* is active */
if (menu_st->flags & MENU_ST_FLAG_SCREENSAVER_ACTIVE)
{
@@ -106,7 +84,7 @@ index 177d5df2b8..459aabb6e3 100644
(code == RETROK_SLASH) || /* RETRO_DEVICE_ID_JOYPAD_X */
(code == RETROK_RSHIFT) || /* RETRO_DEVICE_ID_JOYPAD_SELECT */
(code == RETROK_RIGHT) || /* RETRO_DEVICE_ID_JOYPAD_RIGHT */
@@ -6539,6 +6578,7 @@ void input_keyboard_event(bool down, unsigned code,
@@ -7357,6 +7396,7 @@ void input_keyboard_event(bool down, unsigned code,
(code == RETROK_RETURN) || /* RETRO_DEVICE_ID_JOYPAD_A */
(code == RETROK_DELETE) || /* RETRO_DEVICE_ID_JOYPAD_Y */
BIT512_GET(input_st->keyboard_mapping_bits, code))))
@@ -115,5 +93,5 @@ index 177d5df2b8..459aabb6e3 100644
struct menu_state *menu_st = menu_state_get_ptr();
menu_st->flags &= ~MENU_ST_FLAG_SCREENSAVER_ACTIVE;
--
2.34.1
2.45.2.windows.1

View File

@@ -0,0 +1,25 @@
From 9116e6ccb9fba122d962876963b17fb1f72454f3 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Mon, 10 Mar 2025 20:46:29 +0100
Subject: [PATCH] Makefile.miyoo: enable Networking
---
Makefile.miyoo | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.miyoo b/Makefile.miyoo
index 4c4d92b208..87013d37f0 100644
--- a/Makefile.miyoo
+++ b/Makefile.miyoo
@@ -112,7 +112,7 @@ HAVE_LIBSHAKE = 0
HAVE_CORE_INFO_CACHE = 1
#HAVE_TINYALSA = 1
HAVE_NEAREST_RESAMPLER = 1
-
+HAVE_NETWORKING = 1
OS = Linux
TARGET = retroarch
--
2.45.2.windows.1

View File

@@ -1,13 +0,0 @@
diff --git a/Makefile.miyoo b/Makefile.miyoo
index 2880af10ad..1762d23e72 100644
--- a/Makefile.miyoo
+++ b/Makefile.miyoo
@@ -112,7 +112,7 @@ HAVE_LIBSHAKE = 0
HAVE_CORE_INFO_CACHE = 1
#HAVE_TINYALSA = 1
HAVE_NEAREST_RESAMPLER = 1
-
+HAVE_NETWORKING = 1
OS = Linux
TARGET = retroarch

View File

@@ -0,0 +1,43 @@
From f9f4635e7c5c19cd703ba687d649effe2666dcbd Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Wed, 30 Apr 2025 23:13:22 +0200
Subject: [PATCH] sdl_input: remove input polling for console inputs
fix double events register in e.g. on screen keyboard (osk), when using handheld btns
---
input/drivers/sdl_input.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c
index 169e92bffa..e491e5497d 100644
--- a/input/drivers/sdl_input.c
+++ b/input/drivers/sdl_input.c
@@ -446,6 +446,25 @@ static void sdl_input_poll(void *data)
if (event.key.keysym.mod & 0x8000 /*KMOD_SCROLL*/)
mod |= RETROKMOD_SCROLLOCK;
+#ifdef MIYOO
+ if (event.key.keysym.sym != SDLK_UP &&
+ event.key.keysym.sym != SDLK_DOWN &&
+ event.key.keysym.sym != SDLK_LEFT &&
+ event.key.keysym.sym != SDLK_RIGHT &&
+ event.key.keysym.sym != SDLK_LALT &&
+ event.key.keysym.sym != SDLK_LCTRL &&
+ event.key.keysym.sym != SDLK_LSHIFT &&
+ event.key.keysym.sym != SDLK_SPACE &&
+ event.key.keysym.sym != SDLK_TAB &&
+ event.key.keysym.sym != SDLK_BACKSPACE &&
+ event.key.keysym.sym != SDLK_PAGEUP &&
+ event.key.keysym.sym != SDLK_PAGEDOWN &&
+ event.key.keysym.sym != SDLK_RALT &&
+ event.key.keysym.sym != SDLK_RSHIFT &&
+ event.key.keysym.sym != SDLK_RCTRL)
+ //event.key.keysym.sym != SDLK_RETURN
+ //event.key.keysym.sym != SDLK_ESCAPE
+#endif
input_keyboard_event(event.type == SDL_KEYDOWN, code, code, mod,
RETRO_DEVICE_KEYBOARD);
}
--
2.45.2.windows.1

View File

@@ -0,0 +1,39 @@
From a8707d43317491e1ebb8954875642db3a2880100 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Wed, 30 Apr 2025 22:54:35 +0200
Subject: [PATCH] input_driver: hack for swapped OK/CANCEL in OSK
(normal behaviour)
cancel - rm sign
ok - add sign
---
input/input_driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/input/input_driver.c b/input/input_driver.c
index a7f930f86d..fb064cc513 100644
--- a/input/input_driver.c
+++ b/input/input_driver.c
@@ -7194,6 +7194,7 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
{
#ifdef MIYOO
{RETROK_LALT, RETRO_DEVICE_ID_JOYPAD_A },
+ {RETROK_LCTRL, RETRO_DEVICE_ID_JOYPAD_B },
#else
{RETROK_LCTRL, RETRO_DEVICE_ID_JOYPAD_A },
#endif
@@ -7207,7 +7208,10 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
};
if (settings->bools.input_menu_swap_ok_cancel_buttons)
- ids[0][1] = RETRO_DEVICE_ID_JOYPAD_B;
+ {
+ ids[0][1] = RETRO_DEVICE_ID_JOYPAD_A;
+ ids[1][1] = RETRO_DEVICE_ID_JOYPAD_B;
+ }
for (i = 0; i < ARRAY_SIZE(ids); i++)
{
--
2.45.2.windows.1

View File

@@ -0,0 +1,28 @@
From 341aedc63a28be707c029d77df5b9b0adbb690f8 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Wed, 30 Apr 2025 23:04:15 +0200
Subject: [PATCH] configuration: set active "Unified Menu Controls"
---
configuration.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configuration.c b/configuration.c
index 84ab3480fc..c17aabf89b 100644
--- a/configuration.c
+++ b/configuration.c
@@ -1917,7 +1917,11 @@ static struct config_bool_setting *populate_settings_bool(
#endif
#ifdef HAVE_MENU
+#ifdef MIYOO
+ SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, true, false);
+#else
SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false);
+#endif
SETTING_BOOL("menu_disable_info_button", &settings->bools.menu_disable_info_button, true, false, false);
SETTING_BOOL("menu_disable_search_button", &settings->bools.menu_disable_search_button, true, false, false);
SETTING_BOOL("menu_disable_left_analog", &settings->bools.menu_disable_left_analog, true, false, false);
--
2.45.2.windows.1