-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathStardewValley.sh
73 lines (57 loc) · 1.88 KB
/
StardewValley.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
67
68
69
70
71
72
73
#!/bin/bash
export HOME=/root
if [ -d "/opt/system/Tools/PortMaster/" ]; then
controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
controlfolder="/opt/tools/PortMaster"
elif [ -d "/roms/ports" ]; then
controlfolder="/roms/ports/PortMaster"
elif [ -d "/roms2/ports" ]; then
controlfolder="/roms2/ports/PortMaster"
else
controlfolder="/storage/roms/ports/PortMaster"
fi
SHDIR=$(dirname "$0")
source $controlfolder/control.txt
get_controls
#gamedir="/$directory/ports/stardewvalley"
gamedir="$SHDIR/stardewvalley"
echo "--directory=$directory---,HOTKEY=$HOTKEY--"
cd "$gamedir/gamedata"
# Grab text output...
$ESUDO chmod 666 /dev/tty0
printf "\033c" > /dev/tty0
echo "Loading... Please Wait." > /dev/tty0
# Setup mono
monodir="$HOME/mono"
monofile="$controlfolder/libs/mono-6.12.0.122-aarch64.squashfs"
$ESUDO mkdir -p "$monodir"
$ESUDO umount "$monofile" || true
$ESUDO mount "$monofile" "$monodir"
# Setup savedir
$ESUDO mkdir -p $HOME/.config
$ESUDO rm -rf $HOME/.config/StardewValley
ln -sfv "$gamedir/savedata" $HOME/.config/StardewValley
# Remove all the dependencies in favour of system libs - e.g. the included
# newer version of MonoGame with fixes for SDL2
rm -f System*.dll MonoGame*.dll mscorlib.dll
# Copy the fixed monogame config
cp ../dlls/MonoGame.Framework.dll.config .
# Setup path and other environment variables
export MONOGAME_PATCH="$gamedir/dlls/Patch.dll"
export MONO_PATH="$gamedir/dlls"
export PATH="$monodir/bin":"$PATH"
export LIBGL_ES=2
export LIBGL_GL=21
export LIBGL_FB=4
export SDL_VIDEO_GL_DRIVER="$gamedir/libs/libGL.so.1"
export SDL_VIDEO_EGL_DRIVER="$gamedir/libs/libEGL.so.1"
DSIPLAY_ID="$(cat /sys/class/power_supply/axp2202-battery/display_id)"
if [[ $DSIPLAY_ID == "1" ]]; then
AUDIODEV=hw:2,0 mono StardewValley.exe
else
mono StardewValley.exe
fi
$ESUDO umount "$monodir"
# Disable console
printf "\033c" >> /dev/tty1