-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathexceptions
124 lines (110 loc) · 6.64 KB
/
exceptions
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env bash
# shellcheck disable=SC2154 # variables are inherrited when sourced, no need to error
# Useful variables:
# ${gameName} Name of the game as it appears on GOG.com
# ${tmpdir}/${gameName} Where the game files got extracted, before install
# ${gameID} Each product has an ID number, not usually visible to the end user
# ${romdir} Folder that has rom folders for different emulators
# ${biosdir} Folder for BIOS roms
# ${dosboxdir} ${romdir}/pc
# ${scummvmdir} ${romdir}/scummvm
# Error messages can be customized for commands that failed by ending the command with an OR, like so: || _error "Custom error message"
1435827232_exception() { #Ultimate DOOM, The
sudo apt install zip
mkdir -p "${romdir}/ports/doom" || { _error "Could not create directory ${romdir}/ports/doom"; return; }
cp "${tmpdir}/${gameName}/DOOM.WAD" "${romdir}/ports/doom/" || { _error "Could not copy DOOM.WAD to installation directory"; return; }
cat <<'_EOF_' >>"${romdir}/ports/Ultimate Doom.sh"
#!/usr/bin/env bash
# This file is borrowed from https://raw.githubusercontent.com/crcerror/launch-doom-packs-RP/6479af76bf7909711245763a1c7e707f852d56b2/DOOM%20-%201.sh
path="/home/pi/RetroPie/roms/ports/doom"
wadfile="DOOM.WAD"
if ! [[ -e "${path}/$wadfile" ]]; then
echo "Error! ${path}/$wadfile not found!"
echo "Is there a problem in the script or the installation file?"
sleep 10
exit
fi
if [[ -e "${path}/savegames_${wadfile%.*}.zip" ]]; then
unzip -qq -o "${path}/savegames_${wadfile%.*}.zip" -d "$path"
fi
"/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "doom" "${path}/$wadfile"
cd "$path" && zip -mj "savegames_${wadfile%.*}.zip" prbmsav?.dsg
_EOF_
chmod +x "${romdir}/ports/Ultimate Doom.sh" || { _error "Could not create the installation script"; return; }
if _yesno "${gameName} has been installed to ${romdir}/ports/doom.\nSelect yes to build and use libretro PrBoom as the engine.\nSelect No to skip the build."; then
sudo "${HOME}/RetroPie-Setup/retropie_packages.sh" lr-prboom || { _error "Could not install lr-prboom"; return; }
fi
_msgbox "${gameName} is installed to work with PrBoom, with seperated savgame.\n\nMake sure to enable lr-prboom as your DOOM engine, in the runcommand."
}
1207658753_exception() { #Teenagent
mv -f "${tmpdir}/${gameName}" "${scummvmdir}/${gameName}.svm" || { _error "Could not copy games to ${scummvmdir}/${gameName}.svm"; return; }
echo "teenagent" >"${scummvmdir}/${gameName}.svm/teenagent.svm" || { _error "Could not create shortcut"; return; }
_msgbox "${gameName} Has been installed to ${scummvmdir}\n\nYou need to open up ScummVM and add the game manually."
}
1885026907_exception() { #Escape from Monkey Island
mv -f "${tmpdir}/${gameName}" "${romdir}/residualvm/${gameName}" || { _error "Could not copy games to ${romdir}/residualvm/\n\nCheck if ResidualVM is installed."; return; }
(
cd "${romdir}/residualvm/${gameName}" || { _error "Could not access ${romdir}/residualvm/${gameName}"; return; }
curl -o "MonkeyUpdate.exe" -O "https://demos.residualvm.org/patches/MonkeyUpdate.exe"
)
(
cd "${romdir}/residualvm/${gameName}/Textures" || { _error "Could not access ${gameName}/Textures"; return; }
mv "FullMonkeyMap.imt" "FullMonkeyMap1.imt" || { _error "Could not manipulate texture data"; return; }
cp "FullMonkeyMap1.imt" "FullMonkeyMap2.imt" || { _error "Could not manipulate texture data"; return; }
)
_msgbox "${gameName} Has been installed to ${romdir}/"
}
1207666473_exception() { #Wings (Emulated Amiga Edition)
unzip "${tmpdir}/${gameName}/Wings.exe" -d "${tmpdir}/${gameName}"
mkdir -p "${biosdir}/Amiga"
cp "${tmpdir}/${gameName}/Media GOG/Kick12.rom" "${biosdir}/Amiga/kick12.rom" || { _error "Could not write to ${biosdir}"; return; }
echo "Ripping wings disks"
dd "if=${tmpdir}/${gameName}/Media GOG/romwings.bin" "of=${tmpdir}/${gameName}/wings-1.adf" bs=1 skip=4 count=901120
dd "if=${tmpdir}/${gameName}/Media GOG/romwings.bin" "of=${tmpdir}/${gameName}/wings-2.adf" bs=1 skip=901124 count=901120
mkdir -p "${romdir}/amiga/gog"
cp "${tmpdir}/${gameName}"/wings-{1,2}.adf "${romdir}/amiga/gog" || { _error "Could not copy rom files.\n\nThis usually happens when no Amiga emulator is installed."; return; }
cat <<'_EOF_' >>"${romdir}/amiga/Wings.uae"
use_gui=no
kickstart_rom_file=/home/pi/RetroPie/BIOS/Amiga/kick12.rom
kickstart_rom_file_id=A6CE1636,KS ROM v1.2 (A500,A1000,A2000)
floppy0=/home/pi/RetroPie/roms/amiga/gog/wings-1.adf
floppy1=/home/pi/RetroPie/roms/amiga/gog/wings-2.adf
nr_floppies=2
floppy_speed=800
_EOF_
_msgbox "${gameName} Has been installed to ${romdir}/amiga\n\nSuggested emulator Amiberry"
}
1207666773_exception() { #Rocket Ranger (Emulated Amiga Edition)
unzip "${tmpdir}/${gameName}/RocketRanger.exe" -d "${tmpdir}/${gameName}"
mkdir -p "${biosdir}/Amiga"
cp "${tmpdir}/${gameName}/Media/Kick12.rom" "${biosdir}/Amiga/kick12.rom" || { _error "Could not write to ${biosdir}"; return; }
mkdir -p "${romdir}/amiga/gog"
cp "${tmpdir}/${gameName}"/Media/RocketRanger-{1,2}.adf "${romdir}/amiga/gog" || { _error "Could not copy rom files.\n\nThis usually happens when no Amiga emulator is installed."; return; }
cat <<'_EOF_' >>"${romdir}/amiga/Rocket Ranger.uae"
use_gui=no
kickstart_rom_file=/home/pi/RetroPie/BIOS/Amiga/kick12.rom
kickstart_rom_file_id=A6CE1636,KS ROM v1.2 (A500,A1000,A2000)
floppy0=/home/pi/RetroPie/roms/amiga/gog/RocketRanger-1.adf
floppy1=/home/pi/RetroPie/roms/amiga/gog/RocketRanger-2.adf
nr_floppies=2
floppy_speed=800
_EOF_
_msgbox "${gameName} Has been installed to ${romdir}/amiga\n\nSuggested emulator Amiberry"
}
1207665703_exception() { #Defender of the Crown
unzip "${tmpdir}/${gameName}/Defender of the Crown.exe" -d "${tmpdir}/${gameName}"
mkdir -p "${biosdir}/Amiga"
cp "${tmpdir}/${gameName}/Media/Kick12.rom" "${biosdir}/Amiga/kick12.rom" || { _error "Could not write to ${biosdir}"; return; }
mkdir -p "${romdir}/amiga/gog"
cp "${tmpdir}/${gameName}"/Media/dotc-{1,2}.adf "${romdir}/amiga/gog" || { _error "Could not copy rom files.\n\nThis usually happens when no Amiga emulator is installed."; return; }
cat <<'_EOF_' >>"${romdir}/amiga/Defender of the Crown.uae"
use_gui=no
kickstart_rom_file=/home/pi/RetroPie/BIOS/Amiga/kick12.rom
kickstart_rom_file_id=A6CE1636,KS ROM v1.2 (A500,A1000,A2000)
floppy0=/home/pi/RetroPie/roms/amiga/gog/dotc-1.adf
floppy1=/home/pi/RetroPie/roms/amiga/gog/dotc-2.adf
nr_floppies=2
floppy_speed=800
_EOF_
_msgbox "${gameName} Has been installed to ${romdir}/amiga\n\nSuggested emulator Amiberry"
}