Skip to content

Instantly share code, notes, and snippets.

@Gemba
Last active May 23, 2024 05:44
Show Gist options
  • Save Gemba/665a08491748c265bad45bb5ef14a15c to your computer and use it in GitHub Desktop.
Save Gemba/665a08491748c265bad45bb5ef14a15c to your computer and use it in GitHub Desktop.
Edna & Harvey: The Breakout / Edna bricht Aus - RetroPie Scriptmodule
#!/usr/bin/env bash
# RetroPie scriptmodule for the Point and Click adventure: Edna & Harvey: The Breakout
#
# Copyright 2023 Gemba @ Githb
# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#
# Install Mini-How-To:
#
# Do these one-time installation steps, _before_ running this scriptmodule.
#
# 0. Put this scriptmodule in some ext folder (e.g: EH) at:
# ~/RetroPie-Setup/ext/EH/scriptmodules/ports/ednabreakout.sh
#
# 1. Install Oracle JDK
# - Obtain JDK for 'Linux ARM 32 Hard Float ABI', search for this string on
# the page (filename looks like jdk-8u381-linux-arm32-vfp-hflt.tar.gz):
# https://www.oracle.com/de/java/technologies/javase/javase8u211-later-archive-downloads.html
# - Exec: mkdir -p ~/RetroPie/roms/ports/edna && cd ~/RetroPie/roms/ports/edna
# - Un-tar the JDK to ~/RetroPie/roms/ports/edna/jdk1.8.0_381 (actual folder
# name 'jdk1.8.0_381' may differ depending on the then current patchlevel of
# the JDK)
# - Exec: mv jdk1.8.0_* jdk1.8.0
#
# 2. Deploy game files Get your GOG Edna and Harvey setup files.
# - Notes: Tested with GOG 1.4.2 release of Edna and Harvey (contains EH
# 1.3.1, 2018-07-31) The Anniversary Edition (2019) will not work with this
# scriptmodule as it uses Unity.
# - Either run innoextract v1.8 (or later; v1.8 is part of Debian Bullseye,
# but not in Debian Buster, which is current basis of RetroPie at the time
# of writing). On your Desktop system, execute this command:
# innoextract setup_edna__harvey_the_breakout_*.exe -I edna_original
# - Or Install the game on Windows as usual
# - In both cases search for a folder edna_original/ and ransfer that
# folder-tree to the Raspberry Pi
# - On the Raspberry, exec: sudo apt install rsync
# - Change into folder edna_original folder/ on the Pi and exec:
# rsync -ar data lib script Edna.jar ednaPreferen* *.txt ~/RetroPie/roms/ports/edna
#
# 3. That's it. Now run this scriptmodule.
# - Exec: sudo ~/RetroPie-Setup/retropie_packages.sh edna
#
# 4. Enjoy the game!
# Notes:
#
# Savegames are at: ~AppData/Local/Daedalic Entertainment/Edna/savegame
# Change language (en/de) in ~/RetroPie/roms/ports/edna/ednaPreferen.ces
rp_module_id="edna"
rp_module_desc="Module for the point and click adventure 'Edna and Harvey: The breakout'"
rp_module_licence="PROP"
rp_module_section="exp"
rp_module_flags="all"
rp_module_help="Requires manual installation of GOG game files (non-anniversary edition) and Oracle JDK. See comments in this scriptmodule for details."
_edna_romdir="$romdir/ports/edna"
function depends_edna() {
getDepends xorg liblwjgl-java libopenal1 libopenal-data pulseaudio pulseaudio-utils
}
function install_edna() {
downloadAndExtract 'http://downloads.sourceforge.net/project/java-game-lib/Official%20Releases/LWJGL%202.9.3/lwjgl-2.9.3.zip' "$md_build"
mkUserDir "$_edna_romdir"/lib
cp -p "$md_build/lwjgl-2.9.3/jar/lwjgl.jar" "$_edna_romdir"/lib
chown "$user": "$_edna_romdir"/lib/*.jar
chmod a+x "$_edna_romdir"/lib/*.jar
}
function configure_edna() {
addPort "$md_id" "edna" "Edna & Harvey: The Breakout" "XINIT:$md_inst/EdnaBreakout.sh"
[[ $md_mode != "install" ]] && return
local pulse_client_confd="/etc/pulse/client.conf.d"
# set Pulseaudio autospawn
if [[ -f "$pulse_client_confd/00-disable-autospawn.conf" ]] ; then
mv "$pulse_client_confd/00-disable-autospawn.conf" "$pulse_client_confd/00-disable-autospawn.conf.pre_edna"
fi
echo "# Allow per user autospawning of PA (triggered by openal) for Edna" > "$pulse_client_confd/00-set-autospawn.conf"
echo "autospawn=yes" >> "$pulse_client_confd/00-set-autospawn.conf"
local openal_conf="$home/.config/alsoft.conf"
if [[ -f "$openal_conf" ]] && [[ ! -f "$openal_conf.pre_edna" ]] ; then
mv "$openal_conf" "$openal_conf.pre_edna"
fi
if [[ ! -f "$openal_conf" ]] ; then
iniConfig " = " "" "$openal_conf"
echo "# for RetroPie: ports/edna" >> "$openal_conf"
iniSet "drivers" "pulse"
iniSet "rt-prio" "10"
iniSet "channels" "stereo"
iniSet "stereo-mode" "speakers"
echo "[pulse]" >> "$openal_conf"
iniSet "spawn-server" "true"
chown "$user": "$openal_conf"
fi
mkdir -p "$md_inst"
mkdir -p "$_edna_romdir"
cat >"$md_inst/EdnaBreakout.sh" << _EOF_
#! /usr/bin/env bash
xset -dpms s off s noblank
cd "$_edna_romdir"
# ALSOFT_LOGLEVEL=3 java -jar ... for openal verbose output
export JAVA_HOME="$_edna_romdir/jdk1.8.0"
\$JAVA_HOME/bin/java -jar -Xms256M -Xmx768M -Dsun.java2d.opengl=true -Djava.library.path=/usr/lib/jni/ Edna.jar
unset JAVA_HOME
killall xinit
_EOF_
chmod +x "$md_inst/EdnaBreakout.sh"
# adjust game's preferen.ces
for k in accelerated bufferStrategy fullscreen isFullscreen; do
xmlstarlet ed --inplace -u "//node[@name='edna']/map/entry[@key='$k']/@value" -v 'true' "$_edna_romdir/ednaPreferen.ces"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment