Skip to content

Instantly share code, notes, and snippets.

@Gemba
Created April 18, 2023 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
# 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
#
# One-time installation, _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' from https://www.oracle.com/de/java/technologies/javase/javase8u211-later-archive-downloads.html
# mkdir -p ~/RetroPie/roms/ports/edna && cd ~/RetroPie/roms/ports/edna
# Untar JDK to ~/RetroPie/roms/ports/edna/jdk1.8.0_351 (actual folder name 'jdk1.8.0_351' may differ)
# 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 in this context as it uses Unity.
# Either run innoextract v1.8 or later (v1.8 is part of Debian Bullseye, but not in Buster) on your Desktop:
# 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/. Copy this folder-tree to the Raspberry Pi.
# On the Raspberry: sudo apt install rsync , then change to the edna_original folder on the Pi.
# In edna_original run: rsync -ar data lib script Edna.jar ednaPreferen* *.txt ~/RetroPie/roms/ports/edna
#
# 3. That's it. Now run this scriptmodule. sudo ~/RetroPie-Setup/retropie_packages.sh edna
# Savegames are at: /home/pi/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 and Oracle JDK."
_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"
if [[ $md_mode == "install" ]] ; then
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
export JAVA_HOME=''
killall xinit
_EOF_
chmod +x "$md_inst/EdnaBreakout.sh"
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
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment