RetroPie - custom runcommand.sh - Find Emulator function
-
Hello,
I am trying to create a find emulator function for retropie which automatically loads through the MAME emulators and saves if the emulator loads successful or continue through the emulator list if failed. Here is my main function, the prob is I think I need to properly call the run command to try and launch with each emulator in a loop. Here is my code so far:function find_emulator() { local mode="$1" local options=() local i=1 while read line; do # convert key=value to array local line=(${line/=/ }) local id=${line[0]} [[ "$id" == "" ]] && continue [[ "$id" == "default" ]] && continue options+=("$id") ((i++)) done < <(sort "$EMU_SYS_CONF") local max=$i i=0 while [ $i -lt $max ]; do echo "default_emulator set $mode ${options[$i]}" default_emulator set "$mode" "${options[$i]}" get_sys_command set_save_vars load_mode_defaults echo "$COMMAND" runcommand "$@" | if grep -ewq "ERROR.*CONTENT LOAD" || grep -wq "supported"; then continue else return fi ((i++)) done }
Can anyone tell me the correct way to attempt a launch with each emulator, and is my grep finding text output correct? If you know any help would be appreciated. ^_^
-
I have completed the emulator finder. For those interested in using, see: https://gist.github.com/Langerz82/ec7c60edd6b02da78018fa113fda27b0
Hey just a note: The video output will most likely corrupt and show random pixels, this is normal operation and due to sending the emulator process in the background.
All the best!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.