-
Notifications
You must be signed in to change notification settings - Fork 1
/
Isles of Sea and Sky.sh
66 lines (54 loc) · 1.96 KB
/
Isles of Sea and Sky.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
if [ -d "/opt/system/Tools/PortMaster/" ]; then
controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
controlfolder="/opt/tools/PortMaster"
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
controlfolder="$XDG_DATA_HOME/PortMaster"
else
controlfolder="/roms/ports/PortMaster"
fi
source $controlfolder/control.txt
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
get_controls
# Variables
GAMEDIR="/$directory/ports/iosas"
cd $GAMEDIR
> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
# Exports
export LD_LIBRARY_PATH="$GAMEDIR/libs:$GAMEDIR/tools/lib:$LD_LIBRARY_PATH"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
export PATCHER_FILE="$GAMEDIR/tools/patchscript"
export PATCHER_GAME="$(basename "${0%.*}")" # This gets the current script filename without the extension
export PATCHER_TIME="5 to 10 minutes"
# CD and set permissions
cd $GAMEDIR
> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
$ESUDO chmod +x -R $GAMEDIR/*
# dos2unix in case we need it
dos2unix "$GAMEDIR/tools/gmKtool.py"
dos2unix "$GAMEDIR/tools/Klib/GMblob.py"
dos2unix "$GAMEDIR/tools/patchscript"
# Check if patchlog.txt to skip patching
if [ ! -f patchlog.txt ]; then
if [ -f "$controlfolder/utils/patcher.txt" ]; then
source "$controlfolder/utils/patcher.txt"
$ESUDO kill -9 $(pidof gptokeyb)
else
echo "This port requires the latest version of PortMaster." > $CUR_TTY
fi
else
echo "Patching process already completed. Skipping."
fi
# Display loading splash
if [ -f "$GAMEDIR/patchlog.txt" ]; then
[ "$CFW_NAME" == "muOS" ] && splash "splash.png" 1 # workaround for muOS
$ESUDO ./libs/splash "splash.png" 8000
fi
# Assign gptokeyb and load the game
$GPTOKEYB "gmloadernext" -c "control.gptk" &
pm_platform_helper "$GAMEDIR/gmloadernext"
./gmloadernext game.apk
# Kill processes
pm_finish