forked from jxded/anbernic-pm-launchscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jazz2 Resurrection.sh
46 lines (35 loc) · 1.22 KB
/
Jazz2 Resurrection.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
#!/bin/bash
# Ported by Maciej Suminski <orson at orson dot net dot pl>
# Built from https://github.com/deathkiller/jazz2-native
# cmake .. -DCMAKE_BUILD_TYPE=Release -DDEATH_TRACE=OFF -DNCINE_PREFERRED_BACKEND=SDL2 -DNCINE_LINUX_PACKAGE=jazz2 -DNCINE_PACKAGED_CONTENT_PATH=ON
PORTNAME="Jazz Jackrabbit 2"
export HOME=/root
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
get_controls
CUR_TTY=/dev/tty0
$ESUDO chmod 666 $CUR_TTY
SHDIR=$(dirname "$0")
GAMEDIR="$SHDIR/jazz2"
cd $GAMEDIR
# Symbolic link will not work
cp "$SDL_GAMECONTROLLERCONFIG_FILE" "$GAMEDIR/Content/gamecontrollerdb.txt"
export XDG_CONFIG_HOME="$SHDIR"
export XDG_DATA_HOME="$SHDIR"
$ESUDO chmod 666 /dev/uinput
$GPTOKEYB "jazz2" &
./jazz2 2>&1 | tee -a ./log.txt
$ESUDO kill -9 $(pidof gptokeyb)
unset LD_LIBRARY_PATH
unset SDL_GAMECONTROLLERCONFIG
$ESUDO systemctl restart oga_events &
printf "\033c" >> $CUR_TTY