Created
November 7, 2016 13:48
-
-
Save substring/a3023d50d7fbfc8fc4546f250d8da5c2 to your computer and use it in GitHub Desktop.
Use mame resolution.ini to get rom's resolution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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