aboutsummaryrefslogtreecommitdiff
path: root/games/o2em/o2em.sh
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2011-02-17 22:50:54 -0600
committerRobby Workman <rworkman@slackbuilds.org>2011-02-28 09:42:03 -0600
commitf68c028e33fb9fb0d3267cd72fe26f432b1ea643 (patch)
treeffef188fedfaa9c1dd69c6e5c9c105153015e635 /games/o2em/o2em.sh
parent848cabfbeb0846e0de4597fd83f555c274740311 (diff)
games/o2em: Added (Magnavox Odyssey II/VideoPac+ emulator)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'games/o2em/o2em.sh')
-rw-r--r--games/o2em/o2em.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/games/o2em/o2em.sh b/games/o2em/o2em.sh
new file mode 100644
index 0000000000000..5c0d75163c088
--- /dev/null
+++ b/games/o2em/o2em.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Wrapper script for SBo o2em package, by B. Watson
+
+# Emulator expects to find ./roms, ./bios, ./voice,
+# and its config file in the current dir at runtime.
+
+# Also, it expects the ROM it's running, to reside in
+# ./roms, so we have to symlink it there :(
+
+# All of this could have been done by hacking up the
+# source, but we want to avoid massive amounts of patching.
+
+EXE=/usr/libexec/o2em.bin
+SHAREDIR=/usr/share/o2em
+DIR=~/.o2em
+
+if [ ! -d $DIR ]; then
+ mkdir -p $DIR/roms
+ ln -s $SHAREDIR/{bios,voice} $DIR
+fi
+
+rom="$1"
+if [ ! -e "$rom" ]; then
+ exec $EXE "$@"
+fi
+
+shift
+shortrom="$( basename "$rom" )"
+ln -sf "$( readlink -f "$rom" )" $DIR/roms/"$shortrom"
+
+cd $DIR
+exec $EXE "$shortrom" "$@"