-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSM3-INSTALLER.sh
140 lines (126 loc) · 5.11 KB
/
SM3-INSTALLER.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
brst="$(tput sgr0)"
fgred="${rst}$(tput setaf 1)" # Red
bld="$(tput bold)"
bfgred="${bld}$(tput setaf 1)"
function sm3_menu() {
local choice
while true; do
choice=$(dialog --backtitle "$BACKTITLE" --title "SEGA MODEL 3 INSTALLER V1.2 " \
--ok-label Select --cancel-label Exit-Installer \
--menu "MODEL 3 INSTALLER" 25 50 40 \
1 "Install Model 3 " \
2 "Model 3 Info " \
- "__________ __ " \
- "\______ \ _____/ |________ ____ " \
- " | _// __ \ __\_ __ \/ _ \ " \
- " | | \ ___/| | | | \( <_> ) " \
- " |____|_ /\___ >__| |__| \____/ " \
- " \/ \/ " \
- "________ .__.__ " \
- "\______ \ _______ _|__| | ______" \
- " | | \_/ __ \ \/ / | | / ___/" \
- " | ' \ ___/\ /| | |__\___ \ " \
- "/_______ /\___ >\_/ |__|____/____ >" \
- " \/ \/ \/ " \
2>&1 > /dev/tty)
case "$choice" in
1) install_sm3 ;;
2) info_sm3 ;;
-) no ;;
*) break ;;
esac
done
}
function install_sm3(){
if [ -d "/opt/retropie/configs/emulators/supermodel" ]; then sudo rm -R /opt/retropie/emulators/supermodel/; fi
if [ -d "/opt/retropie/configs/model3" ]; then sudo rm -R /opt/retropie/configs/model3/; fi
sleep 5
echo "
Installing/Checking For Dependencies
-------------------------------------"
sleep 1
echo "Installing P7Zip"
sudo apt-get install -y p7zip
echo "Installing unzip"
sudo apt-get install -y unzip
echo "Installing LibSDl2-Net"
sudo apt-get install -y libsdl2-net-dev
echo "
-----------------------------
Dependencies Install Finished
-----------------------------"
sleep 2
echo "
--------------------------------
Begin Model 3 Install
--------------------------------"
cd /opt/retropie/emulators
sudo wget https://archive.org/download/DB-EMUS/Model%203/Supermodel.7z
sudo p7zip -d Supermodel.7z
cd /opt/retropie/configs
sudo wget https://archive.org/download/DB-EMUS/Model%203/Sega3-ES-Config.zip
sudo unzip Sega3-ES-Config.zip
cd ~/
sudo ln -s /opt/retropie/emulators/supermodel/bin/Config Config
sudo ln -s /opt/retropie/emulators/supermodel/bin/NVRAM NVRAM
sudo chmod 755 -R /opt/retropie/emulators/supermodel/bin
sudo chmod 755 -R ~/Config
mkdir ~/RetroPie/roms/model3
sleep 1
sudo rm -r ~/Config/Games.xml
sudo rm -r /opt/retropie/emulators/supermodel/bin/Config/Games.xml
sleep 1
sudo wget https://archive.org/download/DB-EMUS/Games.xml -P ~/Config/
sudo cp ~/Config/Games.xml -f /opt/retropie/emulators/supermodel/bin/Config/
sleep 1
sudo rm -f /opt/retropie/emulators/Supermodel.7z
sudo rm -f /opt/retropie/configs/Sega3-ES-Config.zip
echo "
--------------------------------
Model 3 Install Complete
--------------------------------"
local choice
while true; do
choice=$(dialog --backtitle "$BACKTITLE" --title "SM3 EXIT OPTIONS " \
--ok-label Select --cancel-label Exit-Installer \
--menu "EDIT ES SYSTEMS.CFG ??" 25 40 40 \
1 "YES EDIT /home/.emulationstation/es_system.cfg " \
2 "NO DO NOT EDIT my file" \
2>&1 > /dev/tty)
case "$choice" in
1) edit-systemslist ;;
2) finish-sm3 ;;
*) break ;;
esac
done
}
function edit-systemslist(){
if [ ! -s "$HOME/.emulationstation/es_systems.cfg" ]; then sudo rm -f $HOME/.emulationstation/es_systems.cfg; fi
if [ ! -f "$HOME/.emulationstation/es_systems.cfg" ]; then cp $HOME/.emulationstation/es_systems.cfg $HOME/RetroPie/retropiemenu/gamelist.xml; fi
CONTENT1="\t<system>\n\t\t <name>model3</name>\n\t\t <fullname>Sega Model 3</fullname> \n\t\t <path>/home/pi/RetroPie/roms/model3</path> \n\t\t <extension>.zip .ZIP</extension> \n\t\t<command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ model3 %ROM%</command> \n\t\t <platform>model3</platform> \n\t\t <theme>model3</theme> \n\t\t</system>"
C1=$(echo $CONTENT1 | sed 's/\//\\\//g')
if grep -q model3 "$HOME/.emulationstation/es_systems.cfg"; then echo "es_systems.cfg entry confirmed"
else
sed "/<\/system>/ s/.*/${C1}\n&/" $HOME/.emulationstation/es_systems.cfg > $HOME/temp
cat $HOME/temp > $HOME/.emulationstation/es_systems.cfg
rm -f $HOME/temp
fi
}
function finish_sm3(){
dialog --sleep 1 --title "SM3 EXIT MESSAGE" --msgbox "
THANKS FOR INSTALLING
ADD YOUR ROMS TO HOME/PI/RETROPIE/ROMS/MODEL3
YOU WILL HAVE TO MANUALLY EDIT ES SYSTEMS.CFG
ENJOY
PLEASE REPORT ERRORS TO RETRO DEVILS " 0 0
}
function info_sm3(){
dialog --sleep 1 --title "SM3 INFO MESSAGE" --msgbox "
Sega Model 3 is an arcade platform released in 1996 as the successor to Sega Model 2.
Model 3 continued several arcade games series established on previous Sega arcade boards.
With games such as; Daytona USA 2, Sega Rally 2, Virtua Fighter 3 and Star Wars Trilogy Arcade.
------------------------------------------------------------------------
This installer setups Retropie to run Model 3" 0 0
}
sm3_menu