Io: Simulate VFAT bug only when simulating FAT32.

And cleanup flag handling a bit.
This commit is contained in:
Unknown W. Brackets
2020-05-21 18:57:46 -07:00
parent 51db9f0f85
commit 67416e5919
10 changed files with 34 additions and 23 deletions
+7 -3
View File
@@ -150,7 +150,7 @@ bool FixPathCase(const std::string &basePath, std::string &path, FixPathCaseBeha
#endif
DirectoryFileSystem::DirectoryFileSystem(IHandleAllocator *_hAlloc, std::string _basePath, int _flags) : basePath(_basePath), flags(_flags) {
DirectoryFileSystem::DirectoryFileSystem(IHandleAllocator *_hAlloc, std::string _basePath, FileSystemFlags _flags) : basePath(_basePath), flags(_flags) {
File::CreateFullPath(basePath);
hAlloc = _hAlloc;
}
@@ -874,7 +874,9 @@ std::vector<PSPFileInfo> DirectoryFileSystem::GetDirListing(std::string path) {
entry.size = 4096;
else
entry.size = findData.nFileSizeLow | ((u64)findData.nFileSizeHigh<<32);
entry.name = SimulateVFATBug(ConvertWStringToUTF8(findData.cFileName));
entry.name = ConvertWStringToUTF8(findData.cFileName);
if (Flags() & FileSystemFlags::SIMULATE_FAT32)
entry.name = SimulateVFATBug(entry.name);
bool hideFile = false;
if (hideISOFiles && (endsWithNoCase(entry.name, ".cso") || endsWithNoCase(entry.name, ".iso"))) {
@@ -921,7 +923,9 @@ std::vector<PSPFileInfo> DirectoryFileSystem::GetDirListing(std::string path) {
else
entry.type = FILETYPE_NORMAL;
entry.access = s.st_mode & 0x1FF;
entry.name = SimulateVFATBug(dirp->d_name);
entry.name = dirp->d_name;
if (Flags() & FileSystemFlags::SIMULATE_FAT32)
entry.name = SimulateVFATBug(entry.name);
entry.size = s.st_size;
bool hideFile = false;