From 82f7a99eda27dd8f09b2e16bdacc50e71fdcaf33 Mon Sep 17 00:00:00 2001 From: Pit64 Date: Mon, 20 Oct 2025 13:23:14 +0200 Subject: [PATCH] feat(controllers): add nso controllers inputs --- .../system/.emulationstation/es_input.cfg | 40 ++++++++++++++++++- .../libretro/libretroControllers.py | 10 ++--- .../generators/mupen/mupenControllers.py | 10 ++--- 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/board/recalbox/fsoverlay/recalbox/share_init/system/.emulationstation/es_input.cfg b/board/recalbox/fsoverlay/recalbox/share_init/system/.emulationstation/es_input.cfg index 566bd016dd..49af8878e5 100644 --- a/board/recalbox/fsoverlay/recalbox/share_init/system/.emulationstation/es_input.cfg +++ b/board/recalbox/fsoverlay/recalbox/share_init/system/.emulationstation/es_input.cfg @@ -59,7 +59,6 @@ - @@ -72,7 +71,6 @@ - @@ -237,4 +235,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/configgen/configgen/generators/libretro/libretroControllers.py b/projects/configgen/configgen/generators/libretro/libretroControllers.py index e62942d81c..21df5730cd 100644 --- a/projects/configgen/configgen/generators/libretro/libretroControllers.py +++ b/projects/configgen/configgen/generators/libretro/libretroControllers.py @@ -426,11 +426,11 @@ class LibretroControllers: settings.setInt("input_player{}_joypad_index".format(playerIndex), inputIndex) # Specific configuration for Nintendo Switch N64 Controller - if controller.DeviceName == 'Nintendo Switch N64 Controller': - settings.setString("input_player{}_r_x_plus_btn".format(playerIndex), '"9"') - settings.setString("input_player{}_r_x_minus_btn".format(playerIndex), '"2"') - settings.setString("input_player{}_r_y_plus_btn".format(playerIndex), '"8"') - settings.setString("input_player{}_r_y_minus_btn".format(playerIndex), '"3"') + if controller.DeviceName in ['Nintendo Switch N64 Controller', 'N64 Controller']: + settings.setString("input_player{}_r_x_plus_btn".format(playerIndex), '"2"') # C-Right + settings.setString("input_player{}_r_x_minus_btn".format(playerIndex), '"4"') # C-Left + settings.setString("input_player{}_r_y_plus_btn".format(playerIndex), '"3"') # C-Down + settings.setString("input_player{}_r_y_minus_btn".format(playerIndex), '"10"') # C-Up # remap config print("[libretroControllers] setting input_libretro_device_p{}={}".format(playerIndex, 1)) diff --git a/projects/configgen/configgen/generators/mupen/mupenControllers.py b/projects/configgen/configgen/generators/mupen/mupenControllers.py index a982ce0dac..b26d8dd36f 100644 --- a/projects/configgen/configgen/generators/mupen/mupenControllers.py +++ b/projects/configgen/configgen/generators/mupen/mupenControllers.py @@ -83,12 +83,12 @@ def defineControllerKeys(controller: Controller) -> Dict[str, str]: config['X Axis'] = "button({},{})".format(controller.Left.Id, controller.Right.Id) config['Y Axis'] = "button({},{})".format(controller.Up.Id, controller.Down.Id) - if controller.DeviceName == 'Nintendo Switch N64 Controller': + if controller.DeviceName in ['Nintendo Switch N64 Controller', 'N64 Controller']: # Specific case for the official N64 controller for Nintendo Switch - config['C Button U'] = "button(3)"; - config['C Button D'] = "button(8)"; - config['C Button L'] = "button(2)"; - config['C Button R'] = "button(9)"; + config['C Button U'] = "button(10)" + config['C Button D'] = "button(3)" + config['C Button L'] = "button(4)" + config['C Button R'] = "button(2)" return config -- GitLab