-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
118 lines (104 loc) · 3.86 KB
/
install
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
#!/usr/bin/env bash
cd /tmp
sudo apt-get update
sudo apt-get install --yes libsqlite3-dev zlib1g zlib1g-dev libsdl2-dev libsdl2-image-dev libguichan-dev
wget -N -q -O- "http://kat5200.jillybunch.com/downloads/kat5200-0.8.1.tar.gz" | tar -xvz --strip-components=1
# remove F1-key invoking debugger
sed -i -e '250d' /tmp/src/interface/ui.c
#Since combo button support in v0.8.0 this is no longer needed
#sed -i '1727 a\
# if ((SDL_JoystickGetButton(g_pc_joy[0].joy_ptr,8) == SDL_PRESSED) && (SDL_JoystickGetButton(g_pc_joy[0].joy_ptr,9) == SDL_PRESSED)) return -1;' /tmp/src/interface/sdl_if.c
./configure
make
sudo make install
if [ ! -d "/home/pi/RetroPie/roms/atari5200" ]; then
mkdir /home/pi/RetroPie/roms/atari5200
fi
if [ -f "/home/pi/RetroPie/BIOS/5200.ROM" ]
then
echo "Bios has been found."
else
clear
echo "Bios file not found."
echo "Please download '5200.ROM' (google is your friend) and place it in the bios directory."
# is wget bios allowed ?
read -n 1 -s -p "Press any key to continue"
clear
fi
if [ ! -d "/opt/retropie/configs/atari5200" ]; then
mkdir /opt/retropie/configs/atari5200
fi
if [ ! -d "/home/pi/.kat5200" ]; then
mkdir /home/pi/.kat5200
fi
if [ -f "/etc/kat5200/kat5200.db3" ]; then
sudo rm /etc/kat5200/kat5200.db3
fi
if [ -f "/home/pi/kat5200.db3" ]; then
sudo rm /home/pi/kat5200.db3
fi
if [ -f "/home/pi/.kat5200/kat5200.db3" ]
then
echo "A configuration file is already present."
else
echo "Default configuration file not found, downloading it."
cd /home/pi/.kat5200
wget -N -O kat5200.db3 https://github.com/futurechild/Kat5200-Retropie/raw/master/default_config.db3
cd /tmp
fi
if [ -f "/opt/retropie/configs/atari5200/emulators.cfg" ]
then
echo "Emulators file already present, it will be renamed."
# maybe use sed to alter this file ?
mv /opt/retropie/configs/atari5200/emulators.cfg /opt/retropie/configs/atari5200/emulators.cfg_org
cat <<- EOF > /opt/retropie/configs/atari5200/emulators.cfg
kat5200 = "/usr/local/bin/kat5200 %ROM%"
default = "kat5200"
EOF
else
echo "Emulator file not found, creating one"
cat <<- EOF > /opt/retropie/configs/atari5200/emulators.cfg
kat5200 = "/usr/local/bin/kat5200 %ROM%"
default = "kat5200"
EOF
fi
# Re-worked to make dryer and avoid duplicate system entries
clear
if [ ! -f "/opt/retropie/configs/all/emulationstation/es_systems.cfg" ]
then
echo "Emulationstation systems file not found, creating it."
sudo cp /etc/emulationstation/es_systems.cfg /opt/retropie/configs/all/emulationstation/es_systems.cfg
else
echo "Emulationstation systems file is already present."
fi
sudo chown pi:pi /opt/retropie/configs/all/emulationstation/es_systems.cfg
fgrep -q 'atari5200' /opt/retropie/configs/all/emulationstation/es_systems.cfg
if [ $? -eq 0 ]
then
echo "atari5200 system already configured in es_systems.cfg"
else
sed -i '/<systemList>/a\
<system>\
<name>atari5200</name>\
<fullname>Atari 5200</fullname>\
<path>/home/pi/RetroPie/roms/atari5200</path>\
<extension>.7z .a52 .bin .zip .7Z .A52 .BIN .ZIP</extension>\
<command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ atari5200 %ROM%</command>\
<platform>atari5200</platform>\
<theme>atari5200</theme>\
</system>' /opt/retropie/configs/all/emulationstation/es_systems.cfg
echo "Emulationstation systems file was missing entry for Atari 5200"
echo "The following has been added to it :"
echo " <system>"
echo " <name>atari5200</name>"
echo " <fullname>Atari 5200</fullname>"
echo " <path>/home/pi/RetroPie/roms/atari5200</path>"
echo " <extension>.7z .a52 .bin .zip .7Z .A52 .BIN .ZIP</extension>"
echo " <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ atari5200 %ROM%</command>"
echo " <platform>atari5200</platform>"
echo " <theme>atari5200</theme>"
echo " </system>"
fi
echo " "
echo "kat5200 should now have been successfully installed"
echo "please reboot your system"