mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
Remove unused functions from run_game.sh
This commit is contained in:
parent
7aa2623870
commit
db2efde58a
|
@ -365,30 +365,6 @@ handle_inject_placeholder() {
|
||||||
echo "$cmd"
|
echo "$cmd"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to get the first available emulator in the list
|
|
||||||
get_first_emulator() {
|
|
||||||
local system_name=$system
|
|
||||||
system_section=$(xmllint --xpath "//system[name='$system_name']" "$es_systems" 2>/dev/null)
|
|
||||||
|
|
||||||
if [ -z "$system_section" ]; then
|
|
||||||
log e "System not found: $system_name"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract the first command and use it as the selected emulator
|
|
||||||
first_command=$(echo "$system_section" | xmllint --xpath "string(//command[1])" - 2>/dev/null)
|
|
||||||
|
|
||||||
if [[ -n "$first_command" ]]; then
|
|
||||||
# Substitute placeholders in the command
|
|
||||||
first_command=$(substitute_placeholders "$first_command")
|
|
||||||
log d "Automatically selected the first emulator: $first_command"
|
|
||||||
echo "$first_command"
|
|
||||||
else
|
|
||||||
log e "No command found for the system: $system_name"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Find the emulator path from the es_find_rules.xml file
|
# Find the emulator path from the es_find_rules.xml file
|
||||||
find_emulator() {
|
find_emulator() {
|
||||||
local emulator_name="$1"
|
local emulator_name="$1"
|
||||||
|
@ -433,24 +409,6 @@ find_emulator() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to find the emulator name from the label in es_systems.xml
|
|
||||||
find_emulator_name_from_label() {
|
|
||||||
local label="$1"
|
|
||||||
|
|
||||||
# Search for the emulator matching the label in the es_systems.xml file
|
|
||||||
extracted_emulator_name=$(xmllint --recover --xpath "string(//system[name='$system']/command[@label='$label']/text())" "$es_systems" 2>/dev/null | sed 's/%//g' | sed 's/EMULATOR_//g' | cut -d' ' -f1)
|
|
||||||
log d "Found emulator from label: $extracted_emulator_name"
|
|
||||||
|
|
||||||
emulator_command=$(find_emulator "$extracted_emulator_name")
|
|
||||||
|
|
||||||
if [[ -n "$emulator_command" ]]; then
|
|
||||||
echo "$emulator_command"
|
|
||||||
else
|
|
||||||
log e "Found emulator from label: emulator name not found for label: $label"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to find systems by file extension and let user choose
|
# Function to find systems by file extension and let user choose
|
||||||
find_system_by_extension() {
|
find_system_by_extension() {
|
||||||
local file_path="$1"
|
local file_path="$1"
|
||||||
|
|
Loading…
Reference in a new issue