Skip to content

Commit

Permalink
Android: Fix running plain PRXs on scoped storage. Minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 17, 2024
1 parent 8b5f932 commit ff12ff1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Core/FileSystems/DirectoryFileSystem.cpp
Expand Up @@ -262,16 +262,14 @@ bool DirectoryFileHandle::Open(const Path &basePath, std::string &fileName, File
return false;
}
fullName = GetLocalPath(basePath, fileName);
const char *fullNameC = fullName.c_str();

DEBUG_LOG(FILESYS, "Case may have been incorrect, second try opening %s (%s)", fullNameC, fileName.c_str());
DEBUG_LOG(FILESYS, "Case may have been incorrect, second try opening %s (%s)", fullName.c_str(), fileName.c_str());

// And try again with the correct case this time
#ifdef _WIN32
hFile = CreateFile(fullNameC, desired, sharemode, 0, openmode, 0, 0);
hFile = CreateFile(fullName.c_str(), desired, sharemode, 0, openmode, 0, 0);
success = hFile != INVALID_HANDLE_VALUE;
#else
hFile = open(fullNameC, flags, 0666);
hFile = open(fullName.c_str(), flags, 0666);
success = hFile != -1;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Core/PSPLoaders.cpp
Expand Up @@ -427,7 +427,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
pspFileSystem.SetStartingDirectory(ms_path);
}

std::shared_ptr<IFileSystem> fs = std::shared_ptr<IFileSystem>(new DirectoryFileSystem(&pspFileSystem, Path(path), FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD));
std::shared_ptr<IFileSystem> fs = std::shared_ptr<IFileSystem>(new DirectoryFileSystem(&pspFileSystem, full_path.NavigateUp(), FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD));
pspFileSystem.Mount("umd0:", fs);

std::string finalName = ms_path + file;
Expand Down

0 comments on commit ff12ff1

Please sign in to comment.