Skip to content

Instantly share code, notes, and snippets.

@geoffyuen
Last active March 6, 2019 05:01
Show Gist options
  • Select an option

  • Save geoffyuen/d9741c04ce60bab777491ffa0c7470a2 to your computer and use it in GitHub Desktop.

Select an option

Save geoffyuen/d9741c04ce60bab777491ffa0c7470a2 to your computer and use it in GitHub Desktop.
ia-rcade helper scripts
#!/bin/bash
# echo fullnames of roms in ./roms and lets you run
clear
echo -n "Loading"
list=()
roms=()
PS3="Type a number or ctrl-c to quit: "
for filename in roms/*.zip
do
rom=$(grep -i "^$(basename "$filename" .zip) " listfull.txt)
list+=("$rom")
rom=$(basename "$filename" .zip)
roms+=("$rom")
echo -n "."
done
clear
select opt in "${list[@]}"
do
if [ "${roms[$REPLY-1]}" ] ; then
mame ${roms[$REPLY-1]}
else
exit 0
fi
done
#!/bin/bash
# search for game supply keyword or words wrapped in quotes, ia-rade to download and play
IFS=$'\n'
results=( $(mame -listfull | grep -i "$1") )
unset IFS
PS3="Type a number or ctrl-c to quit: "
select opt in "${results[@]}"
do
if [ "$REPLY" = "q" ]; then
exit 0
else
rom=$(echo $opt | awk '{print $1;}')
ia-rcade -noexecmame $rom
mame $rom
exit 0
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment