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

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

set -x
export MALI_NOCLEAR=1

supported_mappers="0 1 2 3 4 5 7 9 10 86 87 184"
emulator=retroarch

args=$@
filename=$1
extension=${filename##*.}

if [ "$extension" == "nes" ]; then
  header=$(hexdump -v -n 8 -e '1/1 "%02X"' "$filename")
  mapper=$((0x${header:14:1}${header:12:1}))
  fourscreen=$(expr $((0x${header:13:1})) / 8)

  echo mapper: $mapper
  echo four-screen: $fourscreen

  for m in $supported_mappers; do
    [ "$m" == "$mapper" ] && emulator=kachikachi
  done
  [ "$fourscreen" == "1" ] && emulator=retroarch
fi

[ "$extension" == "fds" ] && emulator=kachikachi

while [ $# -gt 0 ]; do
  [ "$1" == "--retroarch" ] && emulator=retroarch
  [ "$1" == "-retroarch" ] && emulator=retroarch
  [ "$1" == "--core" ] && core=$2
  [ "$1" == "-core" ] && core=$2
  shift
done

# Do not use retroarch for original qd games
args="$(echo $args | sed 's/--retroarch//g')"
[ "$extension" == "qd" ] && emulator=kachikachi

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

echo using $emulator

if [ "$emulator" == "kachikachi" ]; then
# Seems like this game will work on default emulator
exec kachikachi \
  --fullscreen \
  --sync-guest-with-host \
  --fds-initial-disk-insert-on-keypress \
  --fds-auto-disk-side-switch \
  --fds-disable-host-guest-sync-on-disk-op \
  --keep-aspect-ratio \
  $args
fi

if [ "$emulator" == "retroarch" ]; then
# Using RetroArch
	[ -z "$core" ] && exec nes $filename $args
	[ -z "$core" ] || exec retroarch-clover $core $filename $args
fi