-
Notifications
You must be signed in to change notification settings - Fork 1
/
BasiliskII.sh
59 lines (50 loc) · 1.73 KB
/
BasiliskII.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
#!/bin/bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
BLII_CPU_MASK=03
BLII_EXE_NAME="BasiliskII"
BLII_VMODE="-r 640 480 rgb32"
BLII_HOME_DIR="/media/fat/BasiliskII"
BLII_OPTIONS=""
BLII_LIB_PATH="$BLII_HOME_DIR/arm-linux-gnueabihf:$BLII_HOME_DIR/arm-linux-gnueabihf/pulseaudio"
BLII_CONF_TMP="/tmp/BLII.config"
BLII_CONF="$BLII_HOME_DIR/.config"
if [ -d "$BLII_CONF_TMP" ];
then
echo "Removing --> $BLII_CONF_TMP"
rm -rf "$BLII_CONF"
fi
echo "Creating DIR --> $BLII_CONF_TMP"
mkdir "$BLII_CONF_TMP"
if [ -L "$BLII_CONF" ];
then
echo "$BLII_CONF is a synlink - perfect :)"
else
if [ -d "$BLII_CONF" ];
then
echo "Removing --> $BLII_CONF"
rm -rf "$BLII_CONF"
fi
echo "Linking $BLII_CONF_TMP --> $BLII_CONF"
ln -s "$BLII_CONF_TMP" "$BLII_CONF"
fi
echo "Setting Video mode --> $BLII_VMODE"
vmode $BLII_VMODE
echo "Setting library path..."
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BLII_LIB_PATH"
echo $LD_LIBRARY_PATH
echo "Setting BasiliskII HOME path..."
export HOME="$BLII_HOME_DIR"
cd $BLII_HOME_DIR
echo "Starting BasiliskII..."
taskset $BLII_CPU_MASK $BLII_HOME_DIR/$BLII_EXE_NAME $BLII_OPTIONS
echo "Removing --> $BLII_CONF_TMP"
rm -rf "$BLII_CONF_TMP"