summarylogtreecommitdiffstats
path: root/sdlmame.sh
diff options
context:
space:
mode:
authorsl1pkn072015-06-08 19:56:42 +0200
committersl1pkn072015-06-08 19:56:42 +0200
commite7971f782ea9b149da9afd0f8715b58b8a896d70 (patch)
tree29acfc70b59f3eaa2bc00765c2034eb5a3529d02 /sdlmame.sh
downloadaur-e7971f782ea9b149da9afd0f8715b58b8a896d70.tar.gz
Initial commit
Diffstat (limited to 'sdlmame.sh')
-rw-r--r--sdlmame.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/sdlmame.sh b/sdlmame.sh
new file mode 100644
index 000000000000..716f6d53e9b7
--- /dev/null
+++ b/sdlmame.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# Create a variable equal to $HOME that will be used later in the ini creation
+home=('$HOME')
+
+if [ "$1" != "" ] && [ "$1" = "--newini" ]; then
+ echo "Rebuilding the ini file at $HOME/.mame/mame.ini"
+ echo "Modify this file for permanent changes to your SDLMAME"
+ echo "options and paths before running SDLMAME again."
+ cd $HOME/.mame
+ if [ -e mame.ini ]; then
+ echo "Your old ini file has been renamed to mameini.bak"
+ mv mame.ini mameini.bak
+ fi
+ /usr/share/sdlmame/sdlmame \
+ -artpath "$home/.mame/artwork;artwork" \
+ -ctrlrpath "$home/.mame/ctrlr;ctrlr" \
+ -cheatpath "$home/.mame/cheat" \
+ -crosshairpath "$home/.mame/crosshair" \
+ -hashpath "$home/.mame/hash;hash" \
+ -inipath $home/.mame/ini \
+ -rompath $home/.mame/roms \
+ -samplepath $home/.mame/samples \
+ -cfg_directory $home/.mame/cfg \
+ -comment_directory $home/.mame/comments \
+ -diff_directory $home/.mame/diff \
+ -input_directory $home/.mame/inp \
+ -nvram_directory $home/.mame/nvram \
+ -snapshot_directory $home/.mame/snap \
+ -state_directory $home/.mame/sta \
+ -video opengl \
+ -createconfig
+elif [ ! -e $HOME/.mame ]; then
+ echo "Running SDLMAME for the first time..."
+ echo "Creating an ini file for SDLMAME at $HOME/.mame/mame.ini"
+ echo "Modify this file for permanent changes to your SDLMAME"
+ echo "options and paths before running SDLMAME again."
+ mkdir $HOME/.mame
+ mkdir $HOME/.mame/{artwork,cfg,cheat,comments,crosshair,ctrlr,diff,hash,ini,inp,nvram,samples,snap,sta,roms}
+ cd $HOME/.mame
+ /usr/share/sdlmame/sdlmame \
+ -artpath "$home/.mame/artwork;artwork" \
+ -ctrlrpath "$home/.mame/ctrlr;ctrlr" \
+ -cheatpath "$home/.mame/cheat" \
+ -crosshairpath "$home/.mame/crosshair" \
+ -hashpath "$home/.mame/hash;hash" \
+ -inipath $home/.mame/ini \
+ -rompath $home/.mame/roms \
+ -samplepath $home/.mame/samples \
+ -cfg_directory $home/.mame/cfg \
+ -comment_directory $home/.mame/comments \
+ -diff_directory $home/.mame/diff \
+ -input_directory $home/.mame/inp \
+ -nvram_directory $home/.mame/nvram \
+ -snapshot_directory $home/.mame/snap \
+ -state_directory $home/.mame/sta \
+ -video opengl \
+ -createconfig
+else
+ cd /usr/share/sdlmame
+ ./sdlmame "$@"
+fi