-
Notifications
You must be signed in to change notification settings - Fork 4
/
Celeste.sh
85 lines (68 loc) · 2.41 KB
/
Celeste.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
74
75
76
77
78
79
80
81
82
83
84
85
#!/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
source $controlfolder/tasksetter
get_controls
#gamedir="/$directory/ports/celeste"
gamedir="$SHDIR/celeste"
echo "--directory=$directory---,HOTKEY=$HOTKEY--"
gameassembly="Celeste.exe"
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 rm -rf ~/.local/share/Celeste
mkdir -p ~/.local/share
ln -sfv "$gamedir/savedata" ~/.local/share/Celeste
# Remove all the dependencies in favour of system libs - e.g. the included
# newer version of FNA with patcher included
rm -f System*.dll mscorlib.dll FNA.dll Mono.*.dll
cp $gamedir/libs/Celeste.exe.config $gamedir/gamedata
# Setup path and other environment variables
export FNA_PATCH="$gamedir/dlls/CelestePatches.dll"
export MONO_PATH="$gamedir/dlls"
export LD_LIBRARY_PATH="$gamedir/libs":"${monodir}/lib":$LD_LIBRARY_PATH
export PATH="$monodir/bin":"$PATH"
export FNA3D_OPENGL_FORCE_ES3=1
export FNA3D_OPENGL_FORCE_VBO_DISCARD=1
# Compress all textures with ASTC codec, bringing massive vram gains
if [[ ! -f "$gamedir/.astc_done" ]]; then
echo "Optimizing textures..." >> /dev/tty0
"$gamedir/celeste-repacker" "$gamedir/gamedata/Content/Graphics/" --install >> /dev/tty0
if [ $? -eq 0 ]; then
touch "$gamedir/.astc_done"
fi
fi
# first_time_setup
$GPTOKEYB "mono" &
DSIPLAY_ID="$(cat /sys/class/power_supply/axp2202-battery/display_id)"
if [[ $DSIPLAY_ID == "1" ]]; then
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2800.5 AUDIODEV=hw:2,0 $TASKSET mono Celeste.exe
else
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2800.5 $TASKSET mono Celeste.exe
fi
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
$ESUDO umount "$monodir"
# Disable console
printf "\033c" >> /dev/tty1