2012-07-03 06:36:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-09-18 00:29:23 +00:00
|
|
|
source "$(dirname $0)/env-vars.sh"
|
2012-07-03 06:36:27 +00:00
|
|
|
|
2012-07-04 07:32:51 +00:00
|
|
|
# choose a libretro core.
|
2012-09-18 00:29:23 +00:00
|
|
|
cd ${HOME}/lib
|
2012-07-03 06:36:27 +00:00
|
|
|
BACKEND=$(ls -1 libretro*.so | zenity --list --column=Backend)
|
2012-09-18 00:29:23 +00:00
|
|
|
cd ${HOME}
|
2012-07-03 06:36:27 +00:00
|
|
|
|
2012-07-04 07:32:51 +00:00
|
|
|
# if user didn't select a libretro, bail out.
|
2012-09-18 00:29:23 +00:00
|
|
|
[ -z "${BACKEND}" ] && exit 0
|
2012-07-03 06:36:27 +00:00
|
|
|
|
2012-07-04 07:32:51 +00:00
|
|
|
# narrow down the available file formats for the file chooser.
|
2012-07-03 06:36:27 +00:00
|
|
|
FILTER='All files (*)|*'
|
2012-09-18 00:29:23 +00:00
|
|
|
case "${BACKEND}" in
|
|
|
|
libretro-fceu*.so | libretro-bnes.so)
|
2012-07-03 06:36:27 +00:00
|
|
|
FILTER='NES (*.nes)|*.nes'
|
|
|
|
;;
|
|
|
|
libretro-pocketsnes.so | libretro-snes9x*.so)
|
|
|
|
FILTER='SNES (*.sfc)|*.sfc'
|
2012-07-04 02:16:27 +00:00
|
|
|
;;
|
|
|
|
libretro-gambatte.so)
|
|
|
|
FILTER='GBC (*.gb; *.gbc)|*.gb *.gbc'
|
2012-07-03 06:36:27 +00:00
|
|
|
;;
|
2012-09-18 00:29:23 +00:00
|
|
|
libretro-meteor.so | libretro-vba.so | libretro-gpsp.so)
|
2012-07-03 06:36:27 +00:00
|
|
|
FILTER='GBA (*.gba)|*.gba'
|
|
|
|
;;
|
2012-08-03 01:16:29 +00:00
|
|
|
libretro-imame4all.so | libretro-fba.so)
|
2012-07-04 02:16:27 +00:00
|
|
|
FILTER='Arcade (*.zip)|*.zip'
|
2012-07-03 06:36:27 +00:00
|
|
|
;;
|
|
|
|
libretro-genplus.so)
|
2012-09-18 00:29:23 +00:00
|
|
|
FILTER='Genesis/MegaDrive/SegaCD (*.md; *.gen; *.bin; *.iso)|*.md *.gen *.bin *.iso'
|
2012-07-03 06:36:27 +00:00
|
|
|
;;
|
2012-08-03 01:16:29 +00:00
|
|
|
libretro-pcsx-rearmed.so)
|
|
|
|
FILTER='Disc image (*.iso; *.bin; *.img)|*.iso *.bin *.img'
|
|
|
|
;;
|
2012-07-03 06:36:27 +00:00
|
|
|
libretro-prboom.so)
|
|
|
|
FILTER='Doom (*.wad)|*.wad'
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2012-07-04 07:32:51 +00:00
|
|
|
# try to point the file chooser at the last used path, if there is one.
|
|
|
|
LASTROM=
|
|
|
|
if [ -r "${BACKEND}-lastrom.txt" ] ; then
|
|
|
|
LASTROM="--filename="$(head -1 "${BACKEND}-lastrom.txt")
|
|
|
|
fi
|
|
|
|
|
|
|
|
ROM=$(zenity --file-selection --file-filter="${FILTER}" "${LASTROM}")
|
|
|
|
|
|
|
|
# if user didn't select a ROM, bail out.
|
2012-09-18 00:29:23 +00:00
|
|
|
[ -z "${ROM}" ] && exit 0
|
2012-07-04 07:32:51 +00:00
|
|
|
|
2012-09-18 00:29:23 +00:00
|
|
|
echo "${ROM}" > "${BACKEND}-lastrom.txt"
|
2012-07-04 02:16:27 +00:00
|
|
|
|
2012-09-18 00:29:23 +00:00
|
|
|
# latest notaz SDL that knows what "pixelperfect" is
|
|
|
|
exec env LD_PRELOAD=${HOME}/lib/libSDL-1.2.so.0.11.3 retroarch "${ROM}" -L "${HOME}/lib/${BACKEND}" "${@}"
|
2012-07-03 06:36:27 +00:00
|
|
|
|