updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / sdlmame-wout-gconf / sdlmame.sh
blob38b48701ac3a9b0b79238417956c41c8a5c5460a
1 #!/bin/sh
3 # Create a variable equal to $HOME that will be used later in the ini creation
4 home=('$HOME')
6 if [ "$1" != "" ] && [ "$1" = "--newini" ]; then
7 echo "Rebuilding the ini file at $HOME/.mame/sdlmame.ini"
8 echo "Modify this file for permanent changes to your SDLMAME"
9 echo "options and paths before running SDLMAME again."
10 cd $HOME/.mame
11 if [ -e sdlmame.ini ]; then
12 echo "Your old ini file has been renamed to sdlmameini.bak"
13 mv sdlmame.ini sdlmameini.bak
15 /usr/share/sdlmame/sdlmame \
16 -artpath "$home/.mame/artwork;artwork" \
17 -ctrlrpath "$home/.mame/ctrlr;ctrlr" \
18 -inipath $home/.mame/ini \
19 -rompath $home/.mame/roms \
20 -samplepath $home/.mame/samples \
21 -cfg_directory $home/.mame/cfg \
22 -comment_directory $home/.mame/comments \
23 -diff_directory $home/.mame/diff \
24 -input_directory $home/.mame/inp \
25 -memcard_directory $home/.mame/memcard \
26 -nvram_directory $home/.mame/nvram \
27 -snapshot_directory $home/.mame/snap \
28 -state_directory $home/.mame/sta \
29 -video opengl \
30 -createconfig
31 elif [ ! -e $HOME/.mame ]; then
32 echo "Running SDLMAME for the first time..."
33 echo "Creating an ini file for SDLMAME at $HOME/.mame/sdlmame.ini"
34 echo "Modify this file for permanent changes to your SDLMAME"
35 echo "options and paths before running SDLMAME again."
36 mkdir $HOME/.mame
37 mkdir $HOME/.mame/{artwork,cfg,comments,ctrlr,diff,ini,inp,memcard,nvram,samples,snap,sta}
38 cd $HOME/.mame
39 /usr/share/sdlmame/sdlmame \
40 -artpath "$home/.mame/artwork;artwork" \
41 -ctrlrpath "$home/.mame/ctrlr;ctrlr" \
42 -inipath $home/.mame/ini \
43 -rompath $home/.mame/roms \
44 -samplepath $home/.mame/samples \
45 -cfg_directory $home/.mame/cfg \
46 -comment_directory $home/.mame/comments \
47 -diff_directory $home/.mame/diff \
48 -input_directory $home/.mame/inp \
49 -memcard_directory $home/.mame/memcard \
50 -nvram_directory $home/.mame/nvram \
51 -snapshot_directory $home/.mame/snap \
52 -state_directory $home/.mame/sta \
53 -video opengl \
54 -createconfig
55 else
56 cd /usr/share/sdlmame
57 ./sdlmame "$@"