Skip to content

Commit

Permalink
Merge pull request #209 from JanTrueno/Grimstorm
Browse files Browse the repository at this point in the history
New Port: Grimstorm
  • Loading branch information
kloptops authored Mar 23, 2024
2 parents 3735bee + 3bd4f7b commit 84bad4d
Show file tree
Hide file tree
Showing 13 changed files with 281 additions and 0 deletions.
82 changes: 82 additions & 0 deletions ports/grimstorm/Grimstorm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash

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

source $controlfolder/control.txt
source $controlfolder/device_info.txt
get_controls
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"

$ESUDO chmod 666 /dev/tty0

GAMEDIR="/$directory/ports/grimstorm"

export LD_LIBRARY_PATH="/usr/lib32:$GAMEDIR/libs:$GAMEDIR/utils/libs"
export GMLOADER_DEPTH_DISABLE=1
export GMLOADER_SAVEDIR="$GAMEDIR/gamedata/"

# We log the execution of the script into log.txt
exec > >(tee "$GAMEDIR/log.txt") 2>&1

cd $GAMEDIR

if [ -f "${controlfolder}/libgl_${CFWNAME}.txt" ]; then
source "${controlfolder}/libgl_${CFW_NAME}.txt"
else
source "${controlfolder}/libgl_default.txt"
fi

expected_checksum="f726cba515133d20a29a9fbcfb7e19c8"

if [ -f "$GAMEDIR/gamedata/Grimstorm1.3.2.exe" ]; then
# Calculate the MD5 checksum of Grimstorm1.3.2.exe
actual_checksum=$(md5sum "$GAMEDIR/gamedata/Grimstorm1.3.2.exe" | awk '{print $1}')

# Check if the file exists and the checksum matches
if [ "$actual_checksum" = "$expected_checksum" ]; then
# Change directory to the specified directory
cd "$GAMEDIR" || exit

# Use 7zip to extract the .exe file to the destination directory
"$GAMEDIR/patch/7zzs" x "$GAMEDIR/gamedata/Grimstorm1.3.2.exe" -o"$GAMEDIR/gamedata" & pid=$!

# Wait for the extraction process to complete
wait $pid

# Check if the Grimstorm.exe file exists
if [ -f "$GAMEDIR/gamedata/Grimstorm.exe" ]; then
# Delete the redundant .exe files
rm "$GAMEDIR/gamedata/Grimstorm.exe"
rm "$GAMEDIR/gamedata/Grimstorm1.3.2.exe"
fi
else
echo "Error: MD5 checksum of Grimstorm1.3.2.exe does not match the expected checksum."
fi
else
echo "Error: Missing files in gamedata folder!"
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
[ -f "./gamedata/game.unx" ] && mv gamedata/game.unx gamedata/game.droid

# Make sure uinput is accessible so we can make use of the gptokeyb controls
$ESUDO chmod 666 /dev/uinput

$GPTOKEYB "gmloader" &

$ESUDO chmod +x "$GAMEDIR/gmloader"

./gmloader grimstorm.apk

$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" > /dev/tty0
15 changes: 15 additions & 0 deletions ports/grimstorm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Notes

Thanks to [Nik](https://gamejolt.com/@nik) for creating this great game!

## Controls

| Button | Action |
|--|--|
|B|Jump|
|A|Slash|
|R1|Block|
|Dpad/L-Stick|Movement|
|B+R1|Smash Down|


12 changes: 12 additions & 0 deletions ports/grimstorm/gameinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<gameList>
<game>
<path>./Grimstorm.sh</path>
<name>Grimstorm</name>
<desc>A place of terror and evil, spreading its foul corruption across the Kingdom. With it's malevolent ruler causing chaos and despair, it's time he met his demise. That's where you come in, heroic adventurer. Blessed with the gift to come back from death, it's up to you to storm the castle!</desc>
<developer>Nik</developer>
<publisher>Nik</publisher>
<genre>Souls-like</genre>
<image>./grimstorm/screenshot.jpg</image>
</game>
</gameList>
144 changes: 144 additions & 0 deletions ports/grimstorm/grimstorm/LICENSE.7zzs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
7-Zip for Linux and macOS
~~~~~~~~~~~~~~~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

7-Zip Copyright (C) 1999-2024 Igor Pavlov.

The licenses for 7zz and 7zzs files are:

- The "GNU LGPL" as main license for most of the code
- The "GNU LGPL" with "unRAR license restriction" for some code
- The "BSD 3-clause License" for some code
- The "BSD 2-clause License" for some code

Redistributions in binary form must reproduce related license information from this file.

Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.


GNU LGPL information
--------------------

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/




BSD 3-clause License in 7-Zip code
----------------------------------

The "BSD 3-clause License" is used for the following code in 7z.dll
1) LZFSE data decompression.
That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
that also uses the "BSD 3-clause License".
2) ZSTD data decompression.
that code was developed using original zstd decoder code as reference code.
The original zstd decoder code was developed by Facebook Inc,
that also uses the "BSD 3-clause License".

Copyright (c) 2015-2016, Apple Inc. All rights reserved.
Copyright (c) Facebook, Inc. All rights reserved.
Copyright (c) 2023-2024 Igor Pavlov.

Text of the "BSD 3-clause License"
----------------------------------

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---




BSD 2-clause License in 7-Zip code
----------------------------------

The "BSD 2-clause License" is used for the XXH64 code in 7-Zip.

XXH64 code in 7-Zip was derived from the original XXH64 code developed by Yann Collet.

Copyright (c) 2012-2021 Yann Collet.
Copyright (c) 2023-2024 Igor Pavlov.

Text of the "BSD 2-clause License"
----------------------------------

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---




unRAR license restriction
-------------------------

The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.

The license for original unRAR code has the following restriction:

The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.

--
Binary file added ports/grimstorm/grimstorm/gamedata/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ports/grimstorm/grimstorm/gmloader
Binary file not shown.
Binary file added ports/grimstorm/grimstorm/grimstorm.apk
Binary file not shown.
Binary file added ports/grimstorm/grimstorm/libc++_shared.so
Binary file not shown.
Binary file added ports/grimstorm/grimstorm/libs/libcrypto.so.1.1
Binary file not shown.
Binary file added ports/grimstorm/grimstorm/libs/libzip.so.5
Binary file not shown.
Binary file added ports/grimstorm/grimstorm/patch/7zzs
Binary file not shown.
28 changes: 28 additions & 0 deletions ports/grimstorm/port.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"version": 2,
"name": "grimstorm.zip",
"items": [
"Grimstorm.sh",
"grimstorm"
],
"items_opt": [],
"attr": {
"title": "Grimstorm",
"porter": [
"JanTrueno"
],
"desc": "A place of terror and evil, spreading its foul corruption across the Kingdom. With it's malevolent ruler causing chaos and despair, it's time he met his demise. That's where you come in, heroic adventurer. Blessed with the gift to come back from death, it's up to you to storm the castle!",
"inst": "Download the windows version of the game here: https://gamejolt.com/games/grimstorm/59563\nPlace Grimstorm1.3.2.exe inside the gamedata folder.",
"genres": [
"action"
],
"image": null,
"rtr": false,
"exp": false,
"runtime": null,
"reqs": [],
"arch": [
"armhf"
]
}
}
Binary file added ports/grimstorm/screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 84bad4d

Please sign in to comment.