Cleaner way

This commit is contained in:
Henrik Rydgård 2024-01-18 00:54:04 +01:00
parent 4fea6eeaab
commit d1fb213750

View file

@ -395,6 +395,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
ms_path = "umd0:/";
}
Path dir;
if (!PSP_CoreParameter().mountRoot.empty()) {
// We don't want to worry about .. and cwd and such.
const Path rootNorm = NormalizePath(PSP_CoreParameter().mountRoot);
@ -423,15 +424,10 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
file = filepath + "/" + file;
path = rootNorm.ToString();
pspFileSystem.SetStartingDirectory(filepath);
dir = Path(path);
} else {
pspFileSystem.SetStartingDirectory(ms_path);
}
Path dir;
if (full_path.Type() == PathType::CONTENT_URI) {
dir = full_path.NavigateUp();
} else {
dir = Path(path);
}
std::shared_ptr<IFileSystem> fs = std::shared_ptr<IFileSystem>(new DirectoryFileSystem(&pspFileSystem, dir, FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD));