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

clover-canoe-shvc-wr « bin « rootfs « hakchi « mod - github.com/ClusterM/hakchi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b3b2bc0fbc04b2989d34ff3df7a1dd7e415e0b9f (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
38
#!/bin/sh
# Wrapper for canoe
# You can add extra command line arguments to all games at once
# using "cfg_snes_extra_args" variable in p0000_config

source /etc/preinit
script_init

options=""

while [ $# -gt 0 ] ; do
  case "$1" in
  -rom)
    filename="$(readlink -f "$2")"
    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
    options="-rom $filename"
    shift
    ;;
  *) options="$options $1" ;;
  esac
  shift
done

args="$options $cfg_snes_extra_args"

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