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: 92150ae1f9ddedbbd94254c96d35d3f57087b54c (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
#!/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##*.}
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

# But this information is not corrent if it was FDS file or UNIF file
[ "$extension" == "fds" ] && emulator=kachikachi
[ "$extension" == "unf" ] && emulator=retroarch
[ "$extension" == "unif" ] && emulator=retroarch

while [ $# -gt 0 ]; do
  [ "$1" == "--retroarch" ] && emulator=retroarch
	[ "$1" == "--core" ] && core=$2
  shift
done
args="$(echo $args | sed 's/--retroarch//g')"
[ "$extension" == "qd" ] && emulator=kachikachi

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