Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Determine PortMaster control folder
- if [ -d "/opt/system/Tools/PortMaster/" ]; then
- controlfolder="/opt/system/Tools/PortMaster"
- elif [ -d "/opt/tools/PortMaster/" ]; then
- controlfolder="/opt/tools/PortMaster"
- else
- controlfolder="/roms/ports/PortMaster"
- fi
- # Source control files if available
- source "${controlfolder}/control.txt"
- [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
- get_controls
- # Variables
- GAMEDIR="/storage/roms/ports/karting-superstars"
- WINEPREFIX="/storage/.wine64-shared"
- # Ensure the game directory exists.
- if [ ! -d "$GAMEDIR" ]; then
- echo "Error: Game directory missing ($GAMEDIR). Please check your installation."
- exit 1
- fi
- # Change to game directory and prepare logging.
- cd "$GAMEDIR"
- > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
- chmod +x -R "$GAMEDIR"/*
- # Following section of box64 exporta added by titooo7
- # This definitely improves performance in Cocoon and probably some Unity games
- # It is basically the equivalent to a Performance present on Winlator 7.1.3 v11R2 from coffincolors with the only change of the Unity value changed from 0 to 1
- export BOX64_DYNAREC_SAFEFLAGS=1
- export BOX64_DYNAREC_FASTNAN=1
- export BOX64_DYNAREC_FASTROUND=1
- export BOX64_DYNAREC_X87DOUBLE=0
- export BOX64_DYNAREC_BIGBLOCK=3
- export BOX64_DYNAREC_STRONGMEM=0
- export BOX64_DYNAREC_FORWARD=512
- export BOX64_DYNAREC_CALLRET=1
- export BOX64_DYNAREC_WAIT=1
- export BOX64_AVX=0
- export BOX64_MAXCPU=8
- export BOX64_UNITYPLAYER=1
- # IMPORTANT - The following two lines were added by me, titooo7, but I got no clue if that actually works or helps
- winetricks graphics=wayland
- export WINE_USE_XWAYLAND=1
- # I wanted to use the next variable but I don't know if it should be export -force-gfx-direct or export force-gfx-direct so I am not using it
- #export -force-gfx-direct
- # Environment variable exports.
- export SDL_GAMECONTROLLERCONFIG="\$sdl_controllerconfig"
- export WINEPREFIX="/storage/.wine64-shared"
- export WINEDEBUG=-all
- # Graphics and optimization options.
- export DXVK_HUD=devinfo,fps,gpuload,version
- export DXVK_ASYNC=1
- export STAGING_SHARED_MEMORY=1
- export STAGING_WRITECOPY=1
- # Check if pm_message exists.
- if ! type pm_message &>/dev/null; then
- echo "Warning: pm_message function is missing. Skipping dependency message."
- else
- pm_message "Checking for and installing dependencies..."
- fi
- # Config Setup: create config directory and bind to the Wine save folder.
- mkdir -p "$GAMEDIR/config"
- if [ "$(type -t bind_directories)" = "function" ]; then
- bind_directories "$WINEPREFIX/drive_c/users/root/AppData/LocalLow/Andrew Shouldice/Secret Legend" "$GAMEDIR/config"
- else
- echo "Warning: bind_directories function is missing. Skipping config binding."
- fi
- # Check that box64, wine64, and GPTOKEYB exist before launching.
- if ! command -v box64 &>/dev/null || ! command -v wine64 &>/dev/null; then
- echo "Error: box64 or wine64 is missing. Install them before running the game."
- exit 1
- fi
- if ! command -v /usr/bin/gptokeyb &>/dev/null; then
- echo "Error: GPTOKEYB is missing. Install it before running the game."
- exit 1
- fi
- # Launch the game:
- # First, launch GPToKeyB for controller mapping.
- /usr/bin/gptokeyb "karting-superstars.exe" -c "./karting-superstars.gptk" &
- # Then launch the game executable from the data folder using box64/wine64.
- box64 wine64 "$GAMEDIR/data/"karting-superstars.exe""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement