Overhaul Yuzu Switch Emu

This commit is contained in:
mason 2023-02-14 20:48:28 +00:00
parent 7dab212140
commit d231baa425
No known key found for this signature in database
GPG key ID: 84D9278A11FA112B
5 changed files with 1353 additions and 87 deletions

File diff suppressed because it is too large Load diff

View file

@ -2,12 +2,12 @@
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)
PKG_NAME="yuzusa"
PKG_VERSION="c5743d5499db336718b93a6954ec1168c660fbec"
PKG_VERSION="5f5a6e4b2e541e86c0bfdb99e3acfbbebe89a5d3"
PKG_ARCH="x86_64"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/yuzu-emu/yuzu"
PKG_URL="$PKG_SITE.git"
PKG_DEPENDS_TARGET="toolchain libfmt boost ffmpeg zstd zlib libzip lz4 opus libusb nlohmann-json"
PKG_DEPENDS_TARGET="toolchain libfmt boost ffmpeg zstd zlib libzip lz4 opus libusb nlohmann-json qt5"
PKG_SHORTDESC="Nintendo Switch emulator"
PKG_TOOLCHAIN="cmake"
GET_HANDLER_SUPPORT="git"
@ -30,7 +30,7 @@ then
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
fi
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_QT=OFF \
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_QT=ON \
-DCMAKE_BUILD_TYPE=Release \
-DYUZU_USE_BUNDLED_SDL2=OFF \
-DYUZU_USE_BUNDLED_QT=OFF \

181
packages/games/emulators/yuzusa/scripts/start_yuzu.sh Normal file → Executable file
View file

@ -11,24 +11,24 @@ if [ ! -d "/storage/.config/yuzu" ]; then
cp -r "/usr/config/yuzu" "/storage/.config/"
fi
#Check if sdl2-config.ini exists in .config/yuzu
if [ ! -f "/storage/.config/yuzu/sdl2-config.ini" ]; then
cp -r "/usr/config/yuzu/sdl2-config.ini" "/storage/.config/yuzu/sdl2-config.ini"
#Check if qt-config.ini exists in .config/yuzu
if [ ! -f "/storage/.config/yuzu/qt-config.ini" ]; then
cp -r "/usr/config/yuzu/qt-config.ini" "/storage/.config/yuzu/qt-config.ini"
fi
#Move Nand / Saves to switch roms folder
if [ ! -d "/storage/roms/switch/yuzu/nand" ]; then
mkdir -p "/storage/roms/switch/yuzu/nand"
if [ ! -d "/storage/roms/bios/yuzu/nand" ]; then
mkdir -p "/storage/roms/bios/yuzu/nand"
fi
rm -rf /storage/.config/yuzu/nand
ln -sf /storage/roms/switch/yuzu/nand /storage/.config/yuzu/nand
ln -sf /storage/roms/bios/yuzu/nand /storage/.config/yuzu/nand
#Link yuzu keys to bios folder
if [ ! -d "/storage/roms/bios/yuzu" ]; then
mkdir -p "/storage/.config/yuzu"
if [ ! -d "/storage/roms/bios/yuzu/keys" ]; then
mkdir -p "/storage/roms/bios/yuzu/keys"
fi
rm -rf /storage/.config/yuzu/keys
ln -sf /storage/roms/bios/yuzu /storage/.config/yuzu/keys
ln -sf /storage/roms/bios/yuzu/keys /storage/.config/yuzu/keys
#Emulation Station Features
GAME=$(echo "${1}"| sed "s#^/.*/##")
@ -39,162 +39,177 @@ ln -sf /storage/roms/bios/yuzu /storage/.config/yuzu/keys
GRENDERER=$(get_setting graphics_backend switch "${GAME}")
IRES=$(get_setting internal_resolution switch "${GAME}")
PFILTER=$(get_setting pixel_filter switch "${GAME}")
RUMBLE=$(get_setting rumble switch "${GAME}")
SDOCK=$(get_setting switch_mode switch "${GAME}")
SUI=$(get_setting start_ui switch "${GAME}")
VSYNC=$(get_setting vsync switch "${GAME}")
#Anisotropic Filtering
sed -i '/^max_anisotropy\\default=/c\max_anisotropy\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$AF" = "0" ]
then
sed -i '/max_anisotropy =/c\max_anisotropy = 0' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^max_anisotropy=/c\max_anisotropy=0' /storage/.config/yuzu/qt-config.ini
fi
if [ "$AF" = "1" ]
then
sed -i '/max_anisotropy =/c\max_anisotropy = 1' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^max_anisotropy=/c\max_anisotropy=1' /storage/.config/yuzu/qt-config.ini
fi
if [ "$AF" = "2" ]
if [ "$AF" = "2" ]
then
sed -i '/max_anisotropy =/c\max_anisotropy = 2' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^max_anisotropy=/c\max_anisotropy=2' /storage/.config/yuzu/qt-config.ini
fi
if [ "$AF" = "3" ]
if [ "$AF" = "3" ]
then
sed -i '/max_anisotropy =/c\max_anisotropy = 3' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^max_anisotropy=/c\max_anisotropy=3' /storage/.config/yuzu/qt-config.ini
fi
if [ "$AF" = "4" ]
if [ "$AF" = "4" ]
then
sed -i '/max_anisotropy =/c\max_anisotropy = 4' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^max_anisotropy=/c\max_anisotropy=4' /storage/.config/yuzu/qt-config.ini
fi
#Anti-Aliasing
sed -i '/^anti_aliasing\\default=/c\anti_aliasing\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$AA" = "0" ]
then
sed -i '/anti_aliasing =/c\anti_aliasing = 0' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^anti_aliasing=/c\anti_aliasing=0' /storage/.config/yuzu/qt-config.ini
fi
if [ "$AA" = "1" ]
then
sed -i '/anti_aliasing =/c\anti_aliasing = 1' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^anti_aliasing=/c\anti_aliasing=1' /storage/.config/yuzu/qt-config.ini
fi
#Aspect Ratio
sed -i '/^aspect_ratio\\default=/c\aspect_ratio\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$ASPECT" = "0" ]
then
sed -i '/aspect_ratio =/c\aspect_ratio = 0' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^aspect_ratio=/c\aspect_ratio=0' /storage/.config/yuzu/qt-config.ini
fi
if [ "$ASPECT" = "1" ]
then
sed -i '/aspect_ratio =/c\aspect_ratio = 1' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^aspect_ratio=/c\aspect_ratio=1' /storage/.config/yuzu/qt-config.ini
fi
if [ "$ASPECT" = "2" ]
then
sed -i '/aspect_ratio =/c\aspect_ratio = 2' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^aspect_ratio=/c\aspect_ratio=2' /storage/.config/yuzu/qt-config.ini
fi
if [ "$ASPECT" = "3" ]
then
sed -i '/aspect_ratio =/c\aspect_ratio = 3' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^aspect_ratio=/c\aspect_ratio=3' /storage/.config/yuzu/qt-config.ini
fi
#GPU Accuracy
if [ "$GACCURACY" = "0" ]
then
sed -i '/gpu_accuracy =/c\gpu_accuracy = 0' /storage/.config/yuzu/sdl2-config.ini
fi
if [ "$GACCURACY" = "1" ]
then
sed -i '/gpu_accuracy =/c\gpu_accuracy = 1' /storage/.config/yuzu/sdl2-config.ini
fi
if [ "$GACCURACY" = "2" ]
then
sed -i '/gpu_accuracy =/c\gpu_accuracy = 2' /storage/.config/yuzu/sdl2-config.ini
fi
#Graphics Backend
if [ "$GRENDERER" = "0" ]
sed -i '/^gpu_accuracy\\default=/c\gpu_accuracy\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$GACCURACY" = "0" ]
then
sed -i '/backend =/c\backend = 0' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^gpu_accuracy=/c\gpu_accuracy=0' /storage/.config/yuzu/qt-config.ini
fi
if [ "$GACCURACY" = "1" ]
then
sed -i '/^gpu_accuracy=/c\gpu_accuracy=1' /storage/.config/yuzu/qt-config.ini
fi
if [ "$GACCURACY" = "2" ]
then
sed -i '/^gpu_accuracy=/c\gpu_accuracy=2' /storage/.config/yuzu/qt-config.ini
fi
#Graphics Backend
sed -i '/^backend\\default=/c\backend\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$GRENDERER" = "0" ]
then
sed -i '/^backend=/c\backend=0' /storage/.config/yuzu/qt-config.ini
fi
if [ "$GRENDERER" = "1" ]
then
sed -i '/backend =/c\backend = 1' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^backend=/c\backend=1' /storage/.config/yuzu/qt-config.ini
fi
#Internal Resolution
sed -i '/^resolution_setup\\default=/c\resolution_setup\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$IRES" = "0" ]
then
sed -i '/resolution_setup =/c\resolution_setup = 0' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^resolution_setup=/c\resolution_setup=0' /storage/.config/yuzu/qt-config.ini
fi
if [ "$IRES" = "1" ]
then
sed -i '/resolution_setup =/c\resolution_setup = 1' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^resolution_setup=/c\resolution_setup=1' /storage/.config/yuzu/qt-config.ini
fi
if [ "$IRES" = "2" ]
then
sed -i '/resolution_setup =/c\resolution_setup = 2' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^resolution_setup=/c\resolution_setup=2' /storage/.config/yuzu/qt-config.ini
fi
#Pixel Filter
sed -i '/^scaling_filter\\default=/c\scaling_filter\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$PFILTER" = "0" ]
then
sed -i '/scaling_filter =/c\scaling_filter = 0' /storage/.config/yuzu/sdl2-config.ini
then
sed -i '/^scaling_filter=/c\scaling_filter=0' /storage/.config/yuzu/qt-config.ini
fi
if [ "$PFILTER" = "1" ]
then
sed -i '/scaling_filter =/c\scaling_filter = 1' /storage/.config/yuzu/sdl2-config.ini
fi
sed -i '/^scaling_filter=/c\scaling_filter=1' /storage/.config/yuzu/qt-config.ini
fi
if [ "$PFILTER" = "2" ]
then
sed -i '/scaling_filter =/c\scaling_filter = 2' /storage/.config/yuzu/sdl2-config.ini
fi
if [ "$PFILTER" = "3" ]
then
sed -i '/scaling_filter =/c\scaling_filter = 3' /storage/.config/yuzu/sdl2-config.ini
fi
if [ "$PFILTER" = "4" ]
then
sed -i '/scaling_filter =/c\scaling_filter = 4' /storage/.config/yuzu/sdl2-config.ini
fi
if [ "$PFILTER" = "5" ]
then
sed -i '/scaling_filter =/c\scaling_filter = 5' /storage/.config/yuzu/sdl2-config.ini
fi
#Switch Mode
if [ "$SDOCK" = "0" ]
then
sed -i '/use_docked_mode =/c\use_docked_mode = 0' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^scaling_filter=/c\scaling_filter=2' /storage/.config/yuzu/qt-config.ini
fi
if [ "$PFILTER" = "3" ]
then
sed -i '/^scaling_filter=/c\scaling_filter=3' /storage/.config/yuzu/qt-config.ini
fi
if [ "$PFILTER" = "4" ]
then
sed -i '/^scaling_filter =/c\scaling_filter=4' /storage/.config/yuzu/qt-config.ini
fi
if [ "$PFILTER" = "5" ]
then
sed -i '/^scaling_filter =/c\scaling_filter=5' /storage/.config/yuzu/qt-config.ini
fi
#RUMBLE
sed -i '/^vibration_enabled\\default=/c\vibration_enabled\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$RUMBLE" = "0" ]
then
sed -i '/^vibration_enabled=/c\vibration_enabled=false' /storage/.config/yuzu/qt-config.ini
fi
if [ "$RUMBLE" = "1" ]
then
sed -i '/^vibration_enabled=/c\vibration_enabled=true' /storage/.config/yuzu/qt-config.ini
fi
#Switch Mode
sed -i '/^use_docked_mode\\default=/c\use_docked_mode\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$SDOCK" = "0" ]
then
sed -i '/^use_docked_mode=/c\use_docked_mode=false' /storage/.config/yuzu/qt-config.ini
fi
if [ "$SDOCK" = "1" ]
then
sed -i '/use_docked_mode =/c\use_docked_mode = 1' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^use_docked_mode=/c\use_docked_mode=true' /storage/.config/yuzu/qt-config.ini
fi
#Vysnc
sed -i '/^use_vsync\\default=/c\use_vsync\\default=false' /storage/.config/yuzu/qt-config.ini
if [ "$VSYNC" = "0" ]
then
sed -i '/use_vsync =/c\use_vsync = 0' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^use_vsync=/c\use_vsync=false' /storage/.config/yuzu/qt-config.ini
fi
if [ "$VSYNC" = "1" ]
then
sed -i '/use_vsync =/c\use_vsync = 1' /storage/.config/yuzu/sdl2-config.ini
sed -i '/^use_vsync=/c\use_vsync=true' /storage/.config/yuzu/qt-config.ini
fi
#Link .config/yuzu to .local
rm -rf /storage/.local/share/yuzu
ln -sf /storage/.config/yuzu /storage/.local/share/yuzu
#Set QT Platform to Wayland-EGL
export QT_QPA_PLATFORM=wayland-egl
#Run Yuzu emulator
/usr/bin/yuzu-cmd "${1}"
if [ "$SUI" = "1" ]
then
/usr/bin/yuzu
else
/usr/bin/yuzu -f -g "${1}"
fi

View file

@ -325,7 +325,7 @@ then
fi
;;
"switch")
jslisten set "-9 yuzu-cmd"
jslisten set "-9 yuzu"
if [ "$EMU" = "yuzu" ]; then
RUNTHIS='${TBASH} /usr/bin/start_yuzu.sh "${ROMNAME}"'
fi

View file

@ -209,6 +209,10 @@
<choice name="scaleforce" value="4"/>
<choice name="amd fidelityfx" value="5"/>
</feature>
<feature name="rumble">
<choice name="off" value="0"/>
<choice name="on" value="1"/>
</feature>
<feature name="switch mode">
<choice name="handheld" value="0"/>
<choice name="docked" value="1"/>
@ -217,6 +221,10 @@
<choice name="off" value="0"/>
<choice name="on" value="1"/>
</feature>
<feature name="start ui">
<choice name="off" value="0"/>
<choice name="on" value="1"/>
</feature>
</features>
</emulator>
<emulator name="citrasa">