-
Notifications
You must be signed in to change notification settings - Fork 171
/
game2chd
executable file
·39 lines (38 loc) · 1.27 KB
/
game2chd
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
#!/usr/bin/env bash
# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry)
helpmsg() {
printf "%s\n" "desc: convert game disc image to chd (Playstation, Dreamcast, Sega Saturn, Sega CD/Mega CD, PC Engine CD/TurboGrafx CD, Panasonic 3DO ...etc)"
printf "%s\n" "demo: https://youtu.be/DdPjj0XGlpo"
printf "%s\n" "depend: mame-tools"
printf "%s\n" " task-spooler (optional)"
printf "\n"
printf "%s\n" "usage: ${0##*/} [cue|gdi]"
printf "\n"
printf "%s\n" " $ ${0##*/} file.cue"
printf "%s\n" " $ ${0##*/} file1.cue file2.gdi file3.cue"
printf "%s\n" " $ ${0##*/} -t *.cue"
printf "%s\n" " $ ${0##*/} *.cue"
printf "%s\n" " $ ${0##*/} *.gdi"
printf "\n"
printf "%s\n" "options:"
printf "%s\n" " -t, --tsp queue with task-spooler (TS_SOCKET=/tmp/sh tsp)"
printf "%s\n" " -h, --help display this help message"
printf "\n"
}
if [ $# -lt 1 ]; then
helpmsg
exit 1
elif [ "$1" = -h ] || [ "$1" = --help ]; then
helpmsg
exit 0
elif [ "$1" = -t ] || [ "$1" = --tsp ]; then
myArray=("${@:2}")
for arg in "${myArray[@]}"; do
TS_SOCKET=/tmp/sh tsp chdman createcd -i "$arg" -o "${arg%.*}.chd"
done
else
myArray=("$@")
for arg in "${myArray[@]}"; do
chdman createcd -i "$arg" -o "${arg%.*}.chd"
done
fi