Skip to content

Commit

Permalink
Merge pull request #3523 from s1eve-mcdichae1/lrppsspp-link-save-dir
Browse files Browse the repository at this point in the history
ppsspp/lr-ppsspp: (QOL) link save file dir for libretro core, and (BUG) resolve conflicts on removal
  • Loading branch information
joolswills committed May 25, 2022
2 parents 1cd60a1 + cd2a5ed commit cd93023
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
15 changes: 12 additions & 3 deletions scriptmodules/emulators/ppsspp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,19 @@ function configure_ppsspp() {
fi

mkRomDir "psp"
moveConfigDir "$home/.config/ppsspp" "$md_conf_root/psp"
mkUserDir "$md_conf_root/psp/PSP"
ln -snf "$romdir/psp" "$md_conf_root/psp/PSP/GAME"
if [[ "$md_mode" == "install" ]]; then
moveConfigDir "$home/.config/ppsspp" "$md_conf_root/psp"
mkUserDir "$md_conf_root/psp/PSP"
ln -snf "$romdir/psp" "$md_conf_root/psp/PSP/GAME"
fi

addEmulator 0 "$md_id" "psp" "pushd $md_inst; $md_inst/PPSSPPSDL ${extra_params[*]} %ROM%; popd"
addSystem "psp"

# if we are removing the last remaining psp emu - remove the symlink
if [[ "$md_mode" == "remove" ]]; then
if [[ -h "$home/.config/ppsspp" && ! -f "$md_conf_root/psp/emulators.cfg" ]]; then
rm -f "$home/.config/ppsspp"
fi
fi
}
9 changes: 8 additions & 1 deletion scriptmodules/libretrocores/lr-ppsspp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ function configure_lr-ppsspp() {
# the core needs a save file directory, use the same folder as standalone 'ppsspp'
iniConfig " = " "" "$configdir/psp/retroarch.cfg"
iniSet "savefile_directory" "$home/.config/ppsspp"
mkUserDir "$home/.config/ppsspp"
moveConfigDir "$home/.config/ppsspp" "$md_conf_root/psp"
fi

addEmulator 1 "$md_id" "psp" "$md_inst/ppsspp_libretro.so"
addSystem "psp"

# if we are removing the last remaining psp emu - remove the symlink
if [[ "$md_mode" == "remove" ]]; then
if [[ -h "$home/.config/ppsspp" && ! -f "$md_conf_root/psp/emulators.cfg" ]]; then
rm -f "$home/.config/ppsspp"
fi
fi
}

0 comments on commit cd93023

Please sign in to comment.