Skip to content

Commit 7950f39

Browse files
authored
Merge pull request #1678 from Ganimoth/chasmal
New Port: Chasmal
2 parents dfd39e7 + 4234ad4 commit 7950f39

File tree

9 files changed

+247
-0
lines changed

9 files changed

+247
-0
lines changed

ports/chasmal/Chasmal.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
3+
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
4+
5+
if [ -d "/opt/system/Tools/PortMaster/" ]; then
6+
controlfolder="/opt/system/Tools/PortMaster"
7+
elif [ -d "/opt/tools/PortMaster/" ]; then
8+
controlfolder="/opt/tools/PortMaster"
9+
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
10+
controlfolder="$XDG_DATA_HOME/PortMaster"
11+
else
12+
controlfolder="/roms/ports/PortMaster"
13+
fi
14+
15+
source $controlfolder/control.txt
16+
17+
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
18+
19+
get_controls
20+
21+
GAMEDIR=/$directory/ports/chasmal
22+
CONFDIR="$GAMEDIR/conf/"
23+
24+
> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
25+
26+
cd $GAMEDIR
27+
28+
# Exports
29+
export PATCHER_FILE="$GAMEDIR/tools/patchscript"
30+
export PATCHER_GAME="Chasmal"
31+
export PATCHER_TIME="1-2 minutes"
32+
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
33+
34+
# Check if we need to patch the game
35+
if [ ! -f patchlog.txt ] || [ -f $GAMEDIR/gamedata/Chasmal.x86_64 ]; then
36+
if [ -f "$controlfolder/utils/patcher.txt" ]; then
37+
source "$controlfolder/utils/patcher.txt"
38+
$ESUDO kill -9 $(pidof gptokeyb)
39+
else
40+
echo "This port requires the latest version of PortMaster."
41+
fi
42+
fi
43+
44+
runtime="frt_3.6"
45+
if [ ! -f "$controlfolder/libs/${runtime}.squashfs" ]; then
46+
# Check for runtime if not downloaded via PM
47+
if [ ! -f "$controlfolder/harbourmaster" ]; then
48+
pm_message "This port requires the latest PortMaster to run, please go to https://portmaster.games/ for more info."
49+
sleep 5
50+
exit 1
51+
fi
52+
53+
$ESUDO $controlfolder/harbourmaster --quiet --no-check runtime_check "${runtime}.squashfs"
54+
fi
55+
56+
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
57+
export LD_LIBRARY_PATH="/usr/lib:$GAMEDIR/lib:$LD_LIBRARY_PATH"
58+
59+
# Setup Godot
60+
godot_dir="$HOME/godot"
61+
godot_file="$controlfolder/libs/${runtime}.squashfs"
62+
$ESUDO mkdir -p "$godot_dir"
63+
$ESUDO umount "$godot_file" || true
64+
$ESUDO mount "$godot_file" "$godot_dir"
65+
PATH="$godot_dir:$PATH"
66+
67+
export FRT_NO_EXIT_SHORTCUTS=FRT_NO_EXIT_SHORTCUTS
68+
69+
$GPTOKEYB "$runtime" -c "chasmal.gptk" &
70+
pm_platform_helper "$godot_dir/$runtime"
71+
"$runtime" $GODOT_OPTS --main-pack "gamedata/Chasmal-patched.pck"
72+
73+
if [[ "$PM_CAN_MOUNT" != "N" ]]; then
74+
$ESUDO umount "$godot_dir"
75+
fi
76+
pm_finish

ports/chasmal/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Notes
2+
3+
Thanks to Daniel MacLeod for developing this game. Check it on [Steam](https://store.steampowered.com/app/2222830/Chasmal/).
4+
5+
## Controls
6+
7+
| Button | Action |
8+
|--|--|
9+
|DPAD / Left stick|Movement|
10+
|Right stick|Aim|
11+
|Right shoulder|Shoot|
12+
|Left shoulder|Dash|
13+
|A|Interact|
14+
|B|Use An Active Item|
15+
|X|Inventory|
16+
|Y|Switch Weapons|
17+
|Start|Pause menu|
18+
19+

ports/chasmal/chasmal/chasmal.gptk

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
select = \"
2+
start = esc
3+
4+
a = e
5+
b = space
6+
x = i
7+
y = q
8+
9+
10+
l1 = \"
11+
l2 = \"
12+
l3 = \"
13+
14+
r1 = \"
15+
r2 = \"
16+
r3 = \"
17+
18+
up = w
19+
down = s
20+
left = a
21+
right = d
22+
23+
left_analog_up = \"
24+
left_analog_down = \"
25+
left_analog_left = \"
26+
left_analog_right = \"
27+
28+
right_analog_up = \"
29+
right_analog_down = \"
30+
right_analog_left = \"
31+
right_analog_right = \"

ports/chasmal/chasmal/gamedata/place the Chasmal.x86_64 here

Whitespace-only changes.
16 KB
Binary file not shown.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
3+
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
4+
5+
if [ -d "/opt/system/Tools/PortMaster/" ]; then
6+
controlfolder="/opt/system/Tools/PortMaster"
7+
elif [ -d "/opt/tools/PortMaster/" ]; then
8+
controlfolder="/opt/tools/PortMaster"
9+
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
10+
controlfolder="$XDG_DATA_HOME/PortMaster"
11+
else
12+
controlfolder="/roms/ports/PortMaster"
13+
fi
14+
15+
source $controlfolder/control.txt
16+
17+
# Set GAMEDIR to the current directory and set logfile
18+
GAMEDIR="$PWD"
19+
LOGFILE="$GAMEDIR/patchlog.txt"
20+
LOGERR="$GAMEDIR/patch_error.txt"
21+
22+
# Redirect output and error to the log file
23+
rm -rf $LOGFILE $LOGERR
24+
exec > >(tee -a "$LOGFILE") 2>&1
25+
echo "GAMEDIR is set to: $GAMEDIR"
26+
27+
# Exports
28+
export DATADIR="$GAMEDIR/gamedata"
29+
export LD_LIBRARY_PATH="/usr/lib:$GAMEDIR/lib:$GAMEDIR/tools/libs:$LD_LIBRARY_PATH"
30+
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
31+
export TOOLDIR="$GAMEDIR/tools"
32+
export PATH="$controlfolder:$GAMEDIR/tools:$PATH"
33+
34+
PYTHON=$(which python3)
35+
36+
# Permissions
37+
chmod 666 /dev/uinput
38+
39+
cd "$GAMEDIR"
40+
41+
apply_xdelta() {
42+
# Apply a patch to fix controls
43+
if [ -f "$DATADIR/Chasmal.x86_64" ]; then
44+
echo "Applying patch, please wait."
45+
$controlfolder/xdelta3 -d -s "$DATADIR/Chasmal.x86_64" "$TOOLDIR/patch.xdelta" "$DATADIR/Chasmal-patched.pck"
46+
if [ $? -eq 0 ]; then
47+
echo "Patch applied successfully"
48+
echo "$output"
49+
rm "$DATADIR/Chasmal.x86_64"
50+
else
51+
echo "Failed to apply patch"
52+
echo "$output"
53+
exit 1
54+
fi
55+
else
56+
echo "No compatible game file found to patch!"
57+
fi
58+
}
59+
60+
61+
process_game() {
62+
apply_xdelta
63+
# Final completion message
64+
echo "installation process complete!"
65+
}
66+
67+
process_game

ports/chasmal/gameinfo.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<gameList>
3+
<game>
4+
<path>./Chasmal.sh</path>
5+
<name>Chasmal</name>
6+
<desc>Chasmal is a top down action shooter with procedurally generated elements. Descend into a ruined machine using powerful items to overcome foes and reach the bottom of the depths.</desc>
7+
<releasedate>20230118T000000</releasedate>
8+
<developer>Daniel MacLeod</developer>
9+
<publisher>Daniel MacLeod</publisher>
10+
<genre>Action</genre>
11+
<image>./chasmal/screenshot.png</image>
12+
</game>
13+
</gameList>

ports/chasmal/port.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"version": 4,
3+
"name": "chasmal.zip",
4+
"items": [
5+
"Chasmal.sh",
6+
"chasmal"
7+
],
8+
"items_opt": [],
9+
"attr": {
10+
"title": "Chasmal",
11+
"porter": [
12+
"Ganimoth"
13+
],
14+
"desc": "Chasmal is a top down action shooter with procedurally generated elements. Descend into a ruined machine using powerful items to overcome foes and reach the bottom of the depths.",
15+
"desc_md": null,
16+
"inst": "Download the game on Steam and copy the Chasmal.x86_64 into the gamedata folder.",
17+
"inst_md": null,
18+
"genres": [
19+
"action"
20+
],
21+
"image": null,
22+
"rtr": false,
23+
"exp": false,
24+
"runtime": [
25+
"frt_3.6.squashfs"
26+
],
27+
"store": [
28+
{
29+
"name": "Daniel MacLeod",
30+
"gameurl": "https://store.steampowered.com/app/2222830/Chasmal/",
31+
"developerurl": "https://store.steampowered.com/search/?developer=Daniel%20MacLeod"
32+
}
33+
],
34+
"availability": "free",
35+
"reqs": [
36+
"analog_2"
37+
],
38+
"arch": [],
39+
"min_glibc": ""
40+
}
41+
}

ports/chasmal/screenshot.png

58.6 KB
Loading

0 commit comments

Comments
 (0)