Welcome to mirror list, hosted at ThFree Co, Russian Federation.

clover-kachikachi-wr « bin « rootfs « hakchi « mod_hakchi « mods - github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0da3c122b17973a5767eedd0e5cb0410acf5db71 (plain)
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
#!/bin/sh
# Wrapper for kachikachi
# You can add extra command line arguments to all games at once
# using "cfg_nes_extra_args" variable in p0000_config
# or disable epilepsy protection using "cfg_disable_armet=y"

source /etc/preinit
script_init

filename="$(readlink -f "$1")"
filebase="$(basename "$filename")"
extension="${filebase##*.}"
tmppath="$temppath/rom"
if [ "$extension" == "7z" ]; then
  rm -rf "$tmppath"
  mkdir -p "$tmppath"
  cd "$tmppath"
  tiny7zx x "$filename"
  filename="$(ls|head -n1)"
  mv "$filename" "rom.${filename##*.}"
  filename="$tmppath/rom.${filename##*.}"
fi
if [ "$extension" == "gz" ]; then
  rm -rf "$tmppath"
  mkdir -p "$tmppath"
  filebase="$(basename "$filebase" ".gz")"
  extension="${filebase##*.}"
  filename="$tmppath/rom.$extension"
  gunzip -c > "$filename"
fi
shift

args="$filename $@ $cfg_nes_extra_args"
[ "$cfg_disable_armet" == "y" ] && args="$(echo $args | sed 's/--enable-armet//g')"

[ -f "/bin/clover-kachikachi" ] && exec /bin/clover-kachikachi $args
[ -f "/usr/bin/clover-kachikachi" ] && exec /usr/bin/clover-kachikachi $args