Skip to content

Commit 553c4fe

Browse files
committed
runcommand: add more parameters for RetroArch
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 #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.
1 parent b201274 commit 553c4fe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scriptmodules/supplementary/runcommand/runcommand.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ function main_menu() {
701701
;;
702702
L)
703703
COMMAND+=" --verbose"
704+
VERBOSE=1
704705
return 0
705706
;;
706707
U)
@@ -1101,6 +1102,14 @@ function retroarch_append_config() {
11011102
iniSet "video_fullscreen_y" "${dim[1]}"
11021103
fi
11031104
1105+
# set `libretro_directory` to the core parent folder
1106+
local core_dir=$(echo "$COMMAND" | grep -Eo " $ROOTDIR/libretrocores/.*libretro\.so " | head -n 1)
1107+
core_dir=$(dirname "$core_dir")
1108+
[[ -n "$core_dir" ]] && iniSet "libretro_directory" "$core_dir"
1109+
1110+
# if verbose logging is on, set core logging to INFO
1111+
[[ "$VERBOSE" -eq 1 ]] && iniSet "libretro_log_level" "1"
1112+
11041113
# if the ROM has a custom configuration then append that too
11051114
if [[ -f "$ROM.cfg" ]]; then
11061115
conf+="'|'\"$ROM.cfg\""

0 commit comments

Comments
 (0)