diff --git a/ports/starvsthegame/README.md b/ports/starvsthegame/README.md new file mode 100644 index 0000000000..aaf74950ba --- /dev/null +++ b/ports/starvsthegame/README.md @@ -0,0 +1,16 @@ +## Notes +Thanks to Rian for creating this game and making it available for free! +https://rian-shinozaki.itch.io/star-vs-the-game + +## Controls + +|Button| Action | +|--|--| +| d-pad/l-stick| movement | +| r-stick| aim | +| a| melee | +| b/l1| dodge | +| x/r1| shoot | +| y| swap player | +| start| pause/menu | +| l2/r2| jump (platforming mode) | \ No newline at end of file diff --git a/ports/starvsthegame/Star vs the Game.sh b/ports/starvsthegame/Star vs the Game.sh new file mode 100644 index 0000000000..ae6a8be8ea --- /dev/null +++ b/ports/starvsthegame/Star vs the Game.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# Below we assign the source of the control folder (which is the PortMaster folder) based on the distro: +if [ -d "/opt/system/Tools/PortMaster/" ]; then + controlfolder="/opt/system/Tools/PortMaster" +elif [ -d "/opt/tools/PortMaster/" ]; then + controlfolder="/opt/tools/PortMaster" +else + controlfolder="/roms/ports/PortMaster" +fi + +# We source the control.txt file contents here +# The $ESUDO, $directory, $param_device and necessary +# Sdl configuration controller configurations will be sourced from the control.txt +source $controlfolder/control.txt + +# We pull the controller configs from the get_controls function from the control.txt file here +get_controls + +$ESUDO chmod 666 /dev/tty0 + +# We check on emuelec based CFWs the OS_NAME +[ -f "/etc/os-release" ] && source "/etc/os-release" + +if [ "$OS_NAME" == "JELOS" ]; then + export SPA_PLUGIN_DIR="/usr/lib32/spa-0.2" + export PIPEWIRE_MODULE_DIR="/usr/lib32/pipewire-0.3/" +fi + +GAMEDIR=/$directory/ports/starvsthegame + +# We log the execution of the script into log.txt +exec > >(tee "$GAMEDIR/log.txt") 2>&1 + +# Port specific additional libraries should be included within the port's directory in a separate subfolder named libs. +# Prioritize the armhf libs to avoid conflicts with aarch64 +export LD_LIBRARY_PATH="/usr/lib32:$GAMEDIR/libs:$GAMEDIR/utils/libs" +export GMLOADER_DEPTH_DISABLE=1 +export GMLOADER_SAVEDIR="$GAMEDIR/gamedata/" + +cd $GAMEDIR + +# If "gamedata/data.win" exists and its size is 45,445,040 bytes, apply the xdelta3 patch +if [ -f "./gamedata/data.win" ]; then + file_size=$(ls -l "./gamedata/data.win" | awk '{print $5}') + if [ "$file_size" -eq 45445040 ]; then + $ESUDO ./utils/xdelta3 -d -s gamedata/data.win -f ./patch.xdelta gamedata/data.win + fi +fi + +# Check for file existence before trying to manipulate them: +[ -f "./gamedata/data.win" ] && mv gamedata/data.win gamedata/game.droid +[ -f "./gamedata/game.win" ] && mv gamedata/game.win gamedata/game.droid + +# Check if there are .ogg files in ./gamedata +if [ -n "$(ls ./gamedata/*.ogg 2>/dev/null)" ]; then + # Move all .ogg files from ./gamedata to ./assets + mv ./gamedata/*.ogg ./assets/ + echo "Moved .ogg files from ./gamedata to ./assets/" + + # Zip the contents of ./starvsthegame.apk including the new .ogg files + zip -r ./starvsthegame.apk ./starvsthegame.apk ./assets/ + echo "Zipped contents to ./starvsthegame.apk" +fi + +# Make sure uinput is accessible so we can make use of the gptokeyb controls +$ESUDO chmod 666 /dev/uinput + +$GPTOKEYB "gmloader" -c ./starvsthegame.gptk & + +$ESUDO chmod +x "$GAMEDIR/gmloader" + +./gmloader starvsthegame.apk + +$ESUDO kill -9 $(pidof gptokeyb) +$ESUDO systemctl restart oga_events & +printf "\033c" > /dev/tty0 diff --git a/ports/starvsthegame/port.json b/ports/starvsthegame/port.json new file mode 100644 index 0000000000..909c842824 --- /dev/null +++ b/ports/starvsthegame/port.json @@ -0,0 +1,24 @@ +{ + "version": 2, + "name": "starvsthegame.zip", + "items": [ + "Star vs the Game.sh", + "starvsthegame" + ], + "items_opt": null, + "attr": { + "title": "Star vs the Game", + "porter": [ + "mattyj513" + ], + "desc": "Star vs. the Game is a cross between top-down beat-em up action and 2D platforming. Play as both Star and Marco and fight against a threat from beyond reality! The game features 7 levels with four bosses, as well as some extra content once the game is beaten. ", + "inst": "Download game from https://rian-shinozaki.itch.io/star-vs-the-game , copy data.win, audiogroup1.dat and all .ogg files to /ports/starvsthegame/gamedata", + "genres": [ + "adventure" + ], + "image": null, + "rtr": false, + "runtime": null, + "reqs": [] + } +} \ No newline at end of file diff --git a/ports/starvsthegame/screenshot.png b/ports/starvsthegame/screenshot.png new file mode 100644 index 0000000000..3af555b33c Binary files /dev/null and b/ports/starvsthegame/screenshot.png differ diff --git a/ports/starvsthegame/starvsthegame/assets/.gitkeep b/ports/starvsthegame/starvsthegame/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/starvsthegame/starvsthegame/gamedata/splash.png b/ports/starvsthegame/starvsthegame/gamedata/splash.png new file mode 100644 index 0000000000..afb25f8860 Binary files /dev/null and b/ports/starvsthegame/starvsthegame/gamedata/splash.png differ diff --git a/ports/starvsthegame/starvsthegame/gmloader b/ports/starvsthegame/starvsthegame/gmloader new file mode 100644 index 0000000000..f953f12dd3 Binary files /dev/null and b/ports/starvsthegame/starvsthegame/gmloader differ diff --git a/ports/starvsthegame/starvsthegame/libc++_shared.so b/ports/starvsthegame/starvsthegame/libc++_shared.so new file mode 100644 index 0000000000..fb45ef9052 Binary files /dev/null and b/ports/starvsthegame/starvsthegame/libc++_shared.so differ diff --git a/ports/starvsthegame/starvsthegame/libs/libzip.so.5 b/ports/starvsthegame/starvsthegame/libs/libzip.so.5 new file mode 100644 index 0000000000..0908c68657 Binary files /dev/null and b/ports/starvsthegame/starvsthegame/libs/libzip.so.5 differ diff --git a/ports/starvsthegame/starvsthegame/patch.xdelta b/ports/starvsthegame/starvsthegame/patch.xdelta new file mode 100644 index 0000000000..a9654f6f7a Binary files /dev/null and b/ports/starvsthegame/starvsthegame/patch.xdelta differ diff --git a/ports/starvsthegame/starvsthegame/starvsthegame.apk b/ports/starvsthegame/starvsthegame/starvsthegame.apk new file mode 100644 index 0000000000..65e8f563b5 Binary files /dev/null and b/ports/starvsthegame/starvsthegame/starvsthegame.apk differ diff --git a/ports/starvsthegame/starvsthegame/starvsthegame.gptk b/ports/starvsthegame/starvsthegame/starvsthegame.gptk new file mode 100644 index 0000000000..3fff9fd058 --- /dev/null +++ b/ports/starvsthegame/starvsthegame/starvsthegame.gptk @@ -0,0 +1,25 @@ +back = esc +start = enter +a = space +b = shift +x = mouse_left +y = tab +l1 = shift +l2 = w +r1 = mouse_left +r2 = w +up = w +down = s +left = a +right = d +left_analog_up = w +left_analog_down = s +left_analog_left = a +left_analog_right = d +right_analog_up = mouse_movement_up +right_analog_down = mouse_movement_down +right_analog_left = mouse_movement_left +right_analog_right = mouse_movement_right +deadzone_triggers = 3000 +mouse_scale = 3000 +mouse_delay = 8 diff --git a/ports/starvsthegame/starvsthegame/utils/libs/liblzma.so.5 b/ports/starvsthegame/starvsthegame/utils/libs/liblzma.so.5 new file mode 100644 index 0000000000..210f040d33 Binary files /dev/null and b/ports/starvsthegame/starvsthegame/utils/libs/liblzma.so.5 differ diff --git a/ports/starvsthegame/starvsthegame/utils/unzip b/ports/starvsthegame/starvsthegame/utils/unzip new file mode 100644 index 0000000000..56670f21fe Binary files /dev/null and b/ports/starvsthegame/starvsthegame/utils/unzip differ diff --git a/ports/starvsthegame/starvsthegame/utils/xdelta3 b/ports/starvsthegame/starvsthegame/utils/xdelta3 new file mode 100644 index 0000000000..813f90458b Binary files /dev/null and b/ports/starvsthegame/starvsthegame/utils/xdelta3 differ diff --git a/ports/starvsthegame/starvsthegame/utils/zip b/ports/starvsthegame/starvsthegame/utils/zip new file mode 100644 index 0000000000..16b6007efd Binary files /dev/null and b/ports/starvsthegame/starvsthegame/utils/zip differ