diff --git a/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh b/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh index 1b3b21387..3037ad3a1 100755 --- a/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh +++ b/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh @@ -24,10 +24,25 @@ fi #Prep PCSX2.ini for audio sed -i '/^BackendName =/c\BackendName =' /storage/.config/aethersx2/inis/PCSX2.ini +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + #All.. + unset EMUPERF +fi + #Emulation Station Features GAME=$(echo "${1}"| sed "s#^/.*/##") ASPECT=$(get_setting aspect_ratio ps2 "${GAME}") FPS=$(get_setting show_fps ps2 "${GAME}") + RATE=$(get_setting ee_cycle_rate ps2 "${GAME}") + SKIP=$(get_setting ee_cycle_skip ps2 "${GAME}") GRENDERER=$(get_setting graphics_backend ps2 "${GAME}") VSYNC=$(get_setting vsync ps2 "${GAME}") @@ -49,16 +64,20 @@ sed -i '/^BackendName =/c\BackendName =' /storage/.config/aethersx2/inis/PCSX2.i #Graphics Backend if [ "$GRENDERER" = "0" ] then - sed -i '/^Renderer =/c\Renderer = 12' /storage/.config/aethersx2/inis/PCSX2.ini + sed -i '/^Renderer =/c\Renderer = -1' /storage/.config/aethersx2/inis/PCSX2.ini fi if [ "$GRENDERER" = "1" ] then - sed -i '/^Renderer =/c\Renderer = 14' /storage/.config/aethersx2/inis/PCSX2.ini + sed -i '/^Renderer =/c\Renderer = 12' /storage/.config/aethersx2/inis/PCSX2.ini fi if [ "$GRENDERER" = "2" ] then - sed -i '/^Renderer =/c\Renderer = 13' /storage/.config/aethersx2/inis/PCSX2.ini + sed -i '/^Renderer =/c\Renderer = 14' /storage/.config/aethersx2/inis/PCSX2.ini fi + if [ "$GRENDERER" = "3" ] + then + sed -i '/^Renderer =/c\Renderer = 13' /storage/.config/aethersx2/inis/PCSX2.ini + fi #Show FPS if [ "$FPS" = "false" ] @@ -70,15 +89,55 @@ sed -i '/^BackendName =/c\BackendName =' /storage/.config/aethersx2/inis/PCSX2.i sed -i '/^OsdShowFPS =/c\OsdShowFPS = true' /storage/.config/aethersx2/inis/PCSX2.ini fi - #Vsync - if [ "$VSYNC" = "0" ] - then - sed -i '/^VsyncEnable =/c\VsyncEnable = 0' /storage/.config/aethersx2/inis/PCSX2.ini - fi - if [ "$VSYNC" = "1" ] - then - sed -i '/^VsyncEnable =/c\VsyncEnable = 1' /storage/.config/aethersx2/inis/PCSX2.ini - fi + #EE Cycle Rate + sed -i '/^EECycleRate =/c\EECycleRate = 0' /storage/.config/aethersx2/inis/PCSX2.ini + if [ "$RATE" = "0" ] + then + sed -i '/^EECycleRate =/c\EECycleRate = -3' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$RATE" = "1" ] + then + sed -i '/^EECycleRate =/c\EECycleRate = -2' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$RATE" = "2" ] + then + sed -i '/^EECycleRate =/c\EECycleRate = -1' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$RATE" = "3" ] + then + sed -i '/^EECycleRate =/c\EECycleRate = 0' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$RATE" = "4" ] + then + sed -i '/^EECycleRate =/c\EECycleRate = 1' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$RATE" = "5" ] + then + sed -i '/^EECycleRate =/c\EECycleRate = 2' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$RATE" = "6" ] + then + sed -i '/^EECycleRate =/c\EECycleRate = 3' /storage/.config/aethersx2/inis/PCSX2.ini + fi + + #EE Cycle Skip + sed -i '/^EECycleSkip =/c\EECycleSkip = 0' /storage/.config/aethersx2/inis/PCSX2.ini + if [ "$SKIP" = "0" ] + then + sed -i '/^EECycleSkip =/c\EECycleSkip = 0' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$SKIP" = "1" ] + then + sed -i '/^EECycleSkip =/c\EECycleSkip = 1' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$SKIP" = "2" ] + then + sed -i '/^EECycleSkip =/c\EECycleSkip = 2' /storage/.config/aethersx2/inis/PCSX2.ini + fi + if [ "$SKIP" = "3" ] + then + sed -i '/^EECycleSkip =/c\EECycleSkip = 3' /storage/.config/aethersx2/inis/PCSX2.ini + fi #Set OpenGL 3.3 on panfrost export PAN_MESA_DEBUG=gl3,gofaster @@ -88,5 +147,5 @@ sed -i '/^BackendName =/c\BackendName =' /storage/.config/aethersx2/inis/PCSX2.i #Run Aethersx2 emulator set_audio pulseaudio - /usr/bin/@APPIMAGE@ -fullscreen "${1}" + ${EMUPERF} /usr/bin/@APPIMAGE@ -fullscreen "${1}" set_audio alsa diff --git a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh index 6c596a807..b5e2bd753 100755 --- a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh +++ b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh @@ -24,6 +24,19 @@ fi rm -rf /storage/.config/dolphin-emu/StateSaves ln -sf /storage/roms/savestates/gamecube /storage/.config/dolphin-emu/StateSaves +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + #Emulation Station Features GAME=$(echo "${1}"| sed "s#^/.*/##") AA=$(get_setting anti_aliasing gamecube "${GAME}") @@ -32,6 +45,7 @@ ln -sf /storage/roms/savestates/gamecube /storage/.config/dolphin-emu/StateSaves IRES=$(get_setting internal_resolution gamecube "${GAME}") FPS=$(get_setting show_fps gamecube "${GAME}") CON=$(get_setting gamecube_controller_profile gamecube "${GAME}") + VSYNC=$(get_setting vsync gamecube "${GAME}") #Anti-Aliasing if [ "$AA" = "0" ] @@ -137,9 +151,19 @@ ln -sf /storage/roms/savestates/gamecube /storage/.config/dolphin-emu/StateSaves cp -r /storage/.config/dolphin-emu/Custom_GCPadNew.ini /storage/.config/dolphin-emu/GCPadNew.ini fi + #VSYNC + if [ "$VSYNC" = "0" ] + then + sed -i '/VSync =/c\VSync = False' /storage/.config/dolphin-emu/GFX.ini + fi + if [ "$VSYNC" = "1" ] + then + sed -i '/VSync =/c\VSync = True' /storage/.config/dolphin-emu/GFX.ini + fi + #Link .config/dolphin-emu to .local rm -rf /storage/.local/share/dolphin-emu ln -sf /storage/.config/dolphin-emu /storage/.local/share/dolphin-emu #Run Dolphin emulator -/usr/bin/dolphin-emu-nogui -p @DOLPHIN_PLATFORM@ -a HLE -e "${1}" +${EMUPERF} /usr/bin/dolphin-emu-nogui -p @DOLPHIN_PLATFORM@ -a HLE -e "${1}" diff --git a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh index 37770e745..038ee2776 100755 --- a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh +++ b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh @@ -24,6 +24,19 @@ if [ ! -d "/storage/roms/savestates/wii/" ]; then mkdir -p "/storage/roms/savestates/wii/" fi +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + rm -rf /storage/.config/dolphin-emu/StateSaves ln -sf /storage/roms/savestates/wii /storage/.config/dolphin-emu/StateSaves @@ -35,6 +48,7 @@ ln -sf /storage/roms/savestates/wii /storage/.config/dolphin-emu/StateSaves IRES=$(get_setting internal_resolution wii "${GAME}") FPS=$(get_setting show_fps wii "${GAME}") CON=$(get_setting wii_controller_profile wii "${GAME}") + VSYNC=$(get_setting vsync wii "${GAME}") #Anti-Aliasing if [ "$AA" = "0" ] @@ -148,9 +162,19 @@ ln -sf /storage/roms/savestates/wii /storage/.config/dolphin-emu/StateSaves cp -r /storage/.config/dolphin-emu/Custom_WiimoteNew.ini /storage/.config/dolphin-emu/WiimoteNew.ini fi + #VSYNC + if [ "$VSYNC" = "0" ] + then + sed -i '/VSync =/c\VSync = False' /storage/.config/dolphin-emu/GFX.ini + fi + if [ "$VSYNC" = "1" ] + then + sed -i '/VSync =/c\VSync = True' /storage/.config/dolphin-emu/GFX.ini + fi + #Link .config/dolphin-emu to .local rm -rf /storage/.local/share/dolphin-emu ln -sf /storage/.config/dolphin-emu /storage/.local/share/dolphin-emu #Run Dolphin emulator -/usr/bin/dolphin-emu-nogui -p @DOLPHIN_PLATFORM@ -a HLE -e "${1}" +${EMUPERF} /usr/bin/dolphin-emu-nogui -p @DOLPHIN_PLATFORM@ -a HLE -e "${1}" diff --git a/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh b/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh index b1a594d96..c3cacc4f3 100644 --- a/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh +++ b/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh @@ -24,6 +24,19 @@ ln -sf /storage/roms/savestates/nds /storage/.config/drastic/savestates rm -rf /storage/.config/drastic/backup ln -sf /storage/roms/nds /storage/.config/drastic/backup +# Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + cd /storage/.config/drastic/ export SDL_VIDEO_GL_DRIVER=./libs/libGL.so.1 @@ -32,4 +45,4 @@ export LIBGL_ES=2 export LIBGL_GL=21 export LIBGL_FB=2 -./drastic "$1" +${EMUPERF} ./drastic "$1" diff --git a/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh b/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh index 75767197f..f2dd8baf1 100644 --- a/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh +++ b/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh @@ -5,22 +5,37 @@ . /etc/profile +#Copy config folder to .config/duckstation if [ ! -d "/storage/.config/duckstation" ]; then mkdir -p "/storage/.config/duckstation" cp -r "/usr/config/duckstation" "/storage/.config/" fi +#Link savestates to roms/savestates if [ ! -d "/storage/roms/savestates/psx" ]; then mkdir -p "/storage/roms/savestates/psx" fi - if [ -d "/storage/.config/duckstation/savestates" ]; then rm -rf "/storage/.config/duckstation/savestates" fi - ln -sfv "/storage/roms/savestates/psx" "/storage/.config/duckstation/savestates" +#Copy gamecontroller db file from the device. cp -rf /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/duckstation/database/gamecontrollerdb.txt cp -rf /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/duckstation/resources/gamecontrollerdb.txt -duckstation-nogui -fullscreen -settings "/storage/.config/duckstation/settings.ini" -- "${1}" > /dev/null 2>&1 +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + +#Run Duckstation +${EMUPERF} duckstation-nogui -fullscreen -settings "/storage/.config/duckstation/settings.ini" -- "${1}" > /dev/null 2>&1 diff --git a/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh b/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh index 1b560fdff..35dcfe156 100644 --- a/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh +++ b/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh @@ -16,10 +16,23 @@ if [ ! -d "/storage/roms/bios/dc" ]; then mkdir -p "/storage/roms/bios/dc" fi +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + #Link .config/flycast to .local rm -rf "/storage/.local/share/flycast" ln -sf "/storage/.config/flycast" "/storage/.local/share/flycast" ln -sf "/storage/roms/bios/dc" "/storage/.local/share/flycast" #Run flycast emulator -/usr/bin/flycast "${1}" +${EMUPERF} /usr/bin/flycast "${1}" diff --git a/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh b/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh index 748669983..5d15f005c 100644 --- a/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh +++ b/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh @@ -42,6 +42,19 @@ mkdir -p $TMP cp $M64PCONF $TMP SET_PARAMS="--set Core[SharedDataPath]=$TMP --set Video-Rice[ResolutionWidth]=$SCREENWIDTH" +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + #Aspect Ratio if [ "${ASPECT}" = "fullscreen" ]; then # TODO: Set aspect ratio to fullscreen @@ -97,15 +110,15 @@ echo ${SET_PARAMS} case $1 in "m64p_gliden64") - /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-GLideN64 $SET_PARAMS "$2" + ${EMUPERF} /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-GLideN64 $SET_PARAMS "$2" ;; "m64p_gl64mk2") - /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-glide64mk2 $SET_PARAMS "$2" + ${EMUPERF} /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-glide64mk2 $SET_PARAMS "$2" ;; "m64p_rice") - /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-rice $SET_PARAMS "$2" + ${EMUPERF} /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-rice $SET_PARAMS "$2" ;; *) - /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-rice $SET_PARAMS "$2" + ${EMUPERF} /usr/local/bin/mupen64plus --configdir $TMP --gfx mupen64plus-video-rice $SET_PARAMS "$2" ;; esac diff --git a/packages/emulators/standalone/ppsspp-sa/package.mk b/packages/emulators/standalone/ppsspp-sa/package.mk index a32395f33..222c589f6 100644 --- a/packages/emulators/standalone/ppsspp-sa/package.mk +++ b/packages/emulators/standalone/ppsspp-sa/package.mk @@ -90,7 +90,7 @@ pre_make_target() { makeinstall_target() { mkdir -p ${INSTALL}/usr/bin - cp ${PKG_DIR}/sources/start_ppsspp.sh ${INSTALL}/usr/bin + cp ${PKG_DIR}/scripts/start_ppsspp.sh ${INSTALL}/usr/bin cp PPSSPPSDL ${INSTALL}/usr/bin/ppsspp chmod 0755 ${INSTALL}/usr/bin/* ln -sf /storage/.config/ppsspp/assets ${INSTALL}/usr/bin/assets diff --git a/packages/emulators/standalone/ppsspp-sa/scripts/start_ppsspp.sh b/packages/emulators/standalone/ppsspp-sa/scripts/start_ppsspp.sh new file mode 100755 index 000000000..f5853a2b8 --- /dev/null +++ b/packages/emulators/standalone/ppsspp-sa/scripts/start_ppsspp.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2021-present - Fewtarius + +. /etc/profile + +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + +ARG=${1//[\\]/} +export SDL_AUDIODRIVER=alsa +${EMUPERF} ppsspp "${ARG}" diff --git a/packages/emulators/standalone/ppsspp-sa/sources/start_ppsspp.sh b/packages/emulators/standalone/ppsspp-sa/sources/start_ppsspp.sh deleted file mode 100755 index c1842499e..000000000 --- a/packages/emulators/standalone/ppsspp-sa/sources/start_ppsspp.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2021-present - Fewtarius - -. /etc/profile - -ARG=${1//[\\]/} -export SDL_AUDIODRIVER=alsa -ppsspp "${ARG}" diff --git a/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh b/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh index eba7d81f1..bae330760 100644 --- a/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh +++ b/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh @@ -70,5 +70,18 @@ then cp -f ${SOURCE_DIR}/.config "${CONFIG_DIR}/${GAME}.config" fi +#Set the cores to use +CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") +if [ "${CORES}" = "little" ] +then + EMUPERF="${SLOW_CORES}" +elif [ "${CORES}" = "big" ] +then + EMUPERF="${FAST_CORES}" +else + ### All.. + unset EMUPERF +fi + echo "Command: yabasanshiro -r 2 -i "${1}" ${BIOS}" >/var/log/exec.log 2>&1 -yabasanshiro -r 2 -i "${1}" ${BIOS} >>/var/log/exec.log 2>&1 ||: +${EMUPERF} yabasanshiro -r 2 -i "${1}" ${BIOS} >>/var/log/exec.log 2>&1 ||: diff --git a/packages/ui/emulationstation/config/common/es_features.cfg b/packages/ui/emulationstation/config/common/es_features.cfg index be9404374..54fa65eea 100644 --- a/packages/ui/emulationstation/config/common/es_features.cfg +++ b/packages/ui/emulationstation/config/common/es_features.cfg @@ -80,6 +80,10 @@ + + + + @@ -119,6 +123,10 @@ + + + + @@ -178,6 +186,10 @@ + + + + @@ -298,19 +310,31 @@ + + + + + + + + + + + + + + + - - - + + + + - - - -