]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/opie-sh-snes/files/opie-sh-snes.sh
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / opie-sh-snes / files / opie-sh-snes.sh
1 #!/bin/sh
2 #Path to your Roms if you want to disable the menu
3 #LOCATION=/mnt/card/games/snes
4
5 # Give a default
6 if test -e /root/Settings/opie-sh-snes.conf
7 then
8         LOCATION="`cat /root/Settings/opie-sh-snes.conf`"
9 else
10         echo "/mnt/card/games/snes" > /root/Settings/opie-sh-snes.conf
11         #Enable Menu Rom Finder
12         LOCATION="` opie-sh -i -t "Path to Roms" -g -E -l -F /root/Settings/opie-sh-snes.conf `"
13         ! test -z "$LOCATION" && echo $LOCATION > /root/Settings/opie-sh-snes.conf
14 fi      
15
16 echo "LOCATION = [$LOCATION]"
17 if [ "$LOCATION" = "" ]; then exit; fi
18
19
20 #Load a game from your list
21 ROM=`   cd "$LOCATION" ; ls -1 *.zip \
22         | opie-sh -i -l -t "Snes9x" -F  -g `
23 if [ "$ROM" = "" ]; then exit; fi
24
25 echo "ROM = [$ROM]"
26
27 #Enable Sound Button
28 setsound () {
29         opie-sh -m -t "Sound"   \
30         -M "Do you want sound?" \
31         -g -0 Yes -1 No
32 RETURNCODE=$?
33
34 case $RETURNCODE in
35         0)  SOUND="-sound" ;;
36         1)  SOUND="-nosound" ;;
37 esac
38
39 echo "SOUND = [$SOUND] / RC = [$?]"
40 }
41
42
43 setsound
44
45
46
47 if [ "$SOUND" = "" ]; then exit; fi
48
49
50 snes9x $SOUND "$LOCATION/$ROM"