Skip to content

Commit 165f2f2

Browse files
committed
Added SNES9x core (1.54.1 ed5b457)
1 parent 1a325d4 commit 165f2f2

File tree

7 files changed

+166
-0
lines changed

7 files changed

+166
-0
lines changed

core_modules/snes9x.hmod/bin/snes

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
filename=$1
4+
filebase=$(basename "$filename")
5+
extension="${filebase##*.}"
6+
tmppath=/tmp/rom
7+
if [ "$extension" == "7z" ]; then
8+
mkdir -p $tmppath
9+
rm -rf $tmppath/*
10+
cd $tmppath
11+
tiny7zx x $filename
12+
filename=$tmppath/$(ls)
13+
fi
14+
15+
filebase=$(basename "$filename")
16+
extension="${filebase##*.}"
17+
if [ "$extension" == "sfrom" ]; then
18+
mkdir -p $tmppath
19+
rm -f $tmppath/*.7z
20+
rm -f $tmppath/*.bin
21+
dd if="$filename" of="$tmppath/$filebase.bin" bs=48 skip=1
22+
filename=$tmppath/$filebase.bin
23+
fi
24+
shift
25+
26+
exec retroarch-clover snes9x "$filename" "$@"
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
display_name = "SNES / Super Famicom (Snes9x)"
2+
authors = "Snes9x Team"
3+
supported_extensions = "smc|sfc|swc|fig"
4+
corename = "Snes9x"
5+
manufacturer = "Nintendo"
6+
categories = "Emulator"
7+
systemname = "Super Nintendo Entertainment System"
8+
database = "Nintendo - Super Nintendo Entertainment System|Nintendo - Super Nintendo Entertainment System Hacks|Nintendo - Sufami Turbo"
9+
license = "Non-commercial"
10+
permissions = ""
11+
display_version = "1.53"
12+
supports_no_game = "false"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ -f "$mountpoint/usr/bin/clover-canoe-shvc" ] && overmount /usr/bin/clover-canoe-shvc

core_modules/snes9x.hmod/install

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
transfer_default
2+
chmod +x $rootfs/bin/*
3+
chmod +x $rootfs/usr/bin/*
4+
return 1

core_modules/snes9x.hmod/readme.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== SNES9x core for RetroArch ===
2+
3+
This module will add support for Super Famicom / Super Nintendo games to RetroArch
4+
Due to some bug in the core savestates do not work properly.
5+
6+
Available executables and arguments:
7+
- /bin/snes <rom> <clover_args>
8+
runs "snes9x" core
9+
10+
For SNES Classic Mini users:
11+
please note that you can also add "--retroarch" argument to "clover-canoe-shvc" to use RetroArch instead of original emulator. Use it for problem games.
12+
13+
Core by libretro
14+
Module by pcm
15+
Hakchi module system by madmonkey
16+
NES Mini shell integration by Cluster
17+
(c) 2016-2017
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/bin/sh
2+
3+
set -x
4+
5+
export MALI_NOCLEAR=1
6+
7+
decorative_options()
8+
{
9+
local fn="$1_options.txt"
10+
if [ ! -f "$fn" ] ; then
11+
return
12+
fi
13+
while read option ; do
14+
case "$option" in
15+
hue) printf ' --decorative-frame-hue';;
16+
luminosity) printf ' --decorative-frame-luminosity';;
17+
saturation) printf ' --decorative-frame-saturation';;
18+
esac
19+
done < "$fn"
20+
}
21+
22+
args=$@
23+
options=""
24+
retroarch=0
25+
clovercon_file=/dev/clovercon1
26+
video_mode=keep-aspect-ratio
27+
mode1="-filter 2 -magfilter 1"
28+
mode2="-filter 1 -magfilter 3"
29+
mode3="-filter 1 --pixel-perfect"
30+
31+
while [ $# -gt 0 ] ; do
32+
case "$1" in
33+
--title-code) title_code="$2"; shift ;;
34+
--load-state-file) options="$options -resume" ;;
35+
--save-data-backing-file) options="$options --sram-file" ;;
36+
--replay-inputs) options="$options -replay-all -replay" ;;
37+
--record-inputs) options="$options -record-next -enable-pad-debug-controls" ;;
38+
--video-mode)
39+
video_mode=$2
40+
shift
41+
;;
42+
--no-scanlines)
43+
mode1="-filter 1 -magfilter 1"
44+
;;
45+
--no-smooth)
46+
mode1="-filter 2 -magfilter 3"
47+
;;
48+
--smooth43)
49+
mode2="-filter 1 -magfilter 1"
50+
;;
51+
--rollback-mode)
52+
case "$2" in
53+
record) options="$options -rollback-mode 1" ;;
54+
replay) options="$options -rollback-mode 2" ;;
55+
esac
56+
options="$options --rollback-ui /usr/share/canoe/rollback-ui"
57+
options="-rollback-snapshot-period 720 $options"
58+
options="$options --enable-sram-file-hash"
59+
shift
60+
;;
61+
--rollback-output-dir) options="$options -rollback-output-dir $2"; shift ;;
62+
--rollback-input-dir) options="$options -rollback-input-dir $2"; shift ;;
63+
--decorative-frame-path) options="$options --use-decorative-frame $2 $(decorative_options $2)"; shift ;;
64+
-retroarch) retroarch=1 ;;
65+
--retroarch) retroarch=1 ;;
66+
--core) core=$2; shift ;;
67+
-core) core=$2; shift ;;
68+
*.sfrom)
69+
if [ -f "$1.gz" ]; then
70+
options="$options /tmp/ROM.sfrom"
71+
gunzip -c "$1.gz" > /tmp/ROM.sfrom
72+
filename=/tmp/ROM.sfrom
73+
else
74+
options="$options $1"
75+
filename=$1
76+
fi
77+
;;
78+
*) options="$options $1" ;;
79+
esac
80+
shift
81+
done
82+
83+
case "$video_mode" in
84+
keep-aspect-ratio) options="$options $mode2" ;;
85+
pixel-perfect) options="$options $mode3" ;;
86+
crt-filter) options="$options $mode1" ;;
87+
esac
88+
89+
read BUILD_TYPE < /etc/clover/buildtype
90+
case "$BUILD_TYPE" in
91+
devel) log="-log $title_code.log -log-append --debug-menu-settings /var/lib/clover/canoe/debug-menu.json --decorative-frames-path /usr/share/backgrounds" ;;
92+
test) log="-log $title_code.log" ;;
93+
*) ;;
94+
esac
95+
96+
# Hold up to forcely disable RetroArch
97+
[ -e "$clovercon_file" ] && [ "$(cat $clovercon_file)" == "1000" ] && retroarch=0
98+
# Hold down to forcely enable RetroArch
99+
[ -e "$clovercon_file" ] && [ "$(cat $clovercon_file)" == "2000" ] && retroarch=1
100+
101+
if [ "$retroarch" == "0" ]; then
102+
exec canoe-shvc $options $log
103+
else
104+
[ -z "$core" ] && exec snes $filename $args
105+
[ -z "$core" ] || exec retroarch-clover $core $filename $args
106+
fi

0 commit comments

Comments
 (0)