Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypseus: Simplify multigame zipped ROM + add dependencies for (v2.11.4) #3974

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 20 additions & 9 deletions scriptmodules/emulators/hypseus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rp_module_section="exp"
rp_module_flags="sdl2"

function depends_hypseus() {
getDepends libvorbis-dev libogg-dev zlib1g-dev libzip-dev libmpeg2-4-dev libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev cmake
getDepends libvorbis-dev libogg-dev zlib1g-dev libzip-dev libmpeg2-4-dev libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev cmake
}

function sources_hypseus() {
Expand All @@ -40,6 +40,7 @@ function build_hypseus() {
function install_hypseus() {
md_ret_files=(
'sound'
'midi'
'pics'
'fonts'
'hypseus.bin'
Expand All @@ -52,7 +53,7 @@ function configure_hypseus() {
mkRomDir "daphne/roms"

addEmulator 0 "$md_id" "daphne" "$md_inst/hypseus.sh %ROM%"
addSystem "daphne"
addSystem "daphne" "Hypseus" ".zlua"

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

Expand All @@ -78,17 +79,27 @@ function configure_hypseus() {
cat >"$md_inst/hypseus.sh" <<_EOF_
#!/bin/bash
dir="\$1"
name="\${dir##*/}"
name="\${name%.*}"
path=\$(dirname "\$dir")
name=\$(basename "\${dir%.*}")
ext="\${dir##*.}"

if [[ "\$ext" == "zlua" ]]; then
parent=\$(awk '{\$1=\$1; print}' < "\$1")
dir="\$path/\$parent"
parent="\${parent##*/}"
params="-usealt \$name"
else
parent="\$name"
fi

if [[ -f "\$dir/\$name.commands" ]]; then
params=\$(<"\$dir/\$name.commands")
params="\${params:+\$params }\$(<"\$dir/\$name.commands")"
fi

if [[ -f "\$dir/\$name.singe" ]]; then
singerom="\$dir/\$name.singe"
elif [[ -f "\$dir/\$name.zip" ]]; then
singerom="\$dir/\$name.zip"
if [[ -f "\$dir/\$parent.singe" ]]; then
singerom="\$dir/\$parent.singe"
elif [[ -f "\$dir/\$parent.zip" ]]; then
singerom="\$dir/\$parent.zip"
fi

if [[ -n "\$singerom" ]]; then
Expand Down