aboutsummaryrefslogtreecommitdiff
path: root/hakchi
diff options
context:
space:
mode:
authorRyan 'Swingflip' Hamlin2018-06-26 13:09:55 +0100
committerRyan 'Swingflip' Hamlin2018-06-26 13:09:55 +0100
commit3c5dd789610b7c488c04285bc022b218b7b31c8c (patch)
tree160bca23925afb4430c233811e0bdc72e33805d8 /hakchi
parentb83a86f02139b7aae9dc22149ebd5cbeac32faf4 (diff)
downloadsnesemu-3c5dd789610b7c488c04285bc022b218b7b31c8c.tar.gz
snesemu-3c5dd789610b7c488c04285bc022b218b7b31c8c.tar.bz2
snesemu-3c5dd789610b7c488c04285bc022b218b7b31c8c.zip
Added Hakchi Platform
Diffstat (limited to 'hakchi')
-rwxr-xr-xhakchi/bin/snes38
-rwxr-xr-xhakchi/bin/snes0538
-rw-r--r--hakchi/etc/preinit.d/pe9b0_retroarch_snes1
-rw-r--r--hakchi/readme.md23
4 files changed, 100 insertions, 0 deletions
diff --git a/hakchi/bin/snes b/hakchi/bin/snes
new file mode 100755
index 0000000..4447455
--- /dev/null
+++ b/hakchi/bin/snes
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+setFileName(){
+ filename="$(readlink -f "$1")"
+ filebase="$(basename "$filename")"
+ extension="${filebase##*.}"
+}
+
+getSfrom(){
+ local rom="$(hexdump -e '1/4 "%u"' -s8 -n4 "$1")"
+ local footer="$(hexdump -e '1/4 "%u"' -s20 -n4 "$1")"
+ local size="$(hexdump -e '1/4 "%u"' -s$((footer+1)) -n4 "$1")"
+ dd "status=none" "if=$1" "iflag=skip_bytes" "skip=$rom" "bs=$size" "count=1"
+}
+
+setFileName "$1"
+shift
+
+tmppath="/tmp/rom"
+rm -rf "$tmppath"
+mkdir -p "$tmppath"
+cd "$tmppath"
+
+if [ "$extension" = "7z" ]; then
+ tiny7zx x "$filename"
+ filename="$tmppath/$(ls | head -n1)"
+ filename_str="${filename// /_}"
+ mv "$filename" "$filename_str"
+ setFileName "$filename_str"
+fi
+
+if [ "$extension" = "sfrom" ]; then
+ filename_str="$filebase.sfc"
+ getSfrom "$filename" > "$filename_str"
+ setFileName "$filename_str"
+fi
+
+exec retroarch-clover snes9x "$filename" "$@"
diff --git a/hakchi/bin/snes05 b/hakchi/bin/snes05
new file mode 100755
index 0000000..c6da74b
--- /dev/null
+++ b/hakchi/bin/snes05
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+setFileName(){
+ filename="$(readlink -f "$1")"
+ filebase="$(basename "$filename")"
+ extension="${filebase##*.}"
+}
+
+getSfrom(){
+ local rom="$(hexdump -e '1/4 "%u"' -s8 -n4 "$1")"
+ local footer="$(hexdump -e '1/4 "%u"' -s20 -n4 "$1")"
+ local size="$(hexdump -e '1/4 "%u"' -s$((footer+1)) -n4 "$1")"
+ dd "status=none" "if=$1" "iflag=skip_bytes" "skip=$rom" "bs=$size" "count=1"
+}
+
+setFileName "$1"
+shift
+
+tmppath="/tmp/rom"
+rm -rf "$tmppath"
+mkdir -p "$tmppath"
+cd "$tmppath"
+
+if [ "$extension" = "7z" ]; then
+ tiny7zx x "$filename"
+ filename="$tmppath/$(ls | head -n1)"
+ filename_str="${filename// /_}"
+ mv "$filename" "$filename_str"
+ setFileName "$filename_str"
+fi
+
+if [ "$extension" = "sfrom" ]; then
+ filename_str="$filebase.sfc"
+ getSfrom "$filename" > "$filename_str"
+ setFileName "$filename_str"
+fi
+
+exec retroarch-clover snes9x2005 "$filename" "$@"
diff --git a/hakchi/etc/preinit.d/pe9b0_retroarch_snes b/hakchi/etc/preinit.d/pe9b0_retroarch_snes
new file mode 100644
index 0000000..82b9be4
--- /dev/null
+++ b/hakchi/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/hakchi/readme.md b/hakchi/readme.md
new file mode 100644
index 0000000..35ed3c5
--- /dev/null
+++ b/hakchi/readme.md
@@ -0,0 +1,23 @@
+-----------------------
+Name: SNES9x2005
+Creator: Libretro
+Category: RetroArch Cores
+-----------------------
+=== SNES9x2005 Core for RetroArch ===
+
+Module adds support for Super Famicom / Super Nintendo
+
+Available executables and arguments to run Core:
+- /bin/snes <rom> <clover_args>
+- /bin/snes02 <rom> <clover_args>
+
+Core by libretro
+
+Built and assembled by HakchiCloud - [Website](https://hakchiresources.com)
+
+Hakchi module system by madmonkey
+
+NES/SNES Mini shell integration by Cluster
+
+(c) 2016-2018
+