From 81240c775578b2b86bc7ae521be048defc49a142 Mon Sep 17 00:00:00 2001 From: Alexey 'Cluster' Avdyukhin Date: Tue, 10 Oct 2017 00:49:08 +0300 Subject: Fixed bug causing exit on any button press, scanlines overlay --- .../snes9x2010.hmod/usr/bin/clover-canoe-shvc | 41 +++++++++++++++++----- 1 file changed, 33 insertions(+), 8 deletions(-) (limited to 'core_modules') diff --git a/core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc b/core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc index 6ce93c6..6d052c5 100755 --- a/core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc +++ b/core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc @@ -19,8 +19,13 @@ decorative_options() done < "$fn" } -original_options=$@ 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 @@ -30,13 +35,18 @@ while [ $# -gt 0 ] ; do --replay-inputs) options="$options -replay-all -replay" ;; --record-inputs) options="$options -record-next -enable-pad-debug-controls" ;; --video-mode) - case "$2" in - keep-aspect-ratio) options="$options -filter 1 -magfilter 3" ;; - pixel-perfect) options="$options -filter 1 --pixel-perfect" ;; - crt-filter) options="$options -filter 2 -magfilter 1" ;; - esac + 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" ;; @@ -50,7 +60,10 @@ while [ $# -gt 0 ] ; do --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" @@ -66,6 +79,12 @@ while [ $# -gt 0 ] ; do 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" ;; @@ -73,8 +92,14 @@ test) log="-log $title_code.log" ;; *) ;; esac -if [ -z "$retroarch" ]; then +# 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 - exec /bin/snes "$rom" $original_options + [ -z "$core" ] && exec snes $filename $args + [ -z "$core" ] || exec retroarch-clover $core $filename $args fi -- cgit v1.2.3