Unverified Commit c5adfa17 authored by twinaphex's avatar twinaphex Committed by GitHub
Browse files

Merge pull request #166 from HakchiCloud/master

Added Hakchi (Nintendo Classics) platform and hmod packaging
parents 22124a90 58031b4a
......@@ -9,6 +9,7 @@ BACKSLASH := \$(BACKSLASH)
filter_out1 = $(filter-out $(firstword $1),$1)
filter_out2 = $(call filter_out1,$(call filter_out1,$1))
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -s),)
......@@ -28,6 +29,8 @@ else ifneq (,$(findstring armv,$(platform)))
override platform += unix
else ifneq (,$(findstring rpi,$(platform)))
override platform += unix
else ifneq (,$(findstring nintendoc,$(platform)))
override platform += unix
endif
TARGET_NAME = snes9x
......@@ -69,6 +72,10 @@ ifneq (,$(findstring unix,$(platform)))
else ifneq (,$(findstring rpi,$(platform)))
CXXFLAGS += -DARM
endif
# Nintendo Classics (Hakchi)
ifneq (,$(findstring nintendoc,$(platform)))
CXXFLAGS += -DARM -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
endif
# OS X
else ifeq ($(platform), osx)
......@@ -524,6 +531,16 @@ else
$(LD) $(fpic) $(SHARED) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(LIBS)
endif
ifneq (,$(findstring nintendoc,$(platform)))
@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) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $(OBJOUT)$@ $<
......@@ -531,5 +548,5 @@ endif
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $(OBJOUT)$@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
rm -f $(OBJECTS) $(TARGET) CORE_$(TARGET_NAME).hmod
endif
#!/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" "$@"
#!/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" "$@"
#!/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" "$@"
[ -f "$mountpoint/usr/bin/clover-canoe-shvc" ] && overmount /usr/bin/clover-canoe-shvc
-----------------------
Name: SNES9x
Creator: Libretro
Category: RetroArch Cores
-----------------------
=== SNES9x Core for RetroArch ===
Module adds support for Super Famicom / Super Nintendo
Available executables and arguments to run Core:
- /bin/snes <rom> <clover_args>
- /bin/snes16 <rom> <clover_args>
- /bin/snes9x <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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment