diff --git a/Makefile.pandora b/Makefile.pandora index 2de3efdf84..6ba39ef28e 100644 --- a/Makefile.pandora +++ b/Makefile.pandora @@ -11,10 +11,10 @@ all: $(BINDIR)/retroarch pnd: retroarch.pnd -install: all $(BINDIR)/retroarch-joyconfig $(PNDDIR)/readme.html +install: all $(BINDIR)/retroarch-joyconfig $(BINDIR)/retroarch-zip $(PNDDIR)/readme.html retroarch: - ./configure --prefix=$PND_BASEDIR/$PRJ --disable-ffmpeg --disable-cg --disable-xml --disable-python --disable-libpng --disable-pulse --disable-opengl + ./configure --prefix=$PND_BASEDIR/$PRJ --disable-ffmpeg --disable-cg --disable-python --disable-libpng --disable-pulse --disable-jack --enable-gles --enable-xml make -f Makefile $(BINDIR)/retroarch: retroarch @@ -25,6 +25,10 @@ $(BINDIR)/retroarch-joyconfig: tools/retroarch-joyconfig mkdir -p $(BINDIR) cp tools/retroarch-joyconfig $(BINDIR)/retroarch-joyconfig +$(BINDIR)/retroarch-zip: retroarch-zip + mkdir -p $(BINDIR) + cp retroarch-zip $(BINDIR)/retroarch-zip + $(PNDDIR)/readme.html: README.md markdown README.md > $(PNDDIR)/readme.html diff --git a/pandora/PXML.xml b/pandora/PXML.xml index a75c462979..6387d5a65b 100644 --- a/pandora/PXML.xml +++ b/pandora/PXML.xml @@ -2,14 +2,47 @@ - - - RetroArch + + + - - + + + + RetroArch + + + + RetroArch is a modular multi-system emulator system that is designed to be fast, lightweight, and portable. + + + + + + + + + + + + + + + + + + + RetroArch + + + RetroArch + + + Frontend to libretro + + Frontend to libretro @@ -20,6 +53,43 @@ + + + + + + + + + + + + + + + + + + + + + RetroArch-Phoenix + + + RetroArch-Phoenix + + + Frontend to frontend to libretro + + + Frontend to frontend to libretro + + + + + + + @@ -29,4 +99,6 @@ + + diff --git a/pandora/previews/retroarch-phoenix.png b/pandora/previews/retroarch-phoenix.png new file mode 100644 index 0000000000..1ad9e92f7b Binary files /dev/null and b/pandora/previews/retroarch-phoenix.png differ diff --git a/pandora/previews/retroarch.png b/pandora/previews/retroarch.png index 0bad4e70e7..57da421ab4 100644 Binary files a/pandora/previews/retroarch.png and b/pandora/previews/retroarch.png differ diff --git a/pandora/retroarch/phoenix.cfg b/pandora/retroarch/phoenix.cfg new file mode 100644 index 0000000000..828cb7f72f --- /dev/null +++ b/pandora/retroarch/phoenix.cfg @@ -0,0 +1,2 @@ +config_path = "/mnt/utmp/retroarch/retroarch/retroarch.cfg" +retroarch_path = "/mnt/utmp/retroarch/bin/retroarch" diff --git a/pandora/retroarch/retroarch.cfg b/pandora/retroarch/retroarch.cfg index 83a2e4a4a6..202db4bd34 100644 --- a/pandora/retroarch/retroarch.cfg +++ b/pandora/retroarch/retroarch.cfg @@ -19,7 +19,7 @@ savestate_directory = /mnt/utmp/retroarch/retroarch # Load libretro from a dynamic location for dynamically built RetroArch. # This option is mandatory. # On Pandora, it's usually overridden by the launcher script. -libretro_path = "/mnt/utmp/retroarch/lib/libretro-fceumm.so" +libretro_path = "/mnt/utmp/retroarch/lib/libretro-fceu.so" # Environment variables internally in RetroArch. # Implementations can tap into this user-specificed information to enable functionality @@ -37,8 +37,7 @@ system_directory = /mnt/utmp/retroarch/ #### Video # Video driver to use. "gl", "xvideo", "sdl" or "ext" (external API driver) -# On Pandora, "xvideo" and "sdl" are available, and "sdl" is preferred -# if using notaz's SDL omapdss. +# On Pandora, "sdl" is preferred if using notaz's SDL omapdss. video_driver = "sdl" # Path to external video driver using the RetroArch driver API. @@ -61,9 +60,6 @@ video_fullscreen = false # Force 16-bit colors. Apparently some video cards in use today have troubles with 32-bit ... #video_force_16bit = true -# Forcibly disable composition. Only works in Windows Vista/7 for now. -# video_disable_composition = false - # Video vsync. #video_vsync = false @@ -86,14 +82,10 @@ video_aspect_ratio_auto = true # Forces cropping of overscanned frames. Crops away top 7 scanlines and 8 bottom scanlines. (15/15 for interlaced frames). # video_crop_overscan = false -# Path to Cg shader. -# video_cg_shader = "/path/to/cg/shader.cg" - -# Path to bSNES XML shader (GLSL only). If both Cg shader path and XML shader path are defined, -# Cg shader will take priority unless overridden in video_shader_type. +# Path to bSNES XML shader (GLSL only). # video_bsnes_shader = "/path/to/bsnes/xml/shader.shader" -# Which shader type to use. Valid values are "cg", "bsnes", "none" and "auto" +# Which shader type to use. Valid values are "bsnes", "none" and "auto" # video_shader_type = auto # Defines a directory where XML shaders are kept. @@ -209,23 +201,23 @@ input_player1_left = left input_player1_right = right input_player1_up = up input_player1_down = down -# input_player1_l2 = -# input_player1_r2 = -# input_player1_l3 = -# input_player1_r3 = +input_player1_l2 = num1 +input_player1_r2 = backspace +input_player1_l3 = e +input_player1_r3 = i # Two analog sticks (DualShock-esque). # Bound as usual, however, if a real analog axis is bound, # it can be read as a true analog. # Positive X axis is right, Positive Y axis is down. -# input_player1_l_x_plus = -# input_player1_l_x_minus = -# input_player1_l_y_plus = -# input_player1_l_y_minus = -# input_player1_r_x_plus = -# input_player1_r_x_minus = -# input_player1_r_y_plus = -# input_player1_r_y_minus = +input_player1_l_x_plus_axis = +0 +input_player1_l_x_minus_axis = -0 +input_player1_l_y_plus_axis = +1 +input_player1_l_y_minus_axis = -1 +input_player1_r_x_plus_axis = +2 +input_player1_r_x_minus_axis = -2 +input_player1_r_y_plus_axis = +3 +input_player1_r_y_minus_axis = -3 # If desired, it is possible to override which joypads are being used for player 1 through 5. First joypad available is 0. # input_player1_joypad_index = 0 diff --git a/pandora/scripts/env-vars.sh b/pandora/scripts/env-vars.sh new file mode 100755 index 0000000000..d80a46b155 --- /dev/null +++ b/pandora/scripts/env-vars.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +export HOME="$(readlink -f $(dirname $0)/..)" +export XDG_CONFIG_HOME="${HOME}" +export PATH="${HOME}/bin:${PATH:-"/usr/bin:/bin:/usr/local/bin"}" +export LD_LIBRARY_PATH="${HOME}/lib:${LD_LIBRARY_PATH:-"/usr/lib:/lib"}" + +if [ -d /mnt/utmp/retroarch/share ] ; then + export XDG_DATA_DIRS=${HOME}/share:$XDG_DATA_DIRS:/usr/share +fi + +# use notaz's optimized driver +export SDL_VIDEODRIVER="omapdss" +export SDL_AUDIODRIVER="alsa" + +# integral scaling +export SDL_OMAP_LAYER_SIZE="pixelperfect" + +# load the libstdc++ from gcc-4.7 because phoenix and some cores don't build in anything less +# preload latest notaz SDL that knows what "pixelperfect" is +export LD_PRELOAD=${HOME}/lib/libstdc++.so.6:$HOME/lib/libSDL-1.2.so.0.11.3 + diff --git a/pandora/scripts/retroarch-phoenix.sh b/pandora/scripts/retroarch-phoenix.sh new file mode 100755 index 0000000000..8fb49dc8af --- /dev/null +++ b/pandora/scripts/retroarch-phoenix.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +source "$(dirname $0)/env-vars.sh" + +exec retroarch-phoenix "${@}" + diff --git a/pandora/scripts/retroarch.sh b/pandora/scripts/retroarch.sh index 0805da9939..4e1f807c73 100755 --- a/pandora/scripts/retroarch.sh +++ b/pandora/scripts/retroarch.sh @@ -1,46 +1,50 @@ -#!/bin/sh -export PATH="/mnt/utmp/retroarch/bin:${PATH:-"/usr/bin:/bin:/usr/local/bin"}" -export LD_LIBRARY_PATH="/mnt/utmp/retroarch/lib:${LD_LIBRARY_PATH:-"/usr/lib:/lib"}" -export HOME="/mnt/utmp/retroarch" XDG_CONFIG_HOME="/mnt/utmp/retroarch" +#!/bin/bash -if [ -d /mnt/utmp/retroarch/share ] ; then - export XDG_DATA_DIRS=/mnt/utmp/retroarch/share:$XDG_DATA_DIRS:/usr/share -fi +source "$(dirname $0)/env-vars.sh" # choose a libretro core. -cd /mnt/utmp/retroarch/lib +cd ${HOME}/lib BACKEND=$(ls -1 libretro*.so | zenity --list --column=Backend) -cd $HOME +cd ${HOME} # if user didn't select a libretro, bail out. -[ -z "$BACKEND" ] && exit 0 +[ -z "${BACKEND}" ] && exit 0 # narrow down the available file formats for the file chooser. FILTER='All files (*)|*' -case "$BACKEND" in - libretro-fceu*.so) +case "${BACKEND}" in + libretro-fceu*.so | libretro-bnes.so) FILTER='NES (*.nes)|*.nes' ;; - libretro-pocketsnes.so | libretro-snes9x*.so) - FILTER='SNES (*.sfc)|*.sfc' + libretro-pocketsnes.so | libretro-snes9x*.so | libretro-bsnes*.so) + FILTER='SNES (*.sfc; *.smc)|*.sfc *.smc' ;; libretro-gambatte.so) - FILTER='GBC (*.gb; *.gbc)|*.gb *.gbc' + FILTER='GBC (*.gb; *.gbc; *.sgb)|*.gb *.gbc *.sgb' ;; - libretro-meteor.so | libretro-vba.so ) + libretro-meteor.so | libretro-vba.so | libretro-gpsp.so) FILTER='GBA (*.gba)|*.gba' ;; - libretro-imame4all.so) # does libretro-fba.so belong here? + libretro-imame4all.so | libretro-fba.so) FILTER='Arcade (*.zip)|*.zip' ;; libretro-genplus.so) - FILTER='Genesis/MegaDrive (*.md; *.gen)|*.md *.gen' + FILTER='Genesis/MegaDrive/SegaCD (*.md; *.gen; *.bin; *.iso)|*.md *.gen *.bin *.iso' + ;; + libretro-pcsx-rearmed.so | libretro-yabause.so) + FILTER='Disc image (*.iso; *.bin; *.img; *.cue)|*.iso *.bin *.img *.cue' ;; libretro-prboom.so) FILTER='Doom (*.wad)|*.wad' ;; esac +# bit hackish, silently adds supported archive formats to file listings. +# worth noting that the pandora itself doesn't have 7z in firmware by default. +if [[ ! "${FILTER}" =~ ^Arcade ]] ; then + FILTER="${FILTER} *.zip *.rar *.7z" +fi + # try to point the file chooser at the last used path, if there is one. LASTROM= if [ -r "${BACKEND}-lastrom.txt" ] ; then @@ -50,17 +54,13 @@ fi ROM=$(zenity --file-selection --file-filter="${FILTER}" "${LASTROM}") # if user didn't select a ROM, bail out. -[ -z "$ROM" ] && exit 0 +[ -z "${ROM}" ] && exit 0 -echo "$ROM" > "${BACKEND}-lastrom.txt" +echo "${ROM}" > "${BACKEND}-lastrom.txt" -# use notaz's optimized driver -export SDL_VIDEODRIVER="omapdss" -export SDL_AUDIODRIVER="alsa" - -# integral scaling -export SDL_OMAP_LAYER_SIZE="pixelperfect" - -# preload my modified SDL that knows what "pixelperfect" is -exec env LD_PRELOAD=/mnt/utmp/retroarch/lib/libSDL-1.2.so.0.11.3 retroarch "${ROM}" -L "/mnt/utmp/retroarch/lib/${BACKEND}" "${@}" +if [[ "${ROM}" =~ \.(zip|rar|7z)$ ]] && [[ ! "${FILTER}" =~ ^Arcade ]] ; then + source retroarch-zip "${ROM}" -L "${HOME}/lib/${BACKEND}" "${@}" +else + exec retroarch "${ROM}" -L "${HOME}/lib/${BACKEND}" "${@}" +fi diff --git a/retroarch-zip b/retroarch-zip index ba0ff38d67..4d912a4b06 100755 --- a/retroarch-zip +++ b/retroarch-zip @@ -8,8 +8,8 @@ die() { echo "Error: $1" - rm "$TMPROM" - rm -r "$TMPDIR" + rm "${TMPROM}" + rm -r "${TMPDIR}" exit 1 } @@ -25,53 +25,32 @@ shift extract_zip() { which unzip >/dev/null 2>&1 || die "Cannot find unzip" - which zipinfo >/dev/null 2>&1 || die "Cannot find zipinfo" - FILENAME="`zipinfo -1 \"$1\" | grep '\.s[mf]c$' | head -n1`" - if [ -z "$FILENAME" ]; then - die "Cannot find .smc nor .sfc file in archive" - fi - - # The people who made the [!] naming convention obviously have never used regex ... <_< - FILENAME_FIXED="`echo $FILENAME | sed -e 's|\[|\\\\[|g' -e 's|!|\\\\!|g' -e 's|\]|\\\\]|g'`" - - unzip -p "$1" "$FILENAME_FIXED" > "$TMPROM" + unzip "$1" -d "${TMPDIR}" >/dev/null 2>&1 || die "Couldn't extract from archive" } extract_7z() { which 7z >/dev/null 2>&1 || die "Cannot find 7z" - 7z x "$1" -o"$TMPDIR" >/dev/null 2>&1 || die "Couldn't extract from archive" - FILENAME="`ls \"$TMPDIR\" | grep '\.s[mf]c$' | head -n1`" - if [ -z "$FILENAME" ]; then - die "Cannot find .smc nor .sfc file in archive" - fi - - mv "${TMPDIR}/${FILENAME}" "$TMPROM" + 7z x "$1" -o"${TMPDIR}" >/dev/null 2>&1 || die "Couldn't extract from archive" } extract_rar() { which unrar >/dev/null 2>&1 || die "Cannot find unrar" - unrar x "$1" "$TMPDIR" >/dev/null 2>&1 || die "Couldn't extract from archive" - FILENAME="`ls \"$TMPDIR\" | grep '\.s[mf]c$' | head -n1`" - if [ -z "$FILENAME" ]; then - die "Cannot find .smc nor .sfc file in archive" - fi - - mv "${TMPDIR}/${FILENAME}" "$TMPROM" + unrar x "$1" "${TMPDIR}" >/dev/null 2>&1 || die "Couldn't extract from archive" } -case "$COMP_FILE" in +case "${COMP_FILE}" in *.zip ) - extract_zip "$COMP_FILE" + extract_zip "${COMP_FILE}" EXTENSION=".zip" ;; *.7z ) - extract_7z "$COMP_FILE" + extract_7z "${COMP_FILE}" EXTENSION=".7z" ;; *.rar ) - extract_rar "$COMP_FILE" + extract_rar "${COMP_FILE}" EXTENSION=".rar" ;; * ) @@ -79,17 +58,25 @@ case "$COMP_FILE" in ;; esac -SAVENAME="`basename \"$COMP_FILE\" $EXTENSION`" -DIRNAME="`dirname \"$COMP_FILE\"`" +# pick the largest non-directory in the root of the unpacked archive +FILENAME="`ls -Sp \"${TMPDIR}\" | grep -v /$ | head -n1`" +if [ -z "${FILENAME}" ]; then + die "Cannot find any files in root of archive" +fi +mv "${TMPDIR}/${FILENAME}" "${TMPROM}" + +SAVENAME="`basename \"${COMP_FILE}\" ${EXTENSION}`" +DIRNAME="`dirname \"${COMP_FILE}\"`" SAVENAME="${SAVENAME}.srm" -RetroArch_PATH="`which retroarch`" -if [ -z "$RetroArch_PATH" ]; then +EXE="`which retroarch`" +if [ -z "${EXE}" ]; then die "Cannot find RetroArch in path." fi -echo "Temp ROM: $TMPROM" +echo "Temp ROM: ${TMPROM}" echo "Savename: ${DIRNAME}/${SAVENAME}" -"$RetroArch_PATH" "$TMPROM" -s "${DIRNAME}/${SAVENAME}" "$@" -rm "$TMPROM" -rm -r "$TMPDIR" +"${EXE}" "${TMPROM}" -s "${DIRNAME}/${SAVENAME}" "$@" +rm "${TMPROM}" +rm -r "${TMPDIR}" +