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

clover-canoe-shvc « bin « usr « snes9x2010.hmod « core_modules - github.com/ClusterM/retroarch-clover.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 02f43c89f9ea794404ca1cd7bb0aa5b4ca0bd302 (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
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
#!/bin/sh

set -x

export MALI_NOCLEAR=1

decorative_options()
{
  local fn="$1_options.txt"
  if [ ! -f "$fn" ] ; then
    return
  fi
  while read option ; do
    case "$option" in
    hue) printf ' --decorative-frame-hue';;
    luminosity) printf ' --decorative-frame-luminosity';;
    saturation) printf ' --decorative-frame-saturation';;
    esac
  done < "$fn"
}

args=$@
options=""
retroarch=0
clovercon_file=/dev/clovercon1
video_mode=keep-aspect-ratio
mode1="-filter 2 -magfilter 1"
mode2="-filter 1 -magfilter 3"
mode3="-filter 1 --pixel-perfect"

while [ $# -gt 0 ] ; do
  case "$1" in
  --title-code) title_code="$2"; shift ;;
  --load-state-file) options="$options -resume" ;;
  --save-data-backing-file) options="$options --sram-file" ;;
  --replay-inputs) options="$options -replay-all -replay" ;;
  --record-inputs) options="$options -record-next -enable-pad-debug-controls" ;;
  --video-mode)
    video_mode=$2
    shift
    ;;
  --no-scanlines)
    mode1="-filter 1 -magfilter 1"
    ;;
  --no-smooth)
    mode1="-filter 2 -magfilter 3"
    ;;
  --smooth43)
    mode2="-filter 1 -magfilter 1"
    ;;
  --rollback-mode)
    case "$2" in
    record) options="$options -rollback-mode 1" ;;
    replay) options="$options -rollback-mode 2" ;;
    esac
    options="$options --rollback-ui /usr/share/canoe/rollback-ui"
    options="-rollback-snapshot-period 720 $options"
    options="$options --enable-sram-file-hash"
    shift
    ;;
  --rollback-output-dir) options="$options -rollback-output-dir $2"; shift ;;
  --rollback-input-dir) options="$options -rollback-input-dir $2"; shift ;;
  --decorative-frame-path) options="$options --use-decorative-frame $2 $(decorative_options $2)"; shift ;;
  -retroarch) retroarch=1 ;;
  --retroarch) retroarch=1 ;;
  --core) core=$2; shift ;;
  -core) core=$2; shift ;;
  *.sfrom)
    if [ -f "$1.gz" ]; then
        options="$options /tmp/ROM.sfrom"
        gunzip -c "$1.gz" > /tmp/ROM.sfrom
        filename=/tmp/ROM.sfrom
    else
        options="$options $1"
        filename=$1
    fi
    ;;
  *) options="$options $1" ;;
  esac
  shift
done

case "$video_mode" in
  keep-aspect-ratio) options="$options $mode2" ;;
  pixel-perfect) options="$options $mode3" ;;
  crt-filter) options="$options $mode1" ;;
esac

read BUILD_TYPE < /etc/clover/buildtype
case "$BUILD_TYPE" in
devel) log="-log $title_code.log -log-append --debug-menu-settings /var/lib/clover/canoe/debug-menu.json --decorative-frames-path /usr/share/backgrounds" ;;
test) log="-log $title_code.log" ;;
*) ;;
esac

# Hold up to forcely disable RetroArch
[ -e "$clovercon_file" ] && [ "$(cat $clovercon_file)" == "1000" ] && retroarch=0
# Hold down to forcely enable RetroArch
[ -e "$clovercon_file" ] && [ "$(cat $clovercon_file)" == "2000" ] && retroarch=1

if [ "$retroarch" == "0" ]; then
  exec canoe-shvc $options $log
else
  [ -z "$core" ] && exec snes $filename $args
  [ -z "$core" ] || exec retroarch-clover $core $filename $args
fi