Skip to content
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
83 changes: 83 additions & 0 deletions ports/bulletbeat/Bullet Beat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/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/bulletbeat"
GMLOADER_JSON="$GAMEDIR/gmloader.json"
TOOLDIR="$GAMEDIR/tools"

# 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"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"

# Ensure executable permissions
$ESUDO chmod +x "$GAMEDIR/gmloadernext.aarch64"
$ESUDO chmod +x "$GAMEDIR/tools/splash"

# Create saves directory
mkdir -p "$GAMEDIR/saves"

# Prepare game files and patch game
XDELTA_FILE=""

#Move Bullet Beat.exe to $GAMEDIR
if [ -f "$GAMEDIR/assets/Bullet Beat.exe" ]; then
mv "$GAMEDIR/assets/Bullet Beat.exe" "$GAMEDIR/Bullet Beat.exe"
fi

# Extract full game
if [ -f "$GAMEDIR/Bullet Beat.exe" ]; then
actual_checksum=$(md5sum "$GAMEDIR/Bullet Beat.exe" | awk '{print $1}')

if [ "$actual_checksum" = "6cc55d7d9d93f4c56d932420cb97f8cf" ]; then
"$controlfolder/7zzs.${DEVICE_ARCH}" x "$GAMEDIR/Bullet Beat.exe" -o"$GAMEDIR/assets" & pid=$!
wait $pid
XDELTA_FILE="$TOOLDIR/itch.xdelta"
else
pm_message "Error: MD5 checksum of Bullet Beat.exe does not match the expected checksum."
fi
fi

# Patch data.win and package game files
if [ -f "$GAMEDIR/assets/data.win" ]; then
# Apply the appropriate xdelta patch
$controlfolder/xdelta3 -d -s "$GAMEDIR/assets/data.win" "$XDELTA_FILE" "$GAMEDIR/assets/game.droid"
# Delete all redundant files
rm -f assets/*.{exe,dll,win,gitkeep}
mv "$GAMEDIR"/assets/*.ogg "$GAMEDIR"/saves/
# Zip all game files into game.port
zip -r -0 ./game.port ./assets/
rm -rf ./assets/
fi

# Display loading splash
if [ ! -d ./assets ]; then
$ESUDO "$GAMEDIR/tools/splash" "$GAMEDIR/splash.png" 4000 &
fi

# Assign configs and load the game
$GPTOKEYB "gmloadernext.aarch64" -c "bulletbeat.gptk" &
pm_platform_helper "$GAMEDIR/gmloadernext.aarch64"
./gmloadernext.aarch64 -c "$GMLOADER_JSON"

# Cleanup
pm_finish
16 changes: 16 additions & 0 deletions ports/bulletbeat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Notes

Special thanks to [Ternox Games](https://ternoxgames.com/) for making this wonderful game!

Source: https://ternox.itch.io/bulletbeat

## Controls

| Button | Action |
|--|--|
|D-pad / L-stick|Movement|
|A / X|Shoot|
|R1|Slow|
|Start|Pause / Menu|


Empty file.
24 changes: 24 additions & 0 deletions ports/bulletbeat/bulletbeat/bulletbeat.gptk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
back = \"
start = \"
up = \"
down = \"
left = \"
right = \"
a = \"
b = \"
x = \"
y = \"
l1 = \"
l2 = \"
l3 = \"
r1 = \"
r2 = \"
r3 = \"
left_analog_up = \"
left_analog_down = \"
left_analog_left = \"
left_analog_right = \"
right_analog_up = \"
right_analog_down = \"
right_analog_left = \"
right_analog_right = \"
Binary file added ports/bulletbeat/bulletbeat/game.port
Binary file not shown.
12 changes: 12 additions & 0 deletions ports/bulletbeat/bulletbeat/gmloader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"save_dir" : "saves",
"apk_path" : "game.port",
"show_cursor" : false,
"disable_controller" : false,
"disable_depth" : true,
"disable_extensions" : true,
"disable_rumble" : false,
"disable_texhack" : false,
"rumble_scale" : 4.0,
"force_platform" : "os_windows"
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading