forked from 0xe1f/blueberryMSX
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathr
executable file
·46 lines (45 loc) · 1.16 KB
/
r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
FILE1="./msx"
FILE2="./menu"
ITEM=`cat ./item`
MSXBUS1='/romtype1 msxbus'
#amixer cset numid=1 100 > /dev/null
num=1
echo "#!/bin/bash"> msx
echo -n "whiptail --title \"RPMC - Raspberry Pi MSX Clone\" --menu \"Choose a Machine\" 25 78 16 " >> msx
echo -n "" > menu
while machine='' read -r line || [[ -n "$line" ]]; do
if [[ $line =~ .*$1.* ]]; then
echo $line >> menu
echo -n "\"$num\" \"$line\" " >> msx
num=$((num + 1))
fi
done < msxmachines
echo -n "--default-item \"\$1\" " >> msx
echo "3>&2 2>&1 1>&3" >> msx
if [[ $@ =~ .*/rom1.* ]]; then
MSXBUS1=""
fi
while true;
do
ITEM=`cat ./item`
choice=$(./msx $ITEM)
if [ -z $choice ]; then
tput cvvis
./r0
exit
fi
a=`sed -n ${choice}p < menu`
echo $choice > ./item
if [[ -n $2 ]]; then
./bluemsx-pi /machine \"${a}\" /romtype2 msxbus $2 $3 $4 $5 $6 $7 > /dev/null 2>&1
# chmod 755
#./xx > /dev/null 2>&1 &
#sudo ./bluemsx-pi /machine "$a" /romtype2 msxbus $2 $3 $4 $5 $6 $7
else
./bluemsx-pi /machine \"${a}\" /romtype1 msxbus /romtype2 msxbus $2 $3 $4 $5 $6 $7 > /dev/null 2>&1
#chmod 755 xx
#./xx > /dev/null 2>&1 &
#sudo ./bluemsx-pi /machine "$a" /romtype1 msxbus /romtype2 msxbus $2 $3
fi
done