forked from mirror/daphne-emu
-
Notifications
You must be signed in to change notification settings - Fork 7
/
run.sh
executable file
·95 lines (80 loc) · 2.15 KB
/
run.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
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
if realpath / >/dev/null; then SCRIPT_DIR=$(realpath "$SCRIPT_DIR"); fi
DAPHNE_BIN=daphne.bin
DAPHNE_SHARE=~/.daphne
function STDERR () {
/bin/cat - 1>&2
}
echo "Daphne Launcher : Script dir is $SCRIPT_DIR"
cd "$SCRIPT_DIR"
# point to our linked libs that user may not have
export LD_LIBRARY_PATH=$SCRIPT_DIR:$DAPHNE_SHARE:$LD_LIBRARY_PATH
if [ "$1" = "-fullscreen" ]; then
FULLSCREEN="-fullscreen"
shift
fi
if [ -z "$1" ] ; then
echo "Specify a game to try: " | STDERR
echo
echo "$0 [-fullscreen] <gamename>" | STDERR
for game in ace astron badlands bega cliff cobra esh galaxyr gpworld interstellar lair lair2 mach3 roadblaster sdq tq uvt; do
if ls ~/.daphne/vldp*/$game >/dev/null 2>&1; then
installed="$installed $game"
else
uninstalled="$uninstalled $game"
fi
done
if [ "$uninstalled" ]; then
echo
echo "Games not found in ~/.daphne/vldp*: " | STDERR
echo "$uninstalled" | fold -s -w60 | sed 's/^ //; s/^/\t/' | STDERR
fi
if [ -z "$installed" ]; then
cat <<EOF
Error: No games installed. DVDs can be purchased from DigitalLeisure.com.
Please put the required files in ~/.daphne/vldp_dl/gamename/
EOF
else
echo
echo "Games available: " | STDERR
echo "$installed" | fold -s -w60 | sed 's/^ //; s/^/\t/' | STDERR
fi
exit 1
fi
case "$1" in
lair|lair2|ace|tq)
VLDP_DIR="vldp_dl"
FASTBOOT="-fastboot"
;;
*) VLDP_DIR="vldp"
esac
#strace -o strace.txt \
./$DAPHNE_BIN $1 vldp \
$FASTBOOT \
$FULLSCREEN \
-framefile $DAPHNE_SHARE/$VLDP_DIR/$1/$1.txt \
-homedir $DAPHNE_SHARE \
-datadir $DAPHNE_SHARE \
-blank_searches \
-min_seek_delay 1000 \
-seek_frames_per_ms 20 \
-sound_buffer 2048 \
-noserversend \
-x 640 \
-y 480
#-bank 0 11111001 \
#-bank 1 00100111 \
EXIT_CODE=$?
if [ "$EXIT_CODE" -ne "0" ] ; then
if [ "$EXIT_CODE" -eq "127" ]; then
echo ""
echo "Daphne failed to start." | STDERR
echo "This is probably due to a library problem." | STDERR
echo "Run ./daphne.bin directly to see which libraries are missing." | STDERR
echo ""
else
echo "DaphneLoader failed with an unknown exit code : $EXIT_CODE." | STDERR
fi
exit $EXIT_CODE
fi