From 3c5dd789610b7c488c04285bc022b218b7b31c8c Mon Sep 17 00:00:00 2001 From: Ryan 'Swingflip' Hamlin Date: Tue, 26 Jun 2018 13:09:55 +0100 Subject: Added Hakchi Platform --- Makefile | 17 +++++++++++++- hakchi/bin/snes | 38 +++++++++++++++++++++++++++++++ hakchi/bin/snes05 | 38 +++++++++++++++++++++++++++++++ hakchi/etc/preinit.d/pe9b0_retroarch_snes | 1 + hakchi/readme.md | 23 +++++++++++++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100755 hakchi/bin/snes create mode 100755 hakchi/bin/snes05 create mode 100644 hakchi/etc/preinit.d/pe9b0_retroarch_snes create mode 100644 hakchi/readme.md diff --git a/Makefile b/Makefile index e51d126..8396886 100644 --- a/Makefile +++ b/Makefile @@ -223,6 +223,12 @@ else ifeq ($(platform), gcw0) LIBM := LOAD_FROM_MEMORY_TEST = 0 CFLAGS += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float +#Nintendo Classics (Hakchi) +else ifeq ($(platform), nintendoc) + TARGET := $(TARGET_NAME)_libretro.so + fpic := -fPIC + SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined + CFLAGS += -DARM -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard # Windows MSVC 2010 x86 else ifeq ($(platform), windows_msvc2010_x86) @@ -339,6 +345,15 @@ else LD = $(CC) endif +ifeq ($(platform),nintendoc) + @echo "** BUILDING HAKCHI HMOD PACKAGE **" + mkdir -p hakchi/etc/libretro/core/ hakchi/etc/libretro/info/ hakchi/etc/preinit.d/ + rm -f hakchi/etc/libretro/info/* + cp $(TARGET_NAME)_libretro.so hakchi/etc/libretro/core/ + cd hakchi/etc/libretro/info/; wget https://buildbot.libretro.com/assets/frontend/info/$(TARGET_NAME)_libretro.info + cd hakchi/; tar -czvf "CORE_$(TARGET_NAME).hmod" * +endif + %.o: %.cpp $(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $< @@ -360,7 +375,7 @@ else endif clean: - rm -f $(TARGET) $(OBJECTS) + rm -f $(TARGET) $(OBJECTS) hakchi/CORE_$(TARGET_NAME).hmod .PHONY: clean endif 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 +- /bin/snes02 + +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 + -- cgit v1.2.3 From 736b1d09038217ee7793f7544973cca88f373c43 Mon Sep 17 00:00:00 2001 From: Ryan 'Swingflip' Hamlin Date: Tue, 26 Jun 2018 13:11:35 +0100 Subject: derped the make. --- Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8396886..f12da07 100644 --- a/Makefile +++ b/Makefile @@ -345,15 +345,6 @@ else LD = $(CC) endif -ifeq ($(platform),nintendoc) - @echo "** BUILDING HAKCHI HMOD PACKAGE **" - mkdir -p hakchi/etc/libretro/core/ hakchi/etc/libretro/info/ hakchi/etc/preinit.d/ - rm -f hakchi/etc/libretro/info/* - cp $(TARGET_NAME)_libretro.so hakchi/etc/libretro/core/ - cd hakchi/etc/libretro/info/; wget https://buildbot.libretro.com/assets/frontend/info/$(TARGET_NAME)_libretro.info - cd hakchi/; tar -czvf "CORE_$(TARGET_NAME).hmod" * -endif - %.o: %.cpp $(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $< @@ -374,6 +365,16 @@ else $(CC) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(LIBS) endif +ifeq ($(platform),nintendoc) + @echo "** BUILDING HAKCHI HMOD PACKAGE **" + mkdir -p hakchi/etc/libretro/core/ hakchi/etc/libretro/info/ hakchi/etc/preinit.d/ + rm -f hakchi/etc/libretro/info/* + cp $(TARGET_NAME)_libretro.so hakchi/etc/libretro/core/ + cd hakchi/etc/libretro/info/; wget https://buildbot.libretro.com/assets/frontend/info/$(TARGET_NAME)_libretro.info + cd hakchi/; tar -czvf "CORE_$(TARGET_NAME).hmod" * +endif + + clean: rm -f $(TARGET) $(OBJECTS) hakchi/CORE_$(TARGET_NAME).hmod -- cgit v1.2.3 From fe2ac60ef67f03b8e4bb6caeca49653bcf803343 Mon Sep 17 00:00:00 2001 From: Ryan 'Swingflip' Hamlin Date: Tue, 26 Jun 2018 13:24:33 +0100 Subject: 3rd time lucky with the make... --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f12da07..fb4bb75 100644 --- a/Makefile +++ b/Makefile @@ -227,8 +227,8 @@ else ifeq ($(platform), gcw0) else ifeq ($(platform), nintendoc) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC - SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined - CFLAGS += -DARM -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard + SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T + CFLAGS += -fno-builtin -fno-exceptions -ffunction-sections -DARM -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard # Windows MSVC 2010 x86 else ifeq ($(platform), windows_msvc2010_x86) -- cgit v1.2.3 From b650caa89c2e269b58307f548b89a39640c76dac Mon Sep 17 00:00:00 2001 From: Ryan 'Swingflip' Hamlin Date: Tue, 26 Jun 2018 13:37:56 +0100 Subject: Fixed Typo --- hakchi/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hakchi/readme.md b/hakchi/readme.md index 35ed3c5..18bc086 100644 --- a/hakchi/readme.md +++ b/hakchi/readme.md @@ -9,7 +9,7 @@ Module adds support for Super Famicom / Super Nintendo Available executables and arguments to run Core: - /bin/snes -- /bin/snes02 +- /bin/snes05 Core by libretro -- cgit v1.2.3