Skip to content

RTCW and Pi5, adaptations required, Dirty Hack works. #272

Description

@frankygit

IF THIS IS NOT FILLED OUT, THE TICKET WILL BE CLOESED

Describe the bug
RTCW Sourceport under PI5 compiles with the RetroPie-Extra Module, but does not load. Dirty hack described below.

To Reproduce
Steps to reproduce the behavior:

  1. Install Retropie
  2. Install Retropie-Extra with all modules
  3. under Retropie-setup install RTWC port
  4. Install all required files into ~/roms/port/rtwc directory
  5. Launch RTCW Port (SP or MP)
    Expected behavior
    GUI should start

Screenshots

Gui does not start, when manually calling the executable following errors occur:

FS_Startup
Current search path:
/home/retropie/.wolf/main
./main/sp_rend2_shaders0.pk3 (5 files)
./main/sp_pak4.pk3 (21 files)
./main/sp_pak3.pk3 (14 files)
./main/sp_pak2.pk3 (232 files)
./main/sp_pak1.pk3 (1342 files)
./main/pak0.pk3 (4775 files)
./main

6389 files in pk3 files
execing default.cfg
execing wolfconfig.cfg
couldn't exec autoexec.cfg
Hunk_Clear: reset the hunk ok
Bypassing CD checks
----- Client Initialization -----
Couldn't read rtcwhistory.
Cmd_AddCommand: map_restart already defined
----- Initializing Renderer ----
---- Renderer Initialization Complete ----
RTCWKEY found.
----- Client Initialization Complete -----
----- R_Init -----
SDL version 2.32.10
SDL using driver "x11"
Initializing OpenGL display
Display aspect: 1.778
...setting mode 3: 640 480
tty]libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable                                                                                                  Couldn't get a visual
...WARNING: could not set the given mode (3)
----- Client Shutdown (Client fatal crashed: GLimp_Init() - could not load OpenGL subsystem) -----
RE_Shutdown( 1 )
Hunk_Clear: reset the hunk ok
-----------------------
GLimp_Init() - could not load OpenGL subsystem

Device (please complete the following information):

  • What model: Pi5
  • OS: Raspberry Pi OS, latest Retro-Pie and Retropie-Extra
  • Version Bookworm, Arm64

Additional context
I realized that an ARM, not an ARCH64 binary is compiled. Changing the target to ARCH64 in the script compiled an arch64 binary, however the problem persisted.
When removing the compiler switches and when also forcing the script to copy also the render libraries (not only limiting this to the x86 platform), a working arch64 installation was created.
No issues were found after playing multiplayer and singleplayer, everything runs very smoothly.

The script creates a working RTWC installation for my setup but it is a dirty hack and needs further adaptations to create working modules under different architectures. I hope this may help you to make the necessary adaptions (I am not a programmer).


#!/usr/bin/env bash

# This file is part of RetroPie-Extra, a supplement to RetroPie.
# For more information, please visit:
#
# https://github.com/RetroPie/RetroPie-Setup
# https://github.com/Exarkuniv/RetroPie-Extra
#
# See the LICENSE file distributed with this source and at
# https://raw.githubusercontent.com/Exarkuniv/RetroPie-Extra/master/LICENSE
#

rp_module_id="rtcw"
rp_module_desc="RTCW - IORTCW source port of Return to Castle Wolfenstein."
rp_module_licence="GPL3 https://raw.githubusercontent.com/iortcw/iortcw/master/SP/COPYING.txt"
rp_module_help="IORTCW requires the pak files of the full game to play. Add all your singleplayer and multiplayer pak files (mp_bin.pk3, mp_pak0.pk3, mp_pak1.pk3, mp_pak2.pk3, mp_pak3.pk3, mp_pak4.pk3, mp_pak5.pk3, mp_pakmaps0.pk3, mp_pakmaps1.pk3, mp_pakmaps2.pk3, mp_pakmaps3.pk3, mp_pakmaps4.pk3, mp_pakmaps5.pk3, mp_pakmaps6.pk3, pak0.pk3, sp_pak1.pk3, sp_pak2.pk3, sp_pak3.pk3 and sp_pak4.pk3) from your RTCW installation to $romdir/ports/rtcw."
rp_module_repo="git https://github.com/iortcw/iortcw.git master"
rp_module_section="exp"
rp_module_flags=""

function _arch_rtcw() {
    # exact parsing from Makefile
    if isPlatform "rpi5"; then
        echo arch64
    else
        echo "$(uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')"
   fi
}

function depends_rtcw() {
    local depends=(cmake libsdl2-dev libsdl2-net-dev libsdl2-mixer-dev libsdl2-image-dev timidity freepats)

    if compareVersions "$__os_debian_ver" lt 10; then
        depends+=(libgles1-mesa-dev)
    fi

    getDepends "${depends[@]}"
}

function sources_rtcw() {
    gitPullOrClone
}

function build_rtcw() {
    cd "$md_build/SP"

    # Use Case switch to allow future expansion to other potential platforms
    if isPlatform "rpi"; then
            ARCH=arch64\
            PLATFORM=linux\
            COMPILE_ARCH=arch64\
            COMPILE_PLATFORM=linux\
            make
    else
        make
    fi

    cd "$md_build/MP"

    if isPlatform "rpi"; then
            ARCH=arch64\
            PLATFORM=linux\
            COMPILE_ARCH=arch64\
            COMPILE_PLATFORM=linux\
            make
    else
        make
    fi

    md_ret_require="$md_build/SP"
    md_ret_require="$md_build/MP"
}

function install_rtcw() {
    md_ret_files=(
        "SP/build/release-linux-$(_arch_rtcw)/iowolfsp.$(_arch_rtcw)"
        "SP/build/release-linux-$(_arch_rtcw)/main/cgame.sp.$(_arch_rtcw).so"
        "SP/build/release-linux-$(_arch_rtcw)/main/qagame.sp.$(_arch_rtcw).so"
        "SP/build/release-linux-$(_arch_rtcw)/main/ui.sp.$(_arch_rtcw).so"
        "MP/build/release-linux-$(_arch_rtcw)/iowolfded.$(_arch_rtcw)"
        "MP/build/release-linux-$(_arch_rtcw)/iowolfmp.$(_arch_rtcw)"
        "MP/build/release-linux-$(_arch_rtcw)/main/cgame.mp.$(_arch_rtcw).so"
        "MP/build/release-linux-$(_arch_rtcw)/main/qagame.mp.$(_arch_rtcw).so"
        "MP/build/release-linux-$(_arch_rtcw)/main/ui.mp.$(_arch_rtcw).so"
        "MP/build/release-linux-$(_arch_rtcw)/main/vm/"
        "SP/build/release-linux-$(_arch_rtcw)/renderer_sp_opengl1_$(_arch_rtcw).so"
        "SP/build/release-linux-$(_arch_rtcw)/renderer_sp_rend2_$(_arch_rtcw).so"
        "MP/build/release-linux-$(_arch_rtcw)/renderer_mp_opengl1_$(_arch_rtcw).so"
        "MP/build/release-linux-$(_arch_rtcw)/renderer_mp_rend2_$(_arch_rtcw).so"
    )

    if isPlatform "x86"; then
        md_ret_files+=(

        )
    fi
}

function game_data_rtcw() {
    mkdir "$home/.wolf/main"
    mv /opt/retropie/ports/rtcw/[^render*]*.so /opt/retropie/ports/rtcw/main
    mv /opt/retropie/ports/rtcw/vm /opt/retropie/ports/rtcw/main
    cp "$md_data/wolfconfig.cfg" "$home/.wolf/main"
    cp "$md_data/wolfconfig_mp.cfg" "$home/.wolf/main"
    chown -R $user:$user "$romdir/ports/rtcw"
    chown -R $user:$user "$md_conf_root/rtcw-sp"
}

function configure_rtcw() {
    if [[ -d "$home/RetroPie/roms/ports/rtcw/vm" ]]; then
        rm -R "$home/RetroPie/roms/ports/rtcw/vm"
    fi

    addPort "rtcw-sp" "rtcw-sp" "Return to Castle Wolfenstein (SP)" "$md_inst/iowolfsp.$(_arch_rtcw)"
    addPort "rtcw-mp" "rtcw-mp" "Return to Castle Wolfenstein (MP)" "$md_inst/iowolfmp.$(_arch_rtcw)"

    mkRomDir "ports/rtcw"

    moveConfigDir "$home/.wolf" "$md_conf_root/rtcw-sp"
    moveConfigDir "$md_inst/main" "$romdir/ports/rtcw"

    [[ "$md_mode" == "install" ]] && game_data_rtcw
}
function remove_rtcw() {
    rm "$home/.wolf"
    rm "$home/RetroPie/roms/ports/rtcw/*.so"
    rm -R "$home/RetroPie/roms/ports/rtcw/vm"
}

Thanks a lot for maintaining all the scripts - I have already used several ones in the last few days and this collection was a key driver for me to play around with Retropie.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions