Skip to content

Commit

Permalink
runcommand: add more parameters for RetroArch
Browse files Browse the repository at this point in the history
Added 2 new parameters for the runtime-generated `retroarch.cfg`:

* `libretro_log_level` will add more debug messages from the libretro core, in addition to the frontend debugging messages.
   Cand be useful to diagnose core issues, since `--verbose` activates just the frontend logging.

* `libretro_directory` is set to the core file folder (i.e. `/opt/retropie/libretrocores/lr-<core>`).
   It is used by during netplay, as a client, when RetroArch attempts to re-load the core used during netplay.
   Basically, when connecting to a remote netplay host, RetroArch will try to locate a `core.info` file and then try to re-load the core file. If any of them is missing, the connection fails with "Couldn't find a suitable core or content file".

   The netplay issue was reported and diagnosed in RetroPie#3161. Rather than symlink each installed libretro core to `$HOME/.config/retroarch/cores` (the default value for `libretro_directory`), we'll just set it at runtime with the above parameter. We still need to add the `.info` files for the installed cores, but that's a separate patch.
  • Loading branch information
cmitu committed Jun 13, 2022
1 parent b201274 commit 458fb69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scriptmodules/supplementary/runcommand/runcommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,14 @@ function retroarch_append_config() {
iniSet "video_fullscreen_y" "${dim[1]}"
fi
# set `libretro_directory` to the core parent folder
local core_dir=$(echo "$COMMAND" | grep -Eo " $ROOTDIR/libretrocores/.*libretro\.so " | head -n 1)
core_dir=$(dirname "$core_dir")
[[ -n "$core_dir" ]] && iniSet "libretro_directory" "$core_dir"
# if verbose logging s on, set the libretro core logging to INFO
[[ $COMMAND =~ "--verbose" ]] && iniSet "libretro_log_level" "1"
# if the ROM has a custom configuration then append that too
if [[ -f "$ROM.cfg" ]]; then
conf+="'|'\"$ROM.cfg\""
Expand Down

0 comments on commit 458fb69

Please sign in to comment.