From 2c01bc80d0e4e69486447ab22c774ec7ece55df8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 7 Jun 2017 18:52:46 -0700 Subject: [PATCH] Core: Set cwd for non-ms0:/ games on boot. This isn't ideal (games should be in ms0:/PSP/GAME/), but it gives a better chance of games working than not setting a cwd at all. Fixes #9785. --- Core/PSPLoaders.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index 3dd9b76492..64577f4e1b 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -289,8 +289,9 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { if (pos != std::string::npos) { ms_path = "ms0:" + path.substr(pos); } else { - // Hmm.. - ms_path = "umd0:"; + // This is wrong, but it's better than not having a working directory at all. + // Note that umd0:/ is actually the writable containing directory, in this case. + ms_path = "umd0:/"; } #ifdef _WIN32 @@ -314,9 +315,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { path = rootNorm + "/"; pspFileSystem.SetStartingDirectory(filepath); } else { - if (pos != std::string::npos) { - pspFileSystem.SetStartingDirectory(ms_path); - } + pspFileSystem.SetStartingDirectory(ms_path); } DirectoryFileSystem *fs = new DirectoryFileSystem(&pspFileSystem, path);