From b517753a811dbb546f53d6d0e3e6e93ec7e3ef70 Mon Sep 17 00:00:00 2001 From: Alexey 'Cluster' Avdyukhin Date: Wed, 22 Feb 2017 17:12:08 +0300 Subject: Extension check --- retroarch.hmod/usr/bin/clover-kachikachi | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'retroarch.hmod') diff --git a/retroarch.hmod/usr/bin/clover-kachikachi b/retroarch.hmod/usr/bin/clover-kachikachi index 92150ae..349cd76 100755 --- a/retroarch.hmod/usr/bin/clover-kachikachi +++ b/retroarch.hmod/usr/bin/clover-kachikachi @@ -9,28 +9,30 @@ 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 +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) -for m in $supported_mappers; do - [ "$m" == "$mapper" ] && emulator=kachikachi -done -[ "$fourscreen" == "1" ] && emulator=retroarch + echo mapper: $mapper + echo four-screen: $fourscreen + + for m in $supported_mappers; do + [ "$m" == "$mapper" ] && emulator=kachikachi + done + [ "$fourscreen" == "1" ] && emulator=retroarch +fi -# 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 + +# Do not use retroarch for original qd games args="$(echo $args | sed 's/--retroarch//g')" [ "$extension" == "qd" ] && emulator=kachikachi -- cgit v1.2.3