mirror of
https://github.com/libretro/pcsx2.git
synced 2024-12-12 03:56:26 +00:00
FolderMemoryCard: Be a bit more paranoid regarding metadata writes and don't allow a flush to assume that a previous flush has already written the metadata of a file.
This commit is contained in:
parent
25064e86b8
commit
5865c030cb
@ -904,6 +904,7 @@ void FolderMemoryCard::Flush() {
|
||||
}
|
||||
|
||||
m_lastAccessedFile.FlushAll();
|
||||
m_lastAccessedFile.ClearMetadataWriteState();
|
||||
m_oldDataCache.clear();
|
||||
|
||||
const u64 timeFlushEnd = wxGetLocalTimeMillis().GetValue();
|
||||
@ -1518,6 +1519,10 @@ void FileAccessHelper::FlushAll() {
|
||||
}
|
||||
}
|
||||
|
||||
void FileAccessHelper::ClearMetadataWriteState() {
|
||||
m_lastWrittenFileRef = nullptr;
|
||||
}
|
||||
|
||||
bool FileAccessHelper::CleanMemcardFilename( char* name ) {
|
||||
// invalid characters for filenames in the PS2 file system: { '/', '?', '*' }
|
||||
// the following characters are valid in a PS2 memcard file system but invalid in Windows
|
||||
|
@ -229,6 +229,9 @@ public:
|
||||
// Flush the written data of all open files to the file system
|
||||
void FlushAll();
|
||||
|
||||
// Force metadata to be written on next file access, not sure if this is necessary but it can't hurt.
|
||||
void ClearMetadataWriteState();
|
||||
|
||||
// removes characters from a PS2 file name that would be illegal in a Windows file system
|
||||
// returns true if any changes were made
|
||||
static bool CleanMemcardFilename( char* name );
|
||||
|
Loading…
Reference in New Issue
Block a user