blob: 9406ef0308f7258963662351b29503604016d751 (
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
|
#!/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
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
|