Skip to content

Instantly share code, notes, and snippets.

@substring
Created November 7, 2016 13:48
Show Gist options
  • Save substring/a3023d50d7fbfc8fc4546f250d8da5c2 to your computer and use it in GitHub Desktop.
Save substring/a3023d50d7fbfc8fc4546f250d8da5c2 to your computer and use it in GitHub Desktop.
Use mame resolution.ini to get rom's resolution
#!/bin/bash
if [ ! -f "resolution.ini" ] ; then
wget -nv http://www.progettosnaps.net/renameset/packs/pS_resolution.zip -O resolutions.zip
unzip -p resolutions.zip folder/resolution.ini | dos2unix > resolution.ini
rm resolutions.zip
fi
ROM=`basename "$1" .zip`
grep -q "$ROM" resolution.ini || { echo "$ROM not found" ; exit 1 ; }
sed "/^${ROM}$/q" resolution.ini | grep "\[.*\]" | tail -n 1 | tr -d "[]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment