Skip to content

Commit cd93023

Browse files
authored
Merge pull request #3523 from s1eve-mcdichae1/lrppsspp-link-save-dir
ppsspp/lr-ppsspp: (QOL) link save file dir for libretro core, and (BUG) resolve conflicts on removal
2 parents 1cd60a1 + cd2a5ed commit cd93023

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

scriptmodules/emulators/ppsspp.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,19 @@ function configure_ppsspp() {
172172
fi
173173

174174
mkRomDir "psp"
175-
moveConfigDir "$home/.config/ppsspp" "$md_conf_root/psp"
176-
mkUserDir "$md_conf_root/psp/PSP"
177-
ln -snf "$romdir/psp" "$md_conf_root/psp/PSP/GAME"
175+
if [[ "$md_mode" == "install" ]]; then
176+
moveConfigDir "$home/.config/ppsspp" "$md_conf_root/psp"
177+
mkUserDir "$md_conf_root/psp/PSP"
178+
ln -snf "$romdir/psp" "$md_conf_root/psp/PSP/GAME"
179+
fi
178180

179181
addEmulator 0 "$md_id" "psp" "pushd $md_inst; $md_inst/PPSSPPSDL ${extra_params[*]} %ROM%; popd"
180182
addSystem "psp"
183+
184+
# if we are removing the last remaining psp emu - remove the symlink
185+
if [[ "$md_mode" == "remove" ]]; then
186+
if [[ -h "$home/.config/ppsspp" && ! -f "$md_conf_root/psp/emulators.cfg" ]]; then
187+
rm -f "$home/.config/ppsspp"
188+
fi
189+
fi
181190
}

scriptmodules/libretrocores/lr-ppsspp.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ function configure_lr-ppsspp() {
4848
# the core needs a save file directory, use the same folder as standalone 'ppsspp'
4949
iniConfig " = " "" "$configdir/psp/retroarch.cfg"
5050
iniSet "savefile_directory" "$home/.config/ppsspp"
51-
mkUserDir "$home/.config/ppsspp"
51+
moveConfigDir "$home/.config/ppsspp" "$md_conf_root/psp"
5252
fi
5353

5454
addEmulator 1 "$md_id" "psp" "$md_inst/ppsspp_libretro.so"
5555
addSystem "psp"
56+
57+
# if we are removing the last remaining psp emu - remove the symlink
58+
if [[ "$md_mode" == "remove" ]]; then
59+
if [[ -h "$home/.config/ppsspp" && ! -f "$md_conf_root/psp/emulators.cfg" ]]; then
60+
rm -f "$home/.config/ppsspp"
61+
fi
62+
fi
5663
}

0 commit comments

Comments
 (0)