From a1e55bb06b33133bf79638f4298e4b2e8f667341 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 12 Sep 2024 11:30:39 +0900 Subject: [PATCH] RUN_GAME: fixed alternativeEmulator --- functions/run_game.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/functions/run_game.sh b/functions/run_game.sh index 2dbee57c..4f3afcbd 100755 --- a/functions/run_game.sh +++ b/functions/run_game.sh @@ -65,23 +65,17 @@ run_game() { altemulator=$(xmllint --recover --xpath "string(//game[path='$game_basename']/altemulator)" "$rdhome/ES-DE/gamelists/$system/gamelist.xml" 2>/dev/null) if [[ -n "$altemulator" ]]; then + log d "Found for game: $altemulator" emulator=$(xmllint --recover --xpath "string(//command[@label=\"$altemulator\"])" "$es_systems" 2>/dev/null) - else + + else # if no altemulator is found we search if a global one is set log d "No altemulator found in the game entry, searching for alternativeEmulator to check if a global emulator is set for the system $system" - alternative_emulator=$(xmllint --recover --xpath 'string(//alternativeEmulator/label)' "$rdhome/ES-DE/gamelists/$system/gamelist.xml" 2>/dev/null) - log d "Alternate emulator found in header: $alternative_emulator" + emulator=$(xmllint --recover --xpath "string(//system[platform='$system']/command[@label=\"$alternative_emulator\"])" "$es_systems" 2>/dev/null) - # TODO: fix this function - # [2024-09-12 10:51:11.232] [DEBUG] Alternate emulator found in header: PicoDrive - # then is broken - - # Find the emulator name from the label in es_systems.xml - emulator_name=$(find_emulator_name_from_label "$alternative_emulator") - emulator=$(find_emulator "$emulator_name") fi # Fallback to first available emulator in es_systems.xml if no found