void-packages/srcpkgs/mame/files/mame.sh
jbu e533172819 mame: update to 0.162 and rename from sdlmame
- rename sdlmame -> mame
- remove handling of (no longer to be expected) 'u' patch versions
- now contains all mame and mess drivers in one binary
- replaces sdlmame and sdlmess
- the license did not change yet; plans are to move to GPL with next release
2015-05-27 17:41:15 +02:00

45 lines
1.4 KiB
Bash

#!/bin/sh
exec_mame() {
/usr/share/mame/mame \
-artpath "$HOME/.mame/artwork;artwork" \
-ctrlrpath "$HOME/.mame/ctrlr;ctrlr" \
-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
}
if [ "$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 mame.ini.bak"
mv mame.ini mame.ini.bak
fi
exec_mame
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
for f in artwork cfg comments ctrlr diff ini ip nvram \
samples snap sta roms; do
mkdir $HOME/.mame/${f}
done
cd $HOME/.mame && exec_mame
else
cd /usr/share/mame
./mame "$@"
fi