diff --git a/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/package.mk b/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/package.mk index 23331e9c1f..49f03d40f3 100644 --- a/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/package.mk +++ b/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/package.mk @@ -10,7 +10,7 @@ PKG_TOOLCHAIN="cmake" case ${DEVICE} in SM8250|SM8550|SDM845|AMD64|RK3399) - PKG_VERSION="10cedc90af0068d2a78a454914c4d7ca4c1cdbdf" + PKG_VERSION="033a0540f7d76feb7d9eef6be99977da3142e415" PKG_SITE="https://github.com/dolphin-emu/dolphin" PKG_URL="${PKG_SITE}.git" PKG_DEPENDS_TARGET+=" qt6" @@ -25,6 +25,7 @@ case ${DEVICE} in PKG_URL="${PKG_SITE}.git" PKG_PATCH_DIRS+=" wayland" PKG_CMAKE_OPTS_TARGET+=" -DENABLE_QT=OFF \ + -DENABLE_WAYLAND=ON \ -DUSE_RETRO_ACHIEVEMENTS=OFF \ -DENABLE_HEADLESS=ON" ;; @@ -40,8 +41,7 @@ fi if [ "${DISPLAYSERVER}" = "wl" ]; then PKG_DEPENDS_TARGET+=" wayland ${WINDOWMANAGER} xwayland xrandr libXi" - PKG_CMAKE_OPTS_TARGET+=" -DENABLE_WAYLAND=ON \ - -DENABLE_X11=ON" + PKG_CMAKE_OPTS_TARGET+=" -DENABLE_X11=ON" else PKG_CMAKE_OPTS_TARGET+=" -DENABLE_X11=OFF" fi @@ -50,12 +50,15 @@ if [ "${VULKAN_SUPPORT}" = "yes" ] then PKG_DEPENDS_TARGET+=" ${VULKAN}" PKG_CMAKE_OPTS_TARGET+=" -DENABLE_VULKAN=ON" + GRENDERER="Vulkan" else PKG_CMAKE_OPTS_TARGET+=" -DENABLE_VULKAN=OFF" + GRENDERER="OGL" fi pre_configure_target() { PKG_CMAKE_OPTS_TARGET+=" -DCMAKE_BUILD_TYPE=Release \ + -Ddatadir="/storage/.config/dolphin-emu" \ -DENABLE_NOGUI=ON \ -DENABLE_EVDEV=ON \ -DUSE_DISCORD_PRESENCE=OFF \ @@ -106,6 +109,9 @@ post_install() { sed -e "s/@DOLPHIN_PLATFORM@/${DOLPHIN_PLATFORM}/g" -i ${INSTALL}/usr/bin/start_dolphin_gc.sh sed -e "s/@DOLPHIN_PLATFORM@/${DOLPHIN_PLATFORM}/g" -i ${INSTALL}/usr/bin/start_dolphin_wii.sh + sed -e "s/@GRENDERER@/${GRENDERER}/g" -i ${INSTALL}/usr/bin/start_dolphin_gc.sh + sed -e "s/@GRENDERER@/${GRENDERER}/g" -i ${INSTALL}/usr/bin/start_dolphin_wii.sh + sed -e "s/@EXPORTS@/${EXPORTS}/g" \ -i ${INSTALL}/usr/bin/start_dolphin_gc.sh sed -e "s/@EXPORTS@/${EXPORTS}/g" \ diff --git a/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh b/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh index f8ac2e2ef8..ad0ecf9af5 100644 --- a/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh +++ b/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh @@ -20,32 +20,37 @@ control-gen_init.sh source /storage/.config/gptokeyb/control.ini get_controls +# Conf files vars +CONF_DIR="/storage/.config/dolphin-emu" +DOLPHIN_INI="Dolphin.ini" +GFX_INI="GFX.ini" +CONTROLLER_INI="GCPadNew.ini" + # Check if dolphin-emu exists in .config -if [ ! -d "/storage/.config/dolphin-emu" ]; then - mkdir -p "/storage/.config/dolphin-emu" +if [ ! -d "${CONF_DIR}" ]; then cp -r "/usr/config/dolphin-emu" "/storage/.config/" fi # Check if Hotkeys.ini exists if [ "${DOLPHIN_CORE}" = 'dolphin-emu' ]; then - if [ ! -f "/storage/.config/dolphin-emu/Hotkeys.ini" ]; then - cp -r "/usr/config/dolphin-emu/Hotkeys.ini" "/storage/.config/dolphin-emu/" + if [ ! -f "${CONF_DIR}/Hotkeys.ini" ]; then + cp -r "/usr/config/dolphin-emu/Hotkeys.ini" "${CONF_DIR}/" fi fi # Check if GC controller dir exists in .config/dolphin-emu/GamecubeControllerProfiles -if [ ! -d "/storage/.config/dolphin-emu/GamecubeControllerProfiles" ]; then - cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles" "/storage/.config/dolphin-emu/" +if [ ! -d "${CONF_DIR}/GamecubeControllerProfiles" ]; then + cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles" "${CONF_DIR}/" fi # Check if GC custom east profile exists in .config/dolphin-emu/GamecubeControllerProfiles -if [ ! -f "/storage/.config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.east" ]; then - cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.east" "/storage/.config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.east" +if [ ! -f "${CONF_DIR}/GamecubeControllerProfiles/GCPadNew.ini.east" ]; then + cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.east" "${CONF_DIR}/GamecubeControllerProfiles/GCPadNew.ini.east" fi # Check if GC custom controller profile exists in .config/dolphin-emu/GamecubeControllerProfiles -if [ ! -f "/storage/.config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.custom" ]; then - cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.south" "/storage/.config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.custom" +if [ ! -f "${CONF_DIR}/GamecubeControllerProfiles/GCPadNew.ini.custom" ]; then + cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.south" "${CONF_DIR}/GamecubeControllerProfiles/GCPadNew.ini.custom" fi # Link Save States to /roms/savestates/gamecube @@ -53,27 +58,27 @@ if [ ! -d "/storage/roms/savestates/gamecube/" ]; then mkdir -p "/storage/roms/savestates/gamecube/" fi -rm -rf /storage/.config/dolphin-emu/StateSaves -ln -sf /storage/roms/savestates/gamecube /storage/.config/dolphin-emu/StateSaves +rm -rf ${CONF_DIR}/StateSaves +ln -sf /storage/roms/savestates/gamecube ${CONF_DIR}/StateSaves # Copy bios, memory cards and other system stuff to roms if [ ! -d "/storage/roms/bios/GC/" ]; then mkdir -p /storage/roms/bios/GC/{USA,JAP,EUR} - cp -r /storage/.config/dolphin-emu/GC /storage/roms/bios/ + cp -r ${CONF_DIR}/GC /storage/roms/bios/ fi # Link bios and memory cards to roms for REGION in EUR JAP USA do # Link bios - rm -rf "/storage/.config/dolphin-emu/GC/${REGION}" - ln -sf "/storage/roms/bios/GC/${REGION}" "/storage/.config/dolphin-emu/GC/${REGION}" + rm -rf "${CONF_DIR}/GC/${REGION}" + ln -sf "/storage/roms/bios/GC/${REGION}" "${CONF_DIR}/GC/${REGION}" # Link memory cards, copying to roms/bios first as needed for SLOT in A B do MEM_CARD_FILE="MemoryCard${SLOT}.${REGION}.raw" - CONFIG_MEM_CARD="/storage/.config/dolphin-emu/GC/${MEM_CARD_FILE}" + CONFIG_MEM_CARD="${CONF_DIR}/GC/${MEM_CARD_FILE}" ROMS_BIOS_MEM_CARD="/storage/roms/bios/GC/${MEM_CARD_FILE}" if [ -f "${ROMS_BIOS_MEM_CARD}" ]; then @@ -97,7 +102,7 @@ AUDIOBE=$(get_setting audio_backend "${PLATFORM}" "${GAME}") ASWAPDISCS=$(get_setting auto_swap_discs "${PLATFORM}" "${GAME}") CLOCK=$(get_setting clock_speed "${PLATFORM}" "${GAME}") ENBCHEATS=$(get_setting enable_cheats "${PLATFORM}" "${GAME}") -RENDERER=$(get_setting graphics_backend "${PLATFORM}" "${GAME}") +GRENDERER=$(get_setting graphics_backend "${PLATFORM}" "${GAME}") IRES=$(get_setting internal_resolution "${PLATFORM}" "${GAME}") FPS=$(get_setting show_fps "${PLATFORM}" "${GAME}") CON=$(get_setting gamecube_controller_profile "${PLATFORM}" "${GAME}") @@ -118,11 +123,10 @@ WPC=$(get_setting write_protect_configs "${PLATFORM}" "${GAME}") # Grab clean config files during boot, unless disabled in emulationstation if [ "$WPC" != "false" ]; then - cp -r /usr/config/dolphin-emu/GFX.ini /storage/.config/dolphin-emu/GFX.ini - cp -r /usr/config/dolphin-emu/Dolphin.ini /storage/.config/dolphin-emu/Dolphin.ini + cp -r /usr/config/dolphin-emu/GFX.ini ${CONF_DIR}/${GFX_INI} + cp -r /usr/config/dolphin-emu/Dolphin.ini ${CONF_DIR}/${DOLPHIN_INI} fi - # Set the cores to use CORES=$(get_setting "cores" "${PLATFORM}" "${GAME}") if [ "${CORES}" = "little" ] @@ -139,37 +143,37 @@ fi ### Emulation Station features: # Anti-Aliasing if [ "$AA" = "2m" ]; then - sed -i '/MSAA/c\MSAA = 2' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 2' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "2s" ]; then - sed -i '/MSAA/c\MSAA = 2' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 2' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = True' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "4m" ]; then - sed -i '/MSAA/c\MSAA = 4' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 4' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "4s" ]; then - sed -i '/MSAA/c\MSAA = 4' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 4' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = True' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "8m" ]; then - sed -i '/MSAA/c\MSAA = 8' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 8' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "8s" ]; then - sed -i '/MSAA/c\MSAA = 8' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 8' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = True' ${CONF_DIR}/${GFX_INI} else - sed -i '/MSAA/c\MSAA = 0' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 0' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} fi # Aspect Ratio if [ "$ASPECT" = "1" ]; then - sed -i '/AspectRatio/c\AspectRatio = 1' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 1' ${CONF_DIR}/${GFX_INI} elif [ "$ASPECT" = "2" ]; then - sed -i '/AspectRatio/c\AspectRatio = 2' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 2' ${CONF_DIR}/${GFX_INI} elif [ "$ASPECT" = "3" ]; then - sed -i '/AspectRatio/c\AspectRatio = 3' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 3' ${CONF_DIR}/${GFX_INI} else - sed -i '/AspectRatio/c\AspectRatio = 0' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 0' ${CONF_DIR}/${GFX_INI} fi # Audio Backend @@ -181,198 +185,230 @@ fi # Auto Swap Discs if [ "$ASWAPDISCS" = "0" ]; then - sed -i '/AutoDiscChange/c\AutoDiscChange = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/AutoDiscChange/c\AutoDiscChange = False' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/AutoDiscChange/c\AutoDiscChange = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/AutoDiscChange/c\AutoDiscChange = True' ${CONF_DIR}/${DOLPHIN_INI} fi # Clock Speed if [ "$CLOCK" = "050" ]; then - sed -i '/^Overclock =/c\Overclock = 0.5' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 0.5' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "075" ]; then - sed -i '/^Overclock =/c\Overclock = 0.75' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 0.75' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "100" ]; then - sed -i '/^Overclock =/c\Overclock = 1.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 1.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = False' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "125" ]; then - sed -i '/^Overclock =/c\Overclock = 1.25' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 1.25' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "150" ]; then - sed -i '/^Overclock =/c\Overclock = 1.5' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 1.5' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "200" ]; then - sed -i '/^Overclock =/c\Overclock = 2.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 2.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "300" ]; then - sed -i '/^Overclock =/c\Overclock = 3.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 3.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "400" ]; then - sed -i '/^Overclock =/c\Overclock = 4.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 4.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/^OverclockEnable =/c\OverclockEnable = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^OverclockEnable =/c\OverclockEnable = False' ${CONF_DIR}/${DOLPHIN_INI} fi # Enable Cheats if [ "$ENBCHEATS" = "1" ]; then - sed -i '/EnableCheats/c\EnableCheats = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/EnableCheats/c\EnableCheats = True' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/EnableCheats/c\EnableCheats = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/EnableCheats/c\EnableCheats = False' ${CONF_DIR}/${DOLPHIN_INI} fi # Graphics Backend - if [ "$RENDERER" = "vulkan" ]; then - sed -i '/GFXBackend/c\GFXBackend = Vulkan' /storage/.config/dolphin-emu/Dolphin.ini + if [ "$GRENDERER" = "vulkan" ]; then + sed -i '/GFXBackend/c\GFXBackend = Vulkan' ${CONF_DIR}/${DOLPHIN_INI} + elif [ "$GRENDERER" = "opengl" ]; then + sed -i '/GFXBackend/c\GFXBackend = OGL' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/GFXBackend/c\GFXBackend = OGL' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/GFXBackend/c\GFXBackend = @GRENDERER@' ${CONF_DIR}/${DOLPHIN_INI} fi # Internal Resolution if [ "$IRES" = "1" ]; then - sed -i '/InternalResolution/c\InternalResolution = 1' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 1' ${CONF_DIR}/${GFX_INI} elif [ "$IRES" = "3" ]; then - sed -i '/InternalResolution/c\InternalResolution = 3' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 3' ${CONF_DIR}/${GFX_INI} elif [ "$IRES" = "4" ]; then - sed -i '/InternalResolution/c\InternalResolution = 4' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 4' ${CONF_DIR}/${GFX_INI} elif [ "$IRES" = "6" ]; then - sed -i '/InternalResolution/c\InternalResolution = 6' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 6' ${CONF_DIR}/${GFX_INI} else - sed -i '/InternalResolution/c\InternalResolution = 2' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 2' ${CONF_DIR}/${GFX_INI} fi # Save Type if [ "$SAVETYPE" = "8" ]; then - sed -i '/SlotA/c\SlotA = 8' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/SlotA/c\SlotA = 8' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/SlotA/c\SlotA = 1' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/SlotA/c\SlotA = 1' ${CONF_DIR}/${DOLPHIN_INI} fi # Save Reg if [ "$SAVEREG" = "eur" ]; then - sed -i '/GCIFolderAPath/c\GCIFolderAPath = \/storage\/roms\/bios\/GC\/EUR' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/GCIFolderAPath/c\GCIFolderAPath = \/storage\/roms\/bios\/GC\/EUR' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$SAVEREG" = "jap" ]; then - sed -i '/GCIFolderAPath/c\GCIFolderAPath = \/storage\/roms\/bios\/GC\/JAP' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/GCIFolderAPath/c\GCIFolderAPath = \/storage\/roms\/bios\/GC\/JAP' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/GCIFolderAPath/c\GCIFolderAPath = \/storage\/roms\/bios\/GC\/USA' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/GCIFolderAPath/c\GCIFolderAPath = \/storage\/roms\/bios\/GC\/USA' ${CONF_DIR}/${DOLPHIN_INI} fi # Shader Mode if [ "$SHADERM" = "0" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 0' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 0' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERM" = "1" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 1' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 1' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERM" = "2" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 2' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 2' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERM" = "3" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 3' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 3' ${CONF_DIR}/${GFX_INI} fi #Shader Precompile if [ "$SHADERP" = "false" ]; then - sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = False' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERP" = "true" ]; then - sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = True' ${CONF_DIR}/${GFX_INI} fi # Show FPS if [ "$FPS" = "true" ]; then - sed -i '/ShowFPS/c\ShowFPS = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShowFPS/c\ShowFPS = True' ${CONF_DIR}/${GFX_INI} else - sed -i '/ShowFPS/c\ShowFPS = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShowFPS/c\ShowFPS = False' ${CONF_DIR}/${GFX_INI} fi # Skip Bios if [ "$SKIPBIOS" = "false" ]; then - sed -i '/SkipIPL/c\SkipIPL = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/SkipIPL/c\SkipIPL = False' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/SkipIPL/c\SkipIPL = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/SkipIPL/c\SkipIPL = True' ${CONF_DIR}/${DOLPHIN_INI} fi # Skip EFB CPU Access if [ "$EFBACCESS" = "false" ]; then - sed -i '/EFBAccessEnable =/c\EFBAccessEnable = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBAccessEnable =/c\EFBAccessEnable = False' ${CONF_DIR}/${GFX_INI} else - sed -i '/EFBAccessEnable =/c\EFBAccessEnable = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBAccessEnable =/c\EFBAccessEnable = True' ${CONF_DIR}/${GFX_INI} fi # Store EFB to texture only if [ "$EFBTEXTURE" = "false" ]; then - sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = False' ${CONF_DIR}/${GFX_INI} else - sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = True' ${CONF_DIR}/${GFX_INI} fi # Store XFB to texture only if [ "$XFBTEXTURE" = "false" ]; then - sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = False' ${CONF_DIR}/${GFX_INI} else - sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = True' ${CONF_DIR}/${GFX_INI} fi # Texture cache accuracy if [ "$TEXTURE_CACHE_ACCURACY" = "0" ]; then - sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 0' /storage/.config/dolphin-emu/GFX.ini + sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 0' ${CONF_DIR}/${GFX_INI} elif [ "$TEXTURE_CACHE_ACCURACY" = "512" ]; then - sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 512' /storage/.config/dolphin-emu/GFX.ini + sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 512' ${CONF_DIR}/${GFX_INI} else # Default to 128 = fast - sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 128' /storage/.config/dolphin-emu/GFX.ini + sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 128' ${CONF_DIR}/${GFX_INI} fi # Widescreen Hack if [ "$WHACK" = "true" ]; then - sed -i '/wideScreenHack =/c\wideScreenHack = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/wideScreenHack =/c\wideScreenHack = True' ${CONF_DIR}/${GFX_INI} else - sed -i '/wideScreenHack =/c\wideScreenHack = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/wideScreenHack =/c\wideScreenHack = False' ${CONF_DIR}/${GFX_INI} fi # GC Controller Profile if [ "$CON" = "east" ]; then - cp -r /storage/.config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.east /storage/.config/dolphin-emu/GCPadNew.ini + cp -r ${CONF_DIR}/GamecubeControllerProfiles/GCPadNew.ini.east ${CONF_DIR}/${CONTROLLER_INI} elif [ "$CON" = "custom" ]; then - cp -r /storage/.config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.custom /storage/.config/dolphin-emu/GCPadNew.ini + cp -r ${CONF_DIR}/GamecubeControllerProfiles/GCPadNew.ini.custom ${CONF_DIR}/${CONTROLLER_INI} else - cp -r /storage/.config/dolphin-emu/GamecubeControllerProfiles/GCPadNew.ini.south /storage/.config/dolphin-emu/GCPadNew.ini + cp -r ${CONF_DIR}/GamecubeControllerProfiles/GCPadNew.ini.south ${CONF_DIR}/${CONTROLLER_INI} fi # GC Controller Rumble if [ "$RUMBLE" = "false" ]; then - sed -i '/^Rumble/d' /storage/.config/dolphin-emu/GCPadNew.ini + sed -i '/^Rumble/d' ${CONF_DIR}/${CONTROLLER_INI} fi # GC Controller Hotkey Enable if [ "$HKEY" = "mode" ]; then - sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 8' /storage/.config/dolphin-emu/GCPadNew.ini + sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 8' ${CONF_DIR}/${CONTROLLER_INI} else - sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 6' /storage/.config/dolphin-emu/GCPadNew.ini + sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 6' ${CONF_DIR}/${CONTROLLER_INI} fi # Vsync if [ "$VSYNC" = "1" ]; then - sed -i '/VSync =/c\VSync = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/VSync =/c\VSync = True' ${CONF_DIR}/${GFX_INI} else - sed -i '/VSync =/c\VSync = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/VSync =/c\VSync = False' ${CONF_DIR}/${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 -@EXPORTS@ - # Retroachievements -/usr/bin/cheevos_dolphin.sh + /usr/bin/cheevos_dolphin.sh + +# Set video and audio backend + CMD="${CMD} -v $GRENDERER" -# Set audio and video backend if [ ${DOLPHIN_CORE} = "dolphin-emu" ]; then CMD="-b -a ${AUDIO_BACKEND}" else CMD="-p @DOLPHIN_PLATFORM@ -a ${AUDIO_BACKEND}" fi +# Debugging info: + echo "GAME set to: ${GAME}" + echo "PLATFORM set to: ${PLATFORM}" + echo "AA set to: ${AA}" + echo "ASPECT set to: ${ASPECT}" + echo "AUDIOBE set to: ${AUDIOBE}" + echo "ASWAPDISCS set to: ${ASWAPDISCS}" + echo "CLOCK set to: ${CLOCK}" + echo "ENBCHEATS set to: ${ENBCHEATS}" + echo "GRENDERER set to: ${GRENDERER}" + echo "IRES set to: ${IRES}" + echo "FPS set to: ${FPS}" + echo "CON set to: ${CON}" + echo "HKEY set to: ${HKEY}" + echo "SAVETYPE set to: ${SAVETYPE}" + echo "SAVEREG set to: ${SAVEREG}" + echo "SHADERM set to: ${SHADERM}" + echo "SHADERP set to: ${SHADERP}" + echo "VSYNC set to: ${VSYNC}" + echo "SKIPBIOS set to: ${SKIPBIOS}" + echo "EFBACCESS set to: ${EFBACCESS}" + echo "EFBTEXTURE set to: ${EFBTEXTURE}" + echo "XFBTEXTURE set to: ${XFBTEXTURE}" + echo "TEXTURE_CACHE_ACCURACY set to: ${TEXTURE_CACHE_ACCURACY}" + echo "RUMBLE set to: ${RUMBLE}" + echo "WHACK set to: ${WHACK}" + echo "WPC set to: ${WPC}" + echo "Launching /usr/bin/${DOLPHIN_CORE} ${CMD} -e ${1}" + # Run Dolphin emulator + @EXPORTS@ ${GPTOKEYB} ${DOLPHIN_CORE} xbox360 & ${EMUPERF} /usr/bin/${DOLPHIN_CORE} ${CMD} -e "${1}" kill -9 "$(pidof gptokeyb)" diff --git a/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh b/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh index 06a9e0d287..9e081b9d0d 100755 --- a/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh +++ b/projects/ROCKNIX/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh @@ -20,32 +20,37 @@ control-gen_init.sh source /storage/.config/gptokeyb/control.ini get_controls +# Conf files vars +CONF_DIR="/storage/.config/dolphin-emu" +DOLPHIN_INI="Dolphin.ini" +GFX_INI="GFX.ini" +GC_CONTROLLER_INI="GCPadNew.ini" + # Check if dolphin-emu exists in .config -if [ ! -d "/storage/.config/dolphin-emu" ]; then - mkdir -p "/storage/.config/dolphin-emu" +if [ ! -d "${CONF_DIR}" ]; then cp -r "/usr/config/dolphin-emu" "/storage/.config/" fi # Check if Hotkeys.ini exists if [ "${DOLPHIN_CORE}" = 'dolphin-emu' ]; then - if [ ! -f "/storage/.config/dolphin-emu/Hotkeys.ini" ]; then - cp -r "/usr/config/dolphin-emu/Hotkeys.ini" "/storage/.config/dolphin-emu/" + if [ ! -f "${CONF_DIR}/Hotkeys.ini" ]; then + cp -r "/usr/config/dolphin-emu/Hotkeys.ini" "${CONF_DIR}/" fi fi # Check if GC controller dir exists in .config/dolphin-emu/GamecubeControllerProfiles -if [ ! -d "/storage/.config/dolphin-emu/GamecubeControllerProfiles" ]; then - cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles" "/storage/.config/dolphin-emu/" +if [ ! -d "${CONF_DIR}/GamecubeControllerProfiles" ]; then + cp -r "/usr/config/dolphin-emu/GamecubeControllerProfiles" "${CONF_DIR}/" fi # Check if Wii controller dir exists in .config/dolphin-emu/WiiControllerProfiles -if [ ! -d "/storage/.config/dolphin-emu/WiiControllerProfiles" ]; then - cp -r "/usr/config/dolphin-emu/WiiControllerProfiles" "/storage/.config/dolphin-emu/" +if [ ! -d "${CONF_DIR}/WiiControllerProfiles" ]; then + cp -r "/usr/config/dolphin-emu/WiiControllerProfiles" "${CONF_DIR}/dolphin-emu/" fi # Check if Wii custom controller profile exists in .config/dolphin-emu -if [ ! -f "/storage/.config/dolphin-emu/WiiControllerProfiles/custom.ini" ]; then - cp -r "/storage/.config/dolphin-emu/WiiControllerProfiles/vremote.ini" "/storage/.config/dolphin-emu/WiiControllerProfiles/custom.ini" +if [ ! -f "${CONF_DIR}/WiiControllerProfiles/custom.ini" ]; then + cp -r "${CONF_DIR}/WiiControllerProfiles/vremote.ini" "${CONF_DIR}/WiiControllerProfiles/custom.ini" fi # Gamecube controller profile needed for hotkeys to work on SA @@ -60,27 +65,27 @@ if [ ! -d "/storage/roms/savestates/wii/" ]; then mkdir -p "/storage/roms/savestates/wii/" fi -rm -rf /storage/.config/dolphin-emu/StateSaves -ln -sf /storage/roms/savestates/wii /storage/.config/dolphin-emu/StateSaves +rm -rf ${CONF_DIR}/StateSaves +ln -sf /storage/roms/savestates/wii ${CONF_DIR}/StateSaves # Copy bios, memory cards and other system stuff to roms if [ ! -d "/storage/roms/bios/GC/" ]; then mkdir -p /storage/roms/bios/GC/{USA,JAP,EUR} - cp -r /storage/.config/dolphin-emu/GC /storage/roms/bios/ + cp -r ${CONF_DIR}/GC /storage/roms/bios/ fi # Link bios and memory cards to roms for REGION in EUR JAP USA do # Link bios - rm -rf "/storage/.config/dolphin-emu/GC/${REGION}" - ln -sf "/storage/roms/bios/GC/${REGION}" "/storage/.config/dolphin-emu/GC/${REGION}" + rm -rf "${CONF_DIR}/GC/${REGION}" + ln -sf "/storage/roms/bios/GC/${REGION}" "${CONF_DIR}/GC/${REGION}" # Link memory cards, copying to roms/bios first as needed for SLOT in A B do MEM_CARD_FILE="MemoryCard${SLOT}.${REGION}.raw" - CONFIG_MEM_CARD="/storage/.config/dolphin-emu/GC/${MEM_CARD_FILE}" + CONFIG_MEM_CARD="${CONF_DIR}/GC/${MEM_CARD_FILE}" ROMS_BIOS_MEM_CARD="/storage/roms/bios/GC/${MEM_CARD_FILE}" if [ -f "${ROMS_BIOS_MEM_CARD}" ]; then @@ -103,7 +108,7 @@ ASPECT=$(get_setting aspect_ratio "${PLATFORM}" "${GAME}") AUDIOBE=$(get_setting audio_backend "${PLATFORM}" "${GAME}") CLOCK=$(get_setting clock_speed "${PLATFORM}" "${GAME}") ENBCHEATS=$(get_setting enable_cheats "${PLATFORM}" "${GAME}") -RENDERER=$(get_setting graphics_backend "${PLATFORM}" "${GAME}") +GRENDERER=$(get_setting graphics_backend "${PLATFORM}" "${GAME}") IRES=$(get_setting internal_resolution "${PLATFORM}" "${GAME}") FPS=$(get_setting show_fps "${PLATFORM}" "${GAME}") CON=$(get_setting wii_controller_profile "${PLATFORM}" "${GAME}") @@ -121,8 +126,8 @@ WPC=$(get_setting write_protect_configs "${PLATFORM}" "${GAME}") # Grab clean config files during boot, unless disabled in emulationstation if [ "$WPC" != "false" ]; then - cp -r /usr/config/dolphin-emu/GFX.ini /storage/.config/dolphin-emu/GFX.ini - cp -r /usr/config/dolphin-emu/Dolphin.ini /storage/.config/dolphin-emu/Dolphin.ini + cp -r /usr/config/dolphin-emu/GFX.ini ${CONF_DIR}/${GFX_INI} + cp -r /usr/config/dolphin-emu/Dolphin.ini ${CONF_DIR}/${DOLPHIN_INI} fi # Set the cores to use @@ -141,37 +146,37 @@ fi ### Emulation Station features: # Anti-Aliasing if [ "$AA" = "2m" ]; then - sed -i '/MSAA/c\MSAA = 2' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 2' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "2s" ]; then - sed -i '/MSAA/c\MSAA = 2' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 2' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = True' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "4m" ]; then - sed -i '/MSAA/c\MSAA = 4' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 4' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "4s" ]; then - sed -i '/MSAA/c\MSAA = 4' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 4' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = True' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "8m" ]; then - sed -i '/MSAA/c\MSAA = 8' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 8' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} elif [ "$AA" = "8s" ]; then - sed -i '/MSAA/c\MSAA = 8' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 8' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = True' ${CONF_DIR}/${GFX_INI} else - sed -i '/MSAA/c\MSAA = 0' /storage/.config/dolphin-emu/GFX.ini - sed -i '/SSAA/c\SSAA = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/MSAA/c\MSAA = 0' ${CONF_DIR}/${GFX_INI} + sed -i '/SSAA/c\SSAA = False' ${CONF_DIR}/${GFX_INI} fi # Aspect Ratio if [ "$ASPECT" = "1" ]; then - sed -i '/AspectRatio/c\AspectRatio = 1' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 1' ${CONF_DIR}/${GFX_INI} elif [ "$ASPECT" = "2" ]; then - sed -i '/AspectRatio/c\AspectRatio = 2' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 2' ${CONF_DIR}/${GFX_INI} elif [ "$ASPECT" = "3" ]; then - sed -i '/AspectRatio/c\AspectRatio = 3' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 3' ${CONF_DIR}/${GFX_INI} else - sed -i '/AspectRatio/c\AspectRatio = 0' /storage/.config/dolphin-emu/GFX.ini + sed -i '/AspectRatio/c\AspectRatio = 0' ${CONF_DIR}/${GFX_INI} fi # Audio Backend @@ -183,175 +188,209 @@ fi # Clock Speed if [ "$CLOCK" = "050" ]; then - sed -i '/^Overclock =/c\Overclock = 0.5' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 0.5' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "075" ]; then - sed -i '/^Overclock =/c\Overclock = 0.75' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 0.75' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "100" ]; then - sed -i '/^Overclock =/c\Overclock = 1.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 1.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = False' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "125" ]; then - sed -i '/^Overclock =/c\Overclock = 1.25' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 1.25' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "150" ]; then - sed -i '/^Overclock =/c\Overclock = 1.5' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 1.5' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "200" ]; then - sed -i '/^Overclock =/c\Overclock = 2.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 2.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "300" ]; then - sed -i '/^Overclock =/c\Overclock = 3.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 3.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} elif [ "$CLOCK" = "400" ]; then - sed -i '/^Overclock =/c\Overclock = 4.0' /storage/.config/dolphin-emu/Dolphin.ini - sed -i '/^OverclockEnable =/c\OverclockEnable = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^Overclock =/c\Overclock = 4.0' ${CONF_DIR}/${DOLPHIN_INI} + sed -i '/^OverclockEnable =/c\OverclockEnable = True' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/^OverclockEnable =/c\OverclockEnable = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/^OverclockEnable =/c\OverclockEnable = False' ${CONF_DIR}/${DOLPHIN_INI} fi # Enable Cheats if [ "$ENBCHEATS" = "1" ]; then - sed -i '/EnableCheats/c\EnableCheats = True' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/EnableCheats/c\EnableCheats = True' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/EnableCheats/c\EnableCheats = False' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/EnableCheats/c\EnableCheats = False' ${CONF_DIR}/${DOLPHIN_INI} fi # Graphics Backend - if [ "$RENDERER" = "vulkan" ]; then - sed -i '/GFXBackend/c\GFXBackend = Vulkan' /storage/.config/dolphin-emu/Dolphin.ini + if [ "$GRENDERER" = "vulkan" ]; then + sed -i '/GFXBackend/c\GFXBackend = Vulkan' ${CONF_DIR}/${DOLPHIN_INI} + elif [ "$GRENDERER" = "opengl" ]; then + sed -i '/GFXBackend/c\GFXBackend = OGL' ${CONF_DIR}/${DOLPHIN_INI} else - sed -i '/GFXBackend/c\GFXBackend = OGL' /storage/.config/dolphin-emu/Dolphin.ini + sed -i '/GFXBackend/c\GFXBackend = @GRENDERER@' ${CONF_DIR}/${DOLPHIN_INI} fi # Internal Resolution if [ "$IRES" = "1" ]; then - sed -i '/InternalResolution/c\InternalResolution = 1' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 1' ${CONF_DIR}/${GFX_INI} elif [ "$IRES" = "3" ]; then - sed -i '/InternalResolution/c\InternalResolution = 3' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 3' ${CONF_DIR}/${GFX_INI} elif [ "$IRES" = "4" ]; then - sed -i '/InternalResolution/c\InternalResolution = 4' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 4' ${CONF_DIR}/${GFX_INI} elif [ "$IRES" = "6" ]; then - sed -i '/InternalResolution/c\InternalResolution = 6' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 6' ${CONF_DIR}/${GFX_INI} else - sed -i '/InternalResolution/c\InternalResolution = 2' /storage/.config/dolphin-emu/GFX.ini + sed -i '/InternalResolution/c\InternalResolution = 2' ${CONF_DIR}/${GFX_INI} fi # Shader Mode if [ "$SHADERM" = "0" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 0' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 0' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERM" = "1" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 1' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 1' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERM" = "2" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 2' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 2' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERM" = "3" ]; then - sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 3' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShaderCompilationMode =/c\ShaderCompilationMode = 3' ${CONF_DIR}/${GFX_INI} fi #Shader Precompile if [ "$SHADERP" = "false" ]; then - sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = False' ${CONF_DIR}/${GFX_INI} elif [ "$SHADERP" = "true" ]; then - sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/WaitForShadersBeforeStarting =/c\WaitForShadersBeforeStarting = True' ${CONF_DIR}/${GFX_INI} fi # Show FPS if [ "$FPS" = "true" ]; then - sed -i '/ShowFPS/c\ShowFPS = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShowFPS/c\ShowFPS = True' ${CONF_DIR}/${GFX_INI} else - sed -i '/ShowFPS/c\ShowFPS = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/ShowFPS/c\ShowFPS = False' ${CONF_DIR}/${GFX_INI} fi # Wii Controller Profile - if [ "$CON" = "vremote" ]; then - cp -r /storage/.config/dolphin-emu/WiiControllerProfiles/vremote.ini /storage/.config/dolphin-emu/WiimoteNew.ini - elif [ "$CON" = "hremote" ]; then - cp -r /storage/.config/dolphin-emu/WiiControllerProfiles/hremote.ini /storage/.config/dolphin-emu/WiimoteNew.ini + if [ "$CON" = "classic" ]; then + cp -r ${CONF_DIR}/WiiControllerProfiles/classic.ini ${CONF_DIR}/WiimoteNew.ini + elif [ "$CON" = "vremote" ]; then + cp -r ${CONF_DIR}/WiiControllerProfiles/vremote.ini ${CONF_DIR}/WiimoteNew.ini elif [ "$CON" = "nunchuck" ]; then - cp -r /storage/.config/dolphin-emu/WiiControllerProfiles/nunchuck.ini /storage/.config/dolphin-emu/WiimoteNew.ini + cp -r ${CONF_DIR}/WiiControllerProfiles/nunchuck.ini ${CONF_DIR}/WiimoteNew.ini elif [ "$CON" = "custom" ]; then - cp -r /storage/.config/dolphin-emu/WiiControllerProfiles/custom.ini /storage/.config/dolphin-emu/WiimoteNew.ini + cp -r ${CONF_DIR}/WiiControllerProfiles/custom.ini ${CONF_DIR}/WiimoteNew.ini else - cp -r /storage/.config/dolphin-emu/WiiControllerProfiles/classic.ini /storage/.config/dolphin-emu/WiimoteNew.ini + cp -r ${CONF_DIR}/WiiControllerProfiles/hremote.ini ${CONF_DIR}/WiimoteNew.ini fi # Wii Controller Rumble if [ "$RUMBLE" = "false" ]; then - sed -i '/^Rumble/d' /storage/.config/dolphin-emu/WiimoteNew.ini + sed -i '/^Rumble/d' ${DOLPHIN_INI}/WiimoteNew.ini fi # Wii Controller Hotkey Enable if [ "$HKEY" = "mode" ]; then - sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 8' /storage/.config/dolphin-emu/GCPadNew.ini + sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 8' ${CONF_DIR}/GCPadNew.ini else - sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 6' /storage/.config/dolphin-emu/GCPadNew.ini + sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 6' ${CONF_DIR}/GCPadNew.ini fi - - # Vsync - if [ "$VSYNC" = "1" ]; then - sed -i '/VSync =/c\VSync = True' /storage/.config/dolphin-emu/GFX.ini - else - sed -i '/VSync =/c\VSync = False' /storage/.config/dolphin-emu/GFX.ini - fi - # Skip EFB CPU Access if [ "$EFBACCESS" = "false" ]; then - sed -i '/EFBAccessEnable =/c\EFBAccessEnable = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBAccessEnable =/c\EFBAccessEnable = False' ${CONF_DIR}/${GFX_INI} else - sed -i '/EFBAccessEnable =/c\EFBAccessEnable = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBAccessEnable =/c\EFBAccessEnable = True' ${CONF_DIR}/${GFX_INI} fi # Store EFB to texture only if [ "$EFBTEXTURE" = "false" ]; then - sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = False' ${CONF_DIR}/${GFX_INI} else - sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/EFBToTextureEnable =/c\EFBToTextureEnable = True' ${CONF_DIR}/${GFX_INI} fi # Store XFB to texture only if [ "$XFBTEXTURE" = "false" ]; then - sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = False' ${CONF_DIR}/${GFX_INI} else - sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/XFBToTextureEnable =/c\XFBToTextureEnable = True' ${CONF_DIR}/${GFX_INI} fi # Texture cache accuracy if [ "$TEXTURE_CACHE_ACCURACY" = "0" ]; then - sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 0' /storage/.config/dolphin-emu/GFX.ini + sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 0' ${CONF_DIR}/${GFX_INI} elif [ "$TEXTURE_CACHE_ACCURACY" = "512" ]; then - sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 512' /storage/.config/dolphin-emu/GFX.ini + sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 512' ${CONF_DIR}/${GFX_INI} else # Default to 128 = fast - sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 128' /storage/.config/dolphin-emu/GFX.ini + sed -i '/SafeTextureCacheColorSamples =/c\SafeTextureCacheColorSamples = 128' ${CONF_DIR}/${GFX_INI} fi # Widescreen Hack if [ "$WHACK" = "true" ]; then - sed -i '/wideScreenHack =/c\wideScreenHack = True' /storage/.config/dolphin-emu/GFX.ini + sed -i '/wideScreenHack =/c\wideScreenHack = True' ${CONF_DIR}/${GFX_INI} else - sed -i '/wideScreenHack =/c\wideScreenHack = False' /storage/.config/dolphin-emu/GFX.ini + sed -i '/wideScreenHack =/c\wideScreenHack = False' ${CONF_DIR}/${GFX_INI} fi # Skip bios always, it's untested for Wii -sed -i '/SkipIPL/c\SkipIPL = True' /storage/.config/dolphin-emu/Dolphin.ini +sed -i '/SkipIPL/c\SkipIPL = True' ${CONF_DIR}/${DOLPHIN_INI} + + # GC Controller Hotkey Enable + if [ "$HKEY" = "mode" ]; then + sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 8' ${CONF_DIR}/${GC_CONTROLLER_INI} + else + sed -i '/^Buttons\/Hotkey =/c\Buttons\/Hotkey = Button 6' ${CONF_DIR}/${GC_CONTROLLER_INI} + fi + + # Vsync + if [ "$VSYNC" = "1" ]; then + sed -i '/VSync =/c\VSync = True' ${CONF_DIR}/${GFX_INI} + else + sed -i '/VSync =/c\VSync = False' ${CONF_DIR}/${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 -@EXPORTS@ - # Retroachievements -/usr/bin/cheevos_dolphin.sh + /usr/bin/cheevos_dolphin.sh + +# Set video and audio backend + CMD="${CMD} -v $GRENDERER" -# Set audio and video backend if [ ${DOLPHIN_CORE} = "dolphin-emu" ]; then CMD="-b -a ${AUDIO_BACKEND}" else CMD="-p @DOLPHIN_PLATFORM@ -a ${AUDIO_BACKEND}" fi +# Debugging info: + echo "GAME set to: ${GAME}" + echo "PLATFORM set to: ${PLATFORM}" + echo "AA set to: ${AA}" + echo "ASPECT set to: ${ASPECT}" + echo "AUDIOBE set to: ${AUDIOBE}" + echo "CLOCK set to: ${CLOCK}" + echo "ENBCHEATS set to: ${ENBCHEATS}" + echo "GRENDERER set to: ${GRENDERER}" + echo "IRES set to: ${IRES}" + echo "FPS set to: ${FPS}" + echo "CON set to: ${CON}" + echo "HKEY set to: ${HKEY}" + echo "SHADERM set to: ${SHADERM}" + echo "SHADERP set to: ${SHADERP}" + echo "VSYNC set to: ${VSYNC}" + echo "EFBACCESS set to: ${EFBACCESS}" + echo "EFBTEXTURE set to: ${EFBTEXTURE}" + echo "XFBTEXTURE set to: ${XFBTEXTURE}" + echo "TEXTURE_CACHE_ACCURACY set to: ${TEXTURE_CACHE_ACCURACY}" + echo "RUMBLE set to: ${RUMBLE}" + echo "WHACK set to: ${WHACK}" + echo "WPC set to: ${WPC}" + echo "Launching /usr/bin/${DOLPHIN_CORE} ${CMD} -e ${1}" + # Run Dolphin emulator + @EXPORTS@ ${GPTOKEYB} ${DOLPHIN_CORE} xbox360 & ${EMUPERF} /usr/bin/${DOLPHIN_CORE} ${CMD} -e "${1}" kill -9 "$(pidof gptokeyb)"