-
Notifications
You must be signed in to change notification settings - Fork 0
/
Perfect Dark.sh
45 lines (35 loc) · 1.27 KB
/
Perfect Dark.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
# PORTMASTER: perfect_dark.zip, Perfect Dark.sh
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
PORT_32BIT=Y
source $controlfolder/control.txt
source $controlfolder/device_info.txt
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
get_controls
# Set variables
GAMEDIR="/$directory/ports/perfect_dark"
# Permissions
$ESUDO chmod 0777 /dev/tty0
cd $GAMEDIR
# Copy the right build to the main folder
if [ $CFW_NAME == "ArkOS" ] || [ "$CFW_NAME" == 'ArkOS wuMMLe' ] || [ "$CFW_NAME" == "knulli" ]; then
cp -f "$GAMEDIR/bin/pd_armhf_compatibility.elf" pd.elf
else
cp -f "$GAMEDIR/bin/pd_armhf_performance.elf" pd.elf
fi
# Run the game
echo "Loading, please wait... (might take a while!)" > /dev/tty0
$GPTOKEYB "pd.elf" -c "pd.gptk" &
./pd.elf --rom-file $GAMEDIR/rom/pd.ntsc-final.z64 --basedir $GAMEDIR --savedir $GAMEDIR
$ESUDO systemctl restart oga_events &
printf "\033c" >> /dev/tty1
printf "\033c" > /dev/tty0