Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Port: Garden Story #810

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions ports/gardenstory/Garden Story.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/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
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
get_controls

# Variables
GAMEDIR="/$directory/ports/gardenstory"

# CD and set permissions
cd $GAMEDIR
> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1

# Exports
export LD_LIBRARY_PATH="/usr/lib:$GAMEDIR/lib:$LD_LIBRARY_PATH"

# Check if "data.win" exists and its MD5 checksum matches the specified value then apply patch
if [ -f "gamedata/data.win" ]; then
checksum=$(md5sum "gamedata/data.win" | awk '{print $1}')
if [ "$checksum" = "ad61dfb29cda512397bf34a4aa70db8a" ]; then
$ESUDO $controlfolder/xdelta3 -d -s "gamedata/data.win" -f "./patch/patch.xdelta" "gamedata/game.droid" && \
rm "gamedata/data.win"
fi
fi

# Check if there are .dat files in ./gamedata
if [ -n "$(ls ./gamedata/*.dat 2>/dev/null)" ]; then
# Move all .dat files from ./gamedata to ./assets
mkdir -p ./assets
mv ./gamedata/*.dat ./assets/ || exit 1

# Zip the contents of ./game.apk including the .dat files
zip -r -0 ./game.apk ./assets/ || exit 1
rm -Rf "$GAMEDIR/assets/" || exit 1
fi

# Display loading splash
if [ -f "$GAMEDIR/patchlog.txt" ]; then
[ "$CFW_NAME" == "muOS" ] && /tools/splash "splash.png" 1 # workaround for muOS
$ESUDO ./tools/splash "splash.png" 2000
fi

# Run the game
$GPTOKEYB "gmloadernext" &
pm_platform_helper "$GAMEDIR/gmloadernext"
./gmloadernext

# Kill processes
pm_finish
22 changes: 22 additions & 0 deletions ports/gardenstory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Notes

A thanks goes out to the following:
- [Picogram](https://www.picogram.co/) for developing this amazing game, check out the game on [Steam](https://store.steampowered.com/app/1062140/Garden_Story/).
- JanTrueno for doing the porting work
- JohnnyOnFlame for gmloader-next and TextureRepacker

## Controls

| Button | Action |
|--|--|
|D-pad/L-stick|Walk|
|A|Interact/Talk|
|B|Shield/Cancel|
|X|Inventory|
|Y|Attack|
|L|Map|
|ZL (hold)|Use Dew|
|ZR (click)|Roll|
|ZR (hold)|Dash/Run|


Binary file added ports/gardenstory/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions ports/gardenstory/gameinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<gameList>
<game>
<path>./Garden Story.sh</path>
<name>Garden Story</name>
<desc>Embark on a wholesome adventure to save The Grove! Forage resources, combat the invasive Rot, and restore the community. Relax and enjoy the fruits of your labor in this charming action-RPG starring a grape.</desc>
<releasedate>20210811T000000</releasedate>
<developer>Picogram</developer>
<publisher>Rose City Games</publisher>
<genre>Adventure</genre>
<image>./gardenstory/cover.png</image>
</game>
</gameList>
Binary file added ports/gardenstory/gardenstory/game.apk
Binary file not shown.
Empty file.
Binary file added ports/gardenstory/gardenstory/gmloadernext
Binary file not shown.
17 changes: 17 additions & 0 deletions ports/gardenstory/gardenstory/lib/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# What are those?

Those are native Android libraries meant to be loaded into the guest environment,
and the come from a [prebuilt AOSP image provided by google](https://ci.android.com/builds/branches/aosp-main/grid).

# What are these files for then?

They provide a similar-to-android implementation to all of the supported libraries,
allowing us to make less guesswork, and provide more accurate renditions of a lot
of those functionalities, specially for libc++ where a lot of guesswork was done
in the past.

OpenAL, OpenGL and libc.so are provided from the host (via thunking where needed) or
via reimplementations.

You still need a suitable GameMaker Android title/runner. You can source those from
either [freeware Android APKs](https://itch.io) or finding a [suitable runner](https://gamemaker.io/account/runtimes) for hacking.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added ports/gardenstory/gardenstory/lib/libzip.so.5
Binary file not shown.
Binary file not shown.
Binary file added ports/gardenstory/gardenstory/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions ports/gardenstory/port.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": 3,
"name": "gardenstory.zip",
"items": [
"Garden Story.sh",
"gardenstory"
],
"items_opt": [],
"attr": {
"title": "Garden Story",
"porter": [
"JanTrueno"
],
"desc": "Embark on a wholesome adventure to save The Grove! Forage resources, combat the invasive Rot, and restore the community. Relax and enjoy the fruits of your labor in this charming action-RPG starring a grape.",
"desc_md": null,
"inst": "Install port. Download the game on Steam. Copy all gamefiles to the gamedata folder.",
"inst_md": null,
"genres": [
"adventure",
"rpg"
],
"image": null,
"rtr": false,
"exp": false,
"runtime": null,
"reqs": [
"!lowres"
],
"arch": [
"aarch64"
]
}
}
Binary file added ports/gardenstory/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading