diff --git a/packages/emulators/standalone/duckstation-sa/package.mk b/packages/emulators/standalone/duckstation-sa/package.mk index 6fbc681a2..6e0067726 100644 --- a/packages/emulators/standalone/duckstation-sa/package.mk +++ b/packages/emulators/standalone/duckstation-sa/package.mk @@ -70,9 +70,23 @@ makeinstall_target() { mkdir -p ${INSTALL}/usr/config/duckstation cp -rf ${PKG_BUILD}/.${TARGET_NAME}/bin/* ${INSTALL}/usr/config/duckstation cp -rf ${PKG_DIR}/config/${DEVICE}/* ${INSTALL}/usr/config/duckstation + cp -rf ${PKG_BUILD}/data/* ${INSTALL}/usr/config/duckstation rm -rf ${INSTALL}/usr/config/duckstation/duckstation-nogui rm -rf ${INSTALL}/usr/config/duckstation/common-tests chmod +x ${INSTALL}/usr/bin/start_duckstation.sh } + +post_install() { + case ${DEVICE} in + RK356*) + RESOURCE_FOLDER="database" + ;; + *) + RESOURCE_FOLDER="resources" + ;; + esac + sed -e "s/@RESOURCE_FOLDER@/${RESOURCE_FOLDER}/g" \ + -i ${INSTALL}/usr/bin/start_duckstation.sh +} diff --git a/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh b/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh index 855335e0e..ad1c7bd12 100644 --- a/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh +++ b/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh @@ -22,8 +22,7 @@ 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 +cp -rf /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/duckstation/@RESOURCE_FOLDER@/gamecontrollerdb.txt #Set the cores to use CORES=$(get_setting "cores" "${PLATFORM}" "${ROMNAME##*/}") @@ -40,7 +39,53 @@ fi #Emulation Station Features GAME=$(echo "${1}"| sed "s#^/.*/##") + ASPECT=$(get_setting aspect_ratio psx "${GAME}") + FPS=$(get_setting show_fps psx "${GAME}") + IRES=$(get_setting internal_resolution psx "${GAME}") RENDERER=$(get_setting graphics_backend psx "${GAME}") + VSYNC=$(get_setting vsync psx "${GAME}") + + #Aspect Ratio + if [ "$ASPECT" = "0" ] + then + sed -i '/^AspectRatio/c\AspectRatio = 4:3' /storage/.config/duckstation/settings.ini + fi + if [ "$ASPECT" = "1" ] + then + sed -i '/^AspectRatio/c\AspectRatio = 16:9' /storage/.config/duckstation/settings.ini + fi + + #Show FPS + if [ "$FPS" = "false" ] + then + sed -i '/^ShowFPS/c\ShowFPS = false' /storage/.config/duckstation/settings.ini + fi + if [ "$FPS" = "true" ] + then + sed -i '/^ShowFPS/c\ShowFPS = true' /storage/.config/duckstation/settings.ini + fi + + #Internal Resolution + if [ "$IRES" = "1" ] + then + sed -i '/^ResolutionScale =/c\ResolutionScale = 1' /storage/.config/duckstation/settings.ini + fi + if [ "$IRES" = "2" ] + then + sed -i '/^ResolutionScale =/c\ResolutionScale = 2' /storage/.config/duckstation/settings.ini + fi + if [ "$IRES" = "3" ] + then + sed -i '/^ResolutionScale =/c\ResolutionScale = 3' /storage/.config/duckstation/settings.ini + fi + if [ "$IRES" = "4" ] + then + sed -i '/^ResolutionScale =/c\ResolutionScale = 4' /storage/.config/duckstation/settings.ini + fi + if [ "$IRES" = "5" ] + then + sed -i '/^ResolutionScale =/c\ResolutionScale = 5' /storage/.config/duckstation/settings.ini + fi #Video Backend if [ "$RENDERER" = "opengl" ] @@ -56,5 +101,16 @@ fi sed -i '/^Renderer =/c\Renderer = Software' /storage/.config/duckstation/settings.ini fi + #VSYNC + if [ "$VSYNC" = "off" ] + then + sed -i '/^VSync =/c\VSync = false' /storage/.config/duckstation/settings.ini + fi + if [ "$VSYNC" = "on" ] + then + sed -i '/^VSync =/c\VSync = true' /storage/.config/duckstation/settings.ini + fi + + #Run Duckstation ${EMUPERF} duckstation-nogui -fullscreen -settings "/storage/.config/duckstation/settings.ini" -- "${1}" > /dev/null 2>&1 diff --git a/packages/ui/emulationstation/config/common/es_features.cfg b/packages/ui/emulationstation/config/common/es_features.cfg index afac062f9..02a9f8b2f 100644 --- a/packages/ui/emulationstation/config/common/es_features.cfg +++ b/packages/ui/emulationstation/config/common/es_features.cfg @@ -123,11 +123,30 @@ + + + + + + + + + + + + + + + + + + +