2019-06-22 19:50:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# run from project root directory
|
|
|
|
|
2019-06-29 11:32:15 +00:00
|
|
|
cat res/games.conf |
|
|
|
|
tr "\r" "\n" |
|
|
|
|
grep "=" |
|
|
|
|
grep -v "^#" |
|
|
|
|
cut -d"," -f2 |
|
|
|
|
cut -d"=" -f1 | \
|
2019-06-22 19:50:24 +00:00
|
|
|
while read game; do
|
|
|
|
# if I knew how to use awk, this could be O(N) instead of O(N^2)
|
|
|
|
name=`cat res/games.conf | tr "\r" "\n" | grep "$game=" | cut -d"=" -f2`
|
2019-06-29 11:32:15 +00:00
|
|
|
|
2019-06-22 19:50:24 +00:00
|
|
|
# initialize attract mode configuration file for this game
|
2019-06-26 02:44:39 +00:00
|
|
|
echo "#\n# Attract mode for $name\n#\n" > /tmp/g
|
2019-06-29 11:32:15 +00:00
|
|
|
|
2019-06-29 12:54:00 +00:00
|
|
|
# add DHGR title screenshot, if any
|
2019-06-29 11:32:15 +00:00
|
|
|
[ -f res/title.dhgr/"$game" ] &&
|
2019-07-15 15:42:05 +00:00
|
|
|
echo "TITLE.DHGR/$game=B" >> /tmp/g
|
2019-06-29 11:32:15 +00:00
|
|
|
|
2019-06-22 19:50:24 +00:00
|
|
|
# add box art, if any
|
2019-06-29 11:32:15 +00:00
|
|
|
[ -f res/artwork.shr/"$game" ] &&
|
2019-07-15 15:42:05 +00:00
|
|
|
echo "ARTWORK.SHR/$game=C" >> /tmp/g
|
2019-06-29 11:32:15 +00:00
|
|
|
|
|
|
|
# add DHGR action screenshots, if any
|
|
|
|
cat res/ss/ACTDHGR*.CONF |
|
|
|
|
tr "\r" "\n" |
|
|
|
|
grep "$game""$" |
|
|
|
|
cut -d"=" -f1 |
|
|
|
|
sed -e "s/^/ACTION.DHGR\//g" |
|
2019-07-15 15:42:05 +00:00
|
|
|
sed -e "s/$/=B/g" |
|
2019-06-29 11:32:15 +00:00
|
|
|
sort |
|
|
|
|
uniq >> /tmp/g
|
|
|
|
|
|
|
|
# add HGR action screenshots, if any
|
|
|
|
cat res/ss/ACTION*.CONF |
|
|
|
|
tr "\r" "\n" |
|
|
|
|
grep "$game""$" |
|
|
|
|
cut -d"=" -f1 |
|
|
|
|
sed -e "s/^/ACTION.HGR\//g" |
|
2019-07-15 15:42:05 +00:00
|
|
|
sed -e "s/$/=A/g" |
|
|
|
|
sort |
|
|
|
|
uniq >> /tmp/g
|
|
|
|
|
|
|
|
# add GR action screenshots, if any
|
|
|
|
cat res/ss/ACTGR*.CONF |
|
|
|
|
tr "\r" "\n" |
|
|
|
|
grep "$game""$" |
|
|
|
|
cut -d"=" -f1 |
|
|
|
|
sed -e "s/^/ACTION.GR\//g" |
|
|
|
|
sed -e "s/$/=D/g" |
|
2019-06-29 11:32:15 +00:00
|
|
|
sort |
|
|
|
|
uniq >> /tmp/g
|
|
|
|
|
2019-06-22 19:50:24 +00:00
|
|
|
# add self-running demo, if any
|
2019-06-29 11:32:15 +00:00
|
|
|
cat res/attract.conf |
|
|
|
|
tr "\r" "\n" |
|
|
|
|
grep "^$game=0" >> /tmp/g
|
|
|
|
|
|
|
|
if [ "$game" == "SPARE.CHANGE" ]; then
|
|
|
|
echo "SPCARTOON.1=0" >> /tmp/g
|
|
|
|
echo "SPCARTOON.2=0" >> /tmp/g
|
|
|
|
echo "SPCARTOON.3=0" >> /tmp/g
|
|
|
|
echo "SPCARTOON.4=0" >> /tmp/g
|
|
|
|
echo "SPCARTOON.5=0" >> /tmp/g
|
|
|
|
echo "SPCARTOON.6=0" >> /tmp/g
|
|
|
|
fi
|
|
|
|
|
2019-07-01 00:49:27 +00:00
|
|
|
if [ "$game" == "PRINCEUNP" ]; then
|
2019-07-15 15:42:05 +00:00
|
|
|
echo "ARTWORK.SHR/POP.END=C" >> /tmp/g
|
2019-07-01 00:49:27 +00:00
|
|
|
fi
|
|
|
|
|
2019-06-22 19:50:24 +00:00
|
|
|
# add eof
|
2019-06-26 02:44:39 +00:00
|
|
|
echo "\n[eof]" >> /tmp/g
|
2019-06-29 11:32:15 +00:00
|
|
|
|
|
|
|
# change line endings
|
2019-06-26 02:44:39 +00:00
|
|
|
cat /tmp/g | tr "\n" "\r" > res/attract/"$game"
|
2019-06-29 11:32:15 +00:00
|
|
|
|
|
|
|
# clean up
|
2019-06-26 02:44:39 +00:00
|
|
|
rm /tmp/g
|
2019-06-22 19:50:24 +00:00
|
|
|
done
|