Skip to content

Commit 236e7ac

Browse files
committed
Simplify multigame zipped ROM (v2.11.3)
1 parent adaf787 commit 236e7ac

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

scriptmodules/emulators/hypseus.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function configure_hypseus() {
5252
mkRomDir "daphne/roms"
5353

5454
addEmulator 0 "$md_id" "daphne" "$md_inst/hypseus.sh %ROM%"
55-
addSystem "daphne"
55+
addSystem "daphne" "Hypseus" ".zlua"
5656

5757
[[ "$md_mode" == "remove" ]] && return
5858

@@ -78,17 +78,27 @@ function configure_hypseus() {
7878
cat >"$md_inst/hypseus.sh" <<_EOF_
7979
#!/bin/bash
8080
dir="\$1"
81-
name="\${dir##*/}"
82-
name="\${name%.*}"
81+
path=\$(dirname "\$dir")
82+
name=\$(basename "\${dir%.*}")
83+
ext="\${dir##*.}"
84+
85+
if [[ "\$ext" == "zlua" ]]; then
86+
parent=\$(awk '{\$1=\$1; print}' < "\$1")
87+
dir="\$path/\$parent"
88+
parent="\${parent##*/}"
89+
params="-usealt \$name"
90+
else
91+
parent="\$name"
92+
fi
8393
8494
if [[ -f "\$dir/\$name.commands" ]]; then
85-
params=\$(<"\$dir/\$name.commands")
95+
params="\${params:+\$params }\$(<"\$dir/\$name.commands")"
8696
fi
8797
88-
if [[ -f "\$dir/\$name.singe" ]]; then
89-
singerom="\$dir/\$name.singe"
90-
elif [[ -f "\$dir/\$name.zip" ]]; then
91-
singerom="\$dir/\$name.zip"
98+
if [[ -f "\$dir/\$parent.singe" ]]; then
99+
singerom="\$dir/\$parent.singe"
100+
elif [[ -f "\$dir/\$parent.zip" ]]; then
101+
singerom="\$dir/\$parent.zip"
92102
fi
93103
94104
if [[ -n "\$singerom" ]]; then

0 commit comments

Comments
 (0)