From 93f5e195f813e4f772993edfcc20acb8631a8969 Mon Sep 17 00:00:00 2001 From: David Borel Date: Mon, 29 Jan 2024 09:41:42 -0800 Subject: [PATCH 1/4] New port: OpenLara. Includes 3MB demo data. Enhanced water and lighting with OpenGL 3.1 and SDL. Tested on RPI4 with x11 and kmsdrm. For more information, see https://docs.libretro.com/library/openlara . --- scriptmodules/ports/openlara | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 scriptmodules/ports/openlara diff --git a/scriptmodules/ports/openlara b/scriptmodules/ports/openlara new file mode 100644 index 0000000000..baae4fef7c --- /dev/null +++ b/scriptmodules/ports/openlara @@ -0,0 +1,67 @@ +#!/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 +# + +rp_module_id="openlara" +rp_module_desc="OpenLara - Source port of Tomb Raider 1-5 (only 1 works)." +rp_module_licence="BSD 2-Clause https://github.com/XProger/OpenLara?tab=BSD-2-Clause-1-ov-file#readme" +rp_module_help="OpenLara requires the data from a full or demo version of Tomb Raider 1-5. For example, copy the full DATA and FMV folders from the PC CD-ROM. This script installs the PC demo." +rp_module_section="exp" +rp_module_flags="" + +function depends_openlara() { + local depends=(libsdl2-dev libsdl2-net-dev libsdl2-mixer-dev libsdl2-image-dev) + + if compareVersions "$__os_debian_ver" lt 10; then + depends+=(libgles2-mesa-dev) + fi + + getDepends "${depends[@]}" +} + +function sources_openlara() { + gitPullOrClone "$md_build" https://github.com/XProger/OpenLara.git +} + +function build_openlara() { + cd "$md_build/src/platform/sdl2" + #./build.sh + g++ -std=c++11 `sdl2-config --cflags` -O3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__SDL2__ -D_SDL2_OPENGL main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o OpenLara `sdl2-config --libs` -lGL -lm -lrt -lpthread -lasound -ludev + md_ret_require="$md_build/src/platform/sdl2" +} + +function install_openlara() { + md_ret_files=( + 'src/platform/sdl2/OpenLara' + ) +} + +function game_data_openlara() { + mkdir "$home/.openlara" + downloadAndExtract "https://raidingtheglobe.com/downloads/tomb-raider-1/5-tomb-raider-1-demo/file" "$romdir/ports/tombraider/ -j -LL + mv "$romdir/ports/tombraider/Tomb Raider 1 demo/DATA" "$romdir/ports/tombraider/" + rm -rf "$romdir/ports/tombraider/Tomb Raider 1 demo" + chown -R $user:$user "$romdir/ports/tombraider" + chown -R $user:$user "$md_conf_root/openlara" +} + +function configure_openlara() { + addPort "openlara" "openlara" "Tomb Raider" "pushd $romdir/ports/tombraider; MESA_GL_VERSION_OVERRIDE=3.1 $md_inst/OpenLara; popd" + + mkRomDir "ports/tombraider" + + moveConfigDir "$home/.openlara" "$md_conf_root/openlara" + + [[ "$md_mode" == "install" ]] && game_data_openlara +} +function remove_openlara() { + rm /home/pi/.openlara + rm /home/pi/RetroPie/roms/ports/openlara/OpenLara +} From 8c4e14fb64f66e5699bcb30b277233e5a180b54f Mon Sep 17 00:00:00 2001 From: David Borel Date: Mon, 29 Jan 2024 11:51:22 -0800 Subject: [PATCH 2/4] Don't attempt to download busted demo. Let people read the libretro docs to get set up properly. --- scriptmodules/ports/openlara | 3 --- 1 file changed, 3 deletions(-) diff --git a/scriptmodules/ports/openlara b/scriptmodules/ports/openlara index baae4fef7c..b63d9d1cf2 100644 --- a/scriptmodules/ports/openlara +++ b/scriptmodules/ports/openlara @@ -45,9 +45,6 @@ function install_openlara() { function game_data_openlara() { mkdir "$home/.openlara" - downloadAndExtract "https://raidingtheglobe.com/downloads/tomb-raider-1/5-tomb-raider-1-demo/file" "$romdir/ports/tombraider/ -j -LL - mv "$romdir/ports/tombraider/Tomb Raider 1 demo/DATA" "$romdir/ports/tombraider/" - rm -rf "$romdir/ports/tombraider/Tomb Raider 1 demo" chown -R $user:$user "$romdir/ports/tombraider" chown -R $user:$user "$md_conf_root/openlara" } From c1fe1ca55fd902622b6e1892bf07d69ecfd6814b Mon Sep 17 00:00:00 2001 From: David Borel Date: Mon, 29 Jan 2024 11:58:35 -0800 Subject: [PATCH 3/4] Removed outdated delete command. --- scriptmodules/ports/openlara | 1 - 1 file changed, 1 deletion(-) diff --git a/scriptmodules/ports/openlara b/scriptmodules/ports/openlara index b63d9d1cf2..509d740224 100644 --- a/scriptmodules/ports/openlara +++ b/scriptmodules/ports/openlara @@ -60,5 +60,4 @@ function configure_openlara() { } function remove_openlara() { rm /home/pi/.openlara - rm /home/pi/RetroPie/roms/ports/openlara/OpenLara } From af78eed1bad121dc1dc719329c00b7cf4403d164 Mon Sep 17 00:00:00 2001 From: David Borel Date: Mon, 29 Jan 2024 12:08:22 -0800 Subject: [PATCH 4/4] Rename openlara to openlara.sh --- scriptmodules/ports/{openlara => openlara.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scriptmodules/ports/{openlara => openlara.sh} (100%) diff --git a/scriptmodules/ports/openlara b/scriptmodules/ports/openlara.sh similarity index 100% rename from scriptmodules/ports/openlara rename to scriptmodules/ports/openlara.sh