From 2eb153a74f720eb6c2ead54d522c08cd6f76b1d1 Mon Sep 17 00:00:00 2001 From: digitalLumberjack Date: Tue, 21 Oct 2025 23:20:56 +0200 Subject: [PATCH] fix(frontend): fix old sdl2 mapping guid --- board/recalbox/fsoverlay/recalbox/scripts/es_input.rng | 2 ++ .../share_init/system/.emulationstation/es_input.cfg | 8 ++++---- projects/frontend/es-core/src/input/InputManager.cpp | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/board/recalbox/fsoverlay/recalbox/scripts/es_input.rng b/board/recalbox/fsoverlay/recalbox/scripts/es_input.rng index 6f228cb576..92643d4ba5 100644 --- a/board/recalbox/fsoverlay/recalbox/scripts/es_input.rng +++ b/board/recalbox/fsoverlay/recalbox/scripts/es_input.rng @@ -32,6 +32,8 @@ + + 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..8eff0a2ac8 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 @@ -75,7 +75,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -128,7 +128,7 @@ - + diff --git a/projects/frontend/es-core/src/input/InputManager.cpp b/projects/frontend/es-core/src/input/InputManager.cpp index f310346408..2f473db911 100644 --- a/projects/frontend/es-core/src/input/InputManager.cpp +++ b/projects/frontend/es-core/src/input/InputManager.cpp @@ -448,7 +448,7 @@ bool InputManager::LookupDeviceXmlConfiguration(InputDevice& device) { // check the guid bool guid; - if (strlen(item.attribute("deviceName").value()) == 0) { + if (String(item.attribute("version").value()) == "2") { // sdl 2.26+ guid = (strcmp(device.GUID().c_str(), item.attribute("deviceGUID").value()) == 0) || device.IsKeyboard(); }else { @@ -493,7 +493,7 @@ void InputManager::WriteDeviceXmlConfiguration(InputDevice& device) if (root != nullptr) for (pugi::xml_node item = root.child("inputConfig"); item != nullptr; item = item.next_sibling("inputConfig")) { - if (strlen(item.attribute("deviceName").value()) == 0) { + if (String(item.attribute("version").value()) == "2") { // new kind for nameless entry (sdl2.26+) if (strcmp(device.GUID().c_str(), item.attribute("deviceGUID").value()) == 0 && device.AxeCount() == item.attribute("deviceNbAxes").as_int() && @@ -503,7 +503,7 @@ void InputManager::WriteDeviceXmlConfiguration(InputDevice& device) root.remove_child(item); break; } - }else { + } else { // old kind for nameful entry (sdl2.0) String CRC = String::ToHexa(gen_crc16((uint8_t*)item.attribute("deviceName").value(), strlen(item.attribute("deviceName").value()), true), 4, String::Hexa::None); String tempGUID = ""; -- GitLab