diff --git a/ports/spookynakki/README.md b/ports/spookynakki/README.md new file mode 100644 index 0000000000..fbf354e02a --- /dev/null +++ b/ports/spookynakki/README.md @@ -0,0 +1,29 @@ +## Notes + +* The game is Ready to run ! +* Get more details about the game and its authors on [itch.io](https://team-bugulon.itch.io/spookynakki) +* A/B and X/Y buttons are swapped by default. You can disable this swapping by removing the `swapabxy.txt` file in the `spookynakki` folder. If you want to re-enable it, simply put back a `swapabxy.txt` file in the `spookynakki` folder. + +## Controls + +| Button | Action | +|--|--| +|Dpad / Left Stick|Movement| +|B|Jump / Validate in the menu| +|Y|Grab / Throw| +|Option / Start|Pause| + + +* Hold Up or Down to aim your throw. +* Throw a tile downwards in mid-air for a boost! + +## Acknowledgments + +A special thank you to [Team Bugulon](https://team-bugulon.itch.io/) for making this spOOky platformer game and allowing us to distribute it Ready to run ! + +We cannot forget to thank warmly our fellow testers from the PortMaster Discord <3 + +And finaly a big thanks to: +* JohnnyOnFlame for making GMLoaderNext +* nate for the custom loading splash engine +* Slobters for making this beautiful cover for the port with [GIMP](https://www.gimp.org/). \ No newline at end of file diff --git a/ports/spookynakki/Spookynakki.sh b/ports/spookynakki/Spookynakki.sh new file mode 100755 index 0000000000..7333dafc77 --- /dev/null +++ b/ports/spookynakki/Spookynakki.sh @@ -0,0 +1,74 @@ +#!/bin/bash +XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} + +if [ -d "/opt/system/Tools/PortMaster/" ]; then + controlfolder="/opt/system/Tools/PortMaster" +elif [ -d "/opt/tools/PortMaster/" ]; then + controlfolder="/opt/tools/PortMaster" +elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then + controlfolder="$XDG_DATA_HOME/PortMaster" +else + controlfolder="/roms/ports/PortMaster" +fi + +source $controlfolder/control.txt +source $controlfolder/device_info.txt + +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" +get_controls + +$ESUDO chmod 666 /dev/tty0 + +GAMEDIR="/$directory/ports/spookynakki" +TOOLDIR="$GAMEDIR/tools" + +export LD_LIBRARY_PATH="/usr/lib32:$GAMEDIR/libs:$LD_LIBRARY_PATH" +export PATH="$TOOLDIR:$PATH" +export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" +export GMLOADER_DEPTH_DISABLE=1 +export GMLOADER_SAVEDIR="$GAMEDIR/gamedata/" +export GMLOADER_PLATFORM="os_linux" + +cd $GAMEDIR + +# We log the execution of the script into log.txt +"$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 + +# Functions BEGIN +swapabxy() { + # Update SDL_GAMECONTROLLERCONFIG to swap a/b and x/y button + + if [ "$CFW_NAME" == "knulli" ] && [ -f "$SDL_GAMECONTROLLERCONFIG_FILE" ];then + # Knulli seems to use SDL_GAMECONTROLLERCONFIG_FILE (on rg40xxh at least) + cat "$SDL_GAMECONTROLLERCONFIG_FILE" | swapabxy.py > "$GAMEDIR/gamecontrollerdb_swapped.txt" + export SDL_GAMECONTROLLERCONFIG_FILE="$GAMEDIR/gamecontrollerdb_swapped.txt" + else + # Other CFW use SDL_GAMECONTROLLERCONFIG + export SDL_GAMECONTROLLERCONFIG="`echo "$SDL_GAMECONTROLLERCONFIG" | swapabxy.py`" + fi +} +# Functions END + +# Make sure uinput is accessible so we can make use of the gptokeyb controls +$ESUDO chmod 666 /dev/uinput + +# Make sure execution flags are set +$ESUDO chmod 777 "$TOOLDIR/swapabxy.py" +$ESUDO chmod 777 "$GAMEDIR/gmloadernext" + +# Swap a/b and x/y button if needed +if [ -f "$GAMEDIR/swapabxy.txt" ]; then + swapabxy +fi + +# Splash loading screen +[ "$CFW_NAME" == "muOS" ] && splash "splash.png" 1 # workaround for muOS +splash "splash.png" 10000 & + +$GPTOKEYB "gmloadernext" & + +./gmloadernext game.apk + +$ESUDO kill -9 $(pidof gptokeyb) +$ESUDO systemctl restart oga_events & +printf "\033c" > /dev/tty0 diff --git a/ports/spookynakki/cover.png b/ports/spookynakki/cover.png new file mode 100644 index 0000000000..bf8511d502 Binary files /dev/null and b/ports/spookynakki/cover.png differ diff --git a/ports/spookynakki/gameinfo.xml b/ports/spookynakki/gameinfo.xml new file mode 100644 index 0000000000..d5849b2a3f --- /dev/null +++ b/ports/spookynakki/gameinfo.xml @@ -0,0 +1,13 @@ + + + + ./Spookynakki.sh + Spookynakki + Spookynakki is the bone-chilling continuation of Grabanakki, featuring 3 new worlds, a variety of new and returning mechanics, and a completely new OST. Clear level after level of monsters, using the very blocks you stand on as your only weapon. Can you defeat every foe without falling through the shrinking foundation? Don't wait anymore and go clear the 24 spooky stages of block-throwing combat! + 20230101T000000 + Team Bugulon + Team Bugulon + Platformer + ./spookynakki/cover.png + + \ No newline at end of file diff --git a/ports/spookynakki/port.json b/ports/spookynakki/port.json new file mode 100644 index 0000000000..d7091e0ebf --- /dev/null +++ b/ports/spookynakki/port.json @@ -0,0 +1,30 @@ +{ + "version": 3, + "name": "spookynakki.zip", + "items": [ + "Spookynakki.sh", + "spookynakki" + ], + "items_opt": [], + "attr": { + "title": "Spookynakki", + "porter": [ + "kotzebuedog" + ], + "desc": "Spookynakki is the bone-chilling continuation of Grabanakki, featuring 3 new worlds, a variety of new and returning mechanics, and a completely new OST. Clear level after level of monsters, using the very blocks you stand on as your only weapon. Can you defeat every foe without falling through the shrinking foundation? Don't wait anymore and go clear the 24 spooky stages of block-throwing combat!", + "desc_md": null, + "inst": "Ready to run !", + "inst_md": null, + "genres": [ + "platformer" + ], + "image": null, + "rtr": false, + "exp": false, + "runtime": null, + "reqs": [], + "arch": [ + "aarch64" + ] + } + } \ No newline at end of file diff --git a/ports/spookynakki/screenshot.png b/ports/spookynakki/screenshot.png new file mode 100644 index 0000000000..8872c97e23 Binary files /dev/null and b/ports/spookynakki/screenshot.png differ diff --git a/ports/spookynakki/spookynakki/game.apk b/ports/spookynakki/spookynakki/game.apk new file mode 100755 index 0000000000..299e046629 Binary files /dev/null and b/ports/spookynakki/spookynakki/game.apk differ diff --git a/ports/spookynakki/spookynakki/game.droid b/ports/spookynakki/spookynakki/game.droid new file mode 100755 index 0000000000..39f1a61eb5 Binary files /dev/null and b/ports/spookynakki/spookynakki/game.droid differ diff --git a/ports/spookynakki/spookynakki/gmloadernext b/ports/spookynakki/spookynakki/gmloadernext new file mode 100755 index 0000000000..0215c1ac5a Binary files /dev/null and b/ports/spookynakki/spookynakki/gmloadernext differ diff --git a/ports/spookynakki/spookynakki/lib/arm64-v8a/libc++_shared.so b/ports/spookynakki/spookynakki/lib/arm64-v8a/libc++_shared.so new file mode 100755 index 0000000000..268934f5b3 Binary files /dev/null and b/ports/spookynakki/spookynakki/lib/arm64-v8a/libc++_shared.so differ diff --git a/ports/spookynakki/spookynakki/lib/arm64-v8a/libcompiler_rt.so b/ports/spookynakki/spookynakki/lib/arm64-v8a/libcompiler_rt.so new file mode 100755 index 0000000000..f167a0d011 Binary files /dev/null and b/ports/spookynakki/spookynakki/lib/arm64-v8a/libcompiler_rt.so differ diff --git a/ports/spookynakki/spookynakki/lib/arm64-v8a/libm.so b/ports/spookynakki/spookynakki/lib/arm64-v8a/libm.so new file mode 100755 index 0000000000..2af51edd93 Binary files /dev/null and b/ports/spookynakki/spookynakki/lib/arm64-v8a/libm.so differ diff --git a/ports/spookynakki/spookynakki/lib/armeabi-v7a/libc++_shared.so b/ports/spookynakki/spookynakki/lib/armeabi-v7a/libc++_shared.so new file mode 100755 index 0000000000..ef2f3501e8 Binary files /dev/null and b/ports/spookynakki/spookynakki/lib/armeabi-v7a/libc++_shared.so differ diff --git a/ports/spookynakki/spookynakki/lib/armeabi-v7a/libcompiler_rt.so b/ports/spookynakki/spookynakki/lib/armeabi-v7a/libcompiler_rt.so new file mode 100755 index 0000000000..8747b729b8 Binary files /dev/null and b/ports/spookynakki/spookynakki/lib/armeabi-v7a/libcompiler_rt.so differ diff --git a/ports/spookynakki/spookynakki/lib/armeabi-v7a/libm.so b/ports/spookynakki/spookynakki/lib/armeabi-v7a/libm.so new file mode 100755 index 0000000000..ad61d58bd6 Binary files /dev/null and b/ports/spookynakki/spookynakki/lib/armeabi-v7a/libm.so differ diff --git a/ports/spookynakki/spookynakki/libs/libcrypto.so.1.1 b/ports/spookynakki/spookynakki/libs/libcrypto.so.1.1 new file mode 100755 index 0000000000..faf4d9630e Binary files /dev/null and b/ports/spookynakki/spookynakki/libs/libcrypto.so.1.1 differ diff --git a/ports/spookynakki/spookynakki/libs/libopenal.so.1 b/ports/spookynakki/spookynakki/libs/libopenal.so.1 new file mode 100755 index 0000000000..2f3490e64e Binary files /dev/null and b/ports/spookynakki/spookynakki/libs/libopenal.so.1 differ diff --git a/ports/spookynakki/spookynakki/libs/libzip.so.5 b/ports/spookynakki/spookynakki/libs/libzip.so.5 new file mode 100755 index 0000000000..6733e333a5 Binary files /dev/null and b/ports/spookynakki/spookynakki/libs/libzip.so.5 differ diff --git a/ports/spookynakki/spookynakki/splash.png b/ports/spookynakki/spookynakki/splash.png new file mode 100644 index 0000000000..9e4701c45b Binary files /dev/null and b/ports/spookynakki/spookynakki/splash.png differ diff --git a/ports/spookynakki/spookynakki/swapabxy.txt b/ports/spookynakki/spookynakki/swapabxy.txt new file mode 100755 index 0000000000..75df366a5c --- /dev/null +++ b/ports/spookynakki/spookynakki/swapabxy.txt @@ -0,0 +1 @@ +Remove this file if you don't need to swap A/B and X/Y button so that the hints on the screen match your gamepad layout \ No newline at end of file diff --git a/ports/spookynakki/spookynakki/tools/splash b/ports/spookynakki/spookynakki/tools/splash new file mode 100755 index 0000000000..faee12ec05 Binary files /dev/null and b/ports/spookynakki/spookynakki/tools/splash differ diff --git a/ports/spookynakki/spookynakki/tools/swapabxy.py b/ports/spookynakki/spookynakki/tools/swapabxy.py new file mode 100755 index 0000000000..cde8ebf6c9 --- /dev/null +++ b/ports/spookynakki/spookynakki/tools/swapabxy.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +import sys + +""" + name: swapabxy tool + description: swap a/b and x/y button in SDL_GAMECONTROLLERCONFIG + author: kotzebuedog + usage: + export SDL_GAMECONTROLLERCONFIG="`echo "$SDL_GAMECONTROLLERCONFIG" | ./swapabxy.py`" + + For example: + + # nintendo layout + 19009b4d4b4800000111000000010000,retrogame_joypad,a:b1,b:b0,dpdown:b14,dpleft:b15,+lefty:+a1,-leftx:-a0,+leftx:+a0,-lefty:-a1,leftshoulder:b4,leftstick:b11,lefttrigger:b6,dpright:b16,+righty:+a3,-rightx:-a2,+rightx:+a2,-righty:-a3,rightshoulder:b5,rightstick:b12,righttrigger:b7,back:b8,start:b9,dpup:b13,x:b2,y:b3,platform:Linux, + + becomes + + # nintendo layout + 19009b4d4b4800000111000000010000,retrogame_joypad,a:b0,b:b1,dpdown:b14,dpleft:b15,+lefty:+a1,-leftx:-a0,+leftx:+a0,-lefty:-a1,leftshoulder:b4,leftstick:b11,lefttrigger:b6,dpright:b16,+righty:+a3,-rightx:-a2,+rightx:+a2,-righty:-a3,rightshoulder:b5,rightstick:b12,righttrigger:b7,back:b8,start:b9,dpup:b13,x:b3,y:b2,platform:Linux, + + +""" + +def main(): + for line in sys.stdin: + # For each line we try to split the parameter with ',' as field delimiter + + splitted_line = line.rstrip().split(',') + + # column index of the a,b,x and y fields + (a_i, b_i, x_i, y_i) = (-1, -1, -1, -1) + + # a,b,x and y gamepad configuration value (eg. "b1", "b2"...) + (a, b, x, y) = ("", "", "", "") + + # Look for a,b,x and y parameters in each field + for i,param in enumerate(splitted_line): + + # For each field split the parameter name (eg. "a") from its value (eg. "b1") + # delimiter is ":" + splitted_param = param.split(":") + + if splitted_param[0] == "a": + # we have found parameter for a + a = splitted_param[1] + a_i = i + elif splitted_param[0] == "b": + # we have found parameter for b + b = splitted_param[1] + b_i = i + elif splitted_param[0] == "x": + # we have found parameter for x + x = splitted_param[1] + x_i = i + elif splitted_param[0] == "y": + # we have found parameter for y + y = splitted_param[1] + y_i = i + + if a_i > -1 and b_i > -1: + # We have found a and b so we can swap them + splitted_line[a_i] = f"a:{b}" + splitted_line[b_i] = f"b:{a}" + if x_i > -1 and y_i > -1: + # We have found x and y so we can swap them + splitted_line[x_i] = f"x:{y}" + splitted_line[y_i] = f"y:{x}" + + # Print the reconstitued line (even we haven't updated it) + print(','.join(splitted_line)) + +if __name__ == '__main__': + main() \ No newline at end of file