#!/bin/sh
HOME=`pwd`
OPTS="-inipath . -fullscreen"
OPTS="$OPTS -cfg_directory ./cfg"
OPTS="$OPTS -comment_directory ./comments"
OPTS="$OPTS -ctrlr_directory ./ctrlr"
OPTS="$OPTS -diff_directory ./diff"
OPTS="$OPTS -hiscore_directory ./hi"
OPTS="$OPTS -input_directory ./inp"
OPTS="$OPTS -memcard_directory ./mem"
OPTS="$OPTS -nvram_directory ./nvram"
OPTS="$OPTS -state_directory ./sta"
OPTS="$OPTS -snapshot_directory ./snap"
mkdir -p cfg diff hi inp mem nvram rc sta
ROM=`zenity --file-selection --title="Select a ROM"`
[ $? = 0 ] || exit 1
MODE=`zenity --list --title "Select display options" \
--column "" --column "Display Mode" \
1 "Normal" \
2 "2x Scale" \
3 "2x Scale, Rotate left" \
4 "2x Scale, Rotate right"`
[ $? = 0 ] || exit 1
case "$MODE" in
2) OPTS="$OPTS -s 2" ;;
3) OPTS="$OPTS -s 2 -rl" ;;
4) OPTS="$OPTS -s 2 -rr" ;;
esac
./xmame.sdl $OPTS $ROM
[ $? = 0 ] || zenity --text-info --title="Oops..." \
--filename /tmp/pndrunmame.106.out > /dev/null