Skip to content

Commit

Permalink
Merge pull request #990 from Fraxinus88/mezzer
Browse files Browse the repository at this point in the history
New Port Mezzer
  • Loading branch information
Cebion authored Dec 6, 2024
2 parents 4e7fa94 + 30ec8c3 commit 5924260
Show file tree
Hide file tree
Showing 21 changed files with 655 additions and 0 deletions.
115 changes: 115 additions & 0 deletions ports/mezzer/MEZZER.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/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
export PORT_32BIT="Y"

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


GAMEDIR="/$directory/ports/mezzer"

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

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

# Permissions
$ESUDO chmod +x "$GAMEDIR/gmloader"

# check if we have new enough version of PortMaster that contains xdelta3
if [ ! -f "$controlfolder/xdelta3" ]; then
pm_message "This port requires the latest PortMaster to run, please go to https://portmaster.games/ for more info." > /dev/tty0
sleep 5
exit 1
fi

# Patch game
cd "$GAMEDIR"

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

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

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

# Wait for the extraction process to complete
wait $pid

# Check if Mezzer.exe file exists
if [ -f "$GAMEDIR/gamedata/Mezzer.exe" ]; then
# Delete the files
rm -f "$GAMEDIR/gamedata/Mezzer.exe"
rm -f "$GAMEDIR/gamedata/D3DX9_43.dll"
rm -f "$GAMEDIR/Mezzer.exe"
fi
else
pm_message "Error: MD5 checksum of Mezzer.exe does not match the expected checksum."
exit 1
fi
else
pm_message "Mezzer.exe not detected in /mezzer"
fi

# If "gamedata/data.win" exists and matches the checksum steam version
if [ -f "./gamedata/data.win" ]; then
checksum=$(md5sum "./gamedata/data.win" | awk '{print $1}')
# Checksum for the data.win
if [ "$checksum" = "02cbf4cf97b55391e3c6105cfd70fa11" ]; then
pm_message "data.win is being patched..." && \
$ESUDO $controlfolder/xdelta3 -d -s gamedata/data.win -f ./patch/mezzer.xdelta gamedata/game.droid && \
rm gamedata/data.win
else
pm_message "Error: MD5 checksum of data.win does not match any expected version."
exit 1
fi
else
pm_message "data.win not in gamedata folder or game has been patched."
fi

# Check if there are any .ogg files in the ./gamedata directory
if [ -n "$(ls ./gamedata/*.ogg 2>/dev/null)" ]; then
# Create the ./assets directory if it doesn't exist
mkdir -p ./assets

# Move all .ogg files from ./gamedata to ./assets
mv ./gamedata/*.ogg ./assets/ 2>/dev/null
pm_message "Moved .ogg files from ./gamedata to ./assets/"

# Zip the contents of ./mezzer.apk including the new audio files
zip -r -0 ./mezzer.apk ./assets/
pm_message "Zipped contents to ./mezzer.apk"

# Remove the assets directory
rm -Rf ./assets/
fi

$GPTOKEYB "gmloader" &

$ESUDO chmod +x "$GAMEDIR/gmloader"
pm_platform_helper "$GAMEDIR/gmloader"
./gmloader mezzer.apk

pm_finish
printf "\033c" > /dev/tty0
18 changes: 18 additions & 0 deletions ports/mezzer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Notes

Special thanks to [Daniel Davis](https://danieldavis.itch.io/) for making this awesome game!

Source: https://danieldavis.itch.io/mezzer

## Controls

| Button | Action |
|--|--|
|L-stick / D-pad|Movement|
|A|Jump|
|B|Parry|
|X|Parry|
|Y|Throw|
|Start|Pause / Menu|


Binary file added ports/mezzer/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/mezzer/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>./MEZZER.sh</path>
<name>MEZZER</name>
<desc>MEZZER is a brutal and bloody game about slicing your foes in half.</desc>
<releasedate>20190607T000000</releasedate>
<developer>Daniel Davis</developer>
<publisher>Daniel Davis</publisher>
<genre>Action</genre>
<image>./mezzer/cover.png</image>
</game>
</gameList>
Empty file.
Binary file added ports/mezzer/mezzer/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/mezzer/mezzer/gmloader
Binary file not shown.
Binary file added ports/mezzer/mezzer/libc++_shared.so
Binary file not shown.
Binary file added ports/mezzer/mezzer/libs/libcrypto.so.1.1
Binary file not shown.
Binary file added ports/mezzer/mezzer/libs/libssl.so.1.1
Binary file not shown.
Binary file added ports/mezzer/mezzer/libs/libzip.so.4
Binary file not shown.
144 changes: 144 additions & 0 deletions ports/mezzer/mezzer/license/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.

--
Loading

0 comments on commit 5924260

Please sign in to comment.