diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-10-07 12:31:12 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-10-07 12:31:12 +0300 |
commit | ea523e14cc558b00c3b42ab6cabd0c54a7781f26 (patch) | |
tree | de43c32b9745624b88450b5c126dfa24eafddf63 /core_modules | |
parent | b959a62f6d28b00836efff8057f6aa4c36429eb8 (diff) |
SNES ready
Diffstat (limited to 'core_modules')
-rwxr-xr-x | core_modules/snes9x2010.hmod/bin/snes | 24 | ||||
-rwxr-xr-x | core_modules/snes9x2010.hmod/bin/snes10 | 2 | ||||
-rw-r--r-- | core_modules/snes9x2010.hmod/etc/preinit.d/pe9b0_retroarch_snes | 1 | ||||
-rwxr-xr-x | core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc | 80 |
4 files changed, 104 insertions, 3 deletions
diff --git a/core_modules/snes9x2010.hmod/bin/snes b/core_modules/snes9x2010.hmod/bin/snes index 215b4ab..f0ff36f 100755 --- a/core_modules/snes9x2010.hmod/bin/snes +++ b/core_modules/snes9x2010.hmod/bin/snes @@ -1,2 +1,24 @@ #!/bin/sh -exec retroarch-clover snes9x2010 "$@" + +filename=$1 +filebase=$(basename "$filename") +extension="${filebase##*.}" +tmppath=/tmp/rom +if [ "$extension" == "7z" ]; then + mkdir -p $tmppath + rm -rf $tmppath/* + cd $tmppath + tiny7zx x $filename + filename=$tmppath/$(ls) +fi + +filebase=$(basename "$filename") +extension="${filebase##*.}" +if [ "$extension" == "sfrom" ]; then + mkdir -p $tmppath + dd if="$filename" of="$tmppath/$filebase.bin" bs=48 skip=1 + filename=$tmppath/$filebase.bin +fi +shift + +exec retroarch-clover snes9x2010 "$filename" "$@" diff --git a/core_modules/snes9x2010.hmod/bin/snes10 b/core_modules/snes9x2010.hmod/bin/snes10 deleted file mode 100755 index 215b4ab..0000000 --- a/core_modules/snes9x2010.hmod/bin/snes10 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec retroarch-clover snes9x2010 "$@" diff --git a/core_modules/snes9x2010.hmod/etc/preinit.d/pe9b0_retroarch_snes b/core_modules/snes9x2010.hmod/etc/preinit.d/pe9b0_retroarch_snes new file mode 100644 index 0000000..82b9be4 --- /dev/null +++ b/core_modules/snes9x2010.hmod/etc/preinit.d/pe9b0_retroarch_snes @@ -0,0 +1 @@ +[ -f "$mountpoint/usr/bin/clover-canoe-shvc" ] && overmount /usr/bin/clover-canoe-shvc diff --git a/core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc b/core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc new file mode 100755 index 0000000..6ce93c6 --- /dev/null +++ b/core_modules/snes9x2010.hmod/usr/bin/clover-canoe-shvc @@ -0,0 +1,80 @@ +#!/bin/sh + +set -x + +export MALI_NOCLEAR=1 + +decorative_options() +{ + local fn="$1_options.txt" + if [ ! -f "$fn" ] ; then + return + fi + while read option ; do + case "$option" in + hue) printf ' --decorative-frame-hue';; + luminosity) printf ' --decorative-frame-luminosity';; + saturation) printf ' --decorative-frame-saturation';; + esac + done < "$fn" +} + +original_options=$@ +options="" + +while [ $# -gt 0 ] ; do + case "$1" in + --title-code) title_code="$2"; shift ;; + --load-state-file) options="$options -resume" ;; + --save-data-backing-file) options="$options --sram-file" ;; + --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 + shift + ;; + --rollback-mode) + case "$2" in + record) options="$options -rollback-mode 1" ;; + replay) options="$options -rollback-mode 2" ;; + esac + options="$options --rollback-ui /usr/share/canoe/rollback-ui" + options="-rollback-snapshot-period 720 $options" + options="$options --enable-sram-file-hash" + shift + ;; + --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 ;; + *.sfrom) + if [ -f "$1.gz" ]; then + options="$options /tmp/ROM.sfrom" + gunzip -c "$1.gz" > /tmp/ROM.sfrom + rom=/tmp/ROM.sfrom + else + options="$options $1" + rom=$1 + fi + ;; + *) options="$options $1" ;; + esac + shift +done + +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" ;; +test) log="-log $title_code.log" ;; +*) ;; +esac + +if [ -z "$retroarch" ]; then + exec canoe-shvc $options $log +else + exec /bin/snes "$rom" $original_options +fi |