Break out BIOS check function

Add Godot data transfer temp file for BIOS check
This commit is contained in:
icenine451 2024-02-21 14:00:18 -05:00
parent eb0b535337
commit 7105285b33
3 changed files with 28 additions and 14 deletions

View file

@ -283,6 +283,29 @@ dir_prep() {
echo -e "$symlink is now $real\n"
}
check_bios_files() {
# This function validates all the BIOS files listed in the $bios_checklist and adds the results to an array called bios_checked_list which can be used elsewhere
rm -f "$godot_bios_files_checked" # Godot data transfer temp files
touch "$godot_bios_files_checked"
while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc
do
bios_file_found="No"
bios_hash_matched="No"
if [[ -f "$bios_folder/$bios_subdir$bios_file" ]]; then
bios_file_found="Yes"
if [[ $bios_hash == "Unknown" ]]; then
bios_hash_matched="Unknown"
elif [[ $(md5sum "$bios_folder/$bios_subdir$bios_file" | awk '{ print $1 }') == "$bios_hash" ]]; then
bios_hash_matched="Yes"
fi
fi
bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc")
echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc" >> "$godot_bios_files_checked" # Godot data transfer temp file
done < $bios_checklist
}
update_rpcs3_firmware() {
mkdir -p "$roms_folder/ps3/tmp"
chmod 777 "$roms_folder/ps3/tmp"

View file

@ -47,6 +47,10 @@ presets_dir="$emuconfigs/defaults/retrodeck/presets"
incompatible_presets_reference_list="$emuconfigs/defaults/retrodeck/reference_lists/incompatible_presets.cfg" # A config file listing all incompatible presets for reference (eg. cannot have borders and widescreen enabled simultaniously)
pretty_system_names_reference_list="$emuconfigs/defaults/retrodeck/reference_lists/pretty_system_names.cfg" # An internal translation list for turning internal names (eg. gbc) to "pretty" names (Nintendo GameBoy Color)
# Godot data transfer temp files
godot_bios_files_checked="var/config/retrodeck/godot_bios_files_checked.tmp"
# Config files for emulators with single config files
citraconf="/var/config/citra-emu/qt-config.ini"

View file

@ -940,20 +940,7 @@ configurator_check_bios_files() {
configurator_generic_dialog "RetroDECK Configurator - Check & Verify: BIOS Files" "This check will look for BIOS files that RetroDECK has identified as working.\n\nNot all BIOS files are required for games to work, please check the BIOS description for more information on its purpose.\n\nThere may be additional BIOS files that will function with the emulators that are not checked.\n\nSome more advanced emulators such as Yuzu will have additional methods for verifiying the BIOS files are in working order."
bios_checked_list=()
while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc
do
bios_file_found="No"
bios_hash_matched="No"
if [[ -f "$bios_folder/$bios_subdir$bios_file" ]]; then
bios_file_found="Yes"
if [[ $bios_hash == "Unknown" ]]; then
bios_hash_matched="Unknown"
elif [[ $(md5sum "$bios_folder/$bios_subdir$bios_file" | awk '{ print $1 }') == "$bios_hash" ]]; then
bios_hash_matched="Yes"
fi
fi
bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc")
done < $bios_checklist
check_bios_files
zenity --list --title="RetroDECK Configurator Utility - Check & Verify: BIOS Files" --cancel-label="Back" \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \