mirror of https://github.com/PCSX2/pcsx2.git
FolderMemoryCard: Put the initialization of the file entry flushing logic into its own method.
This commit is contained in:
parent
fbc8d30b67
commit
c4570750ea
|
@ -813,12 +813,7 @@ void FolderMemoryCard::Flush() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// then all directory and file entries
|
// then all directory and file entries
|
||||||
const u32 rootDirCluster = m_superBlock.data.rootdir_cluster;
|
FlushFileEntries();
|
||||||
FlushCluster( rootDirCluster + m_superBlock.data.alloc_offset );
|
|
||||||
MemoryCardFileEntryCluster* rootEntries = &m_fileEntryDict[rootDirCluster];
|
|
||||||
if ( rootEntries->entries[0].IsValid() && rootEntries->entries[0].IsUsed() ) {
|
|
||||||
FlushFileEntries( rootDirCluster, rootEntries->entries[0].entry.data.length );
|
|
||||||
}
|
|
||||||
|
|
||||||
// and finally, flush everything that hasn't been flushed yet
|
// and finally, flush everything that hasn't been flushed yet
|
||||||
for ( uint i = 0; i < pageCount; ++i ) {
|
for ( uint i = 0; i < pageCount; ++i ) {
|
||||||
|
@ -852,6 +847,16 @@ void FolderMemoryCard::FlushBlock( const u32 block ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FolderMemoryCard::FlushFileEntries() {
|
||||||
|
// Flush all file entry data from the cache into m_fileEntryDict.
|
||||||
|
const u32 rootDirCluster = m_superBlock.data.rootdir_cluster;
|
||||||
|
FlushCluster( rootDirCluster + m_superBlock.data.alloc_offset );
|
||||||
|
MemoryCardFileEntryCluster* rootEntries = &m_fileEntryDict[rootDirCluster];
|
||||||
|
if ( rootEntries->entries[0].IsValid() && rootEntries->entries[0].IsUsed() ) {
|
||||||
|
FlushFileEntries( rootDirCluster, rootEntries->entries[0].entry.data.length );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FolderMemoryCard::FlushFileEntries( const u32 dirCluster, const u32 remainingFiles, const wxString& dirPath, MemoryCardFileMetadataReference* parent ) {
|
void FolderMemoryCard::FlushFileEntries( const u32 dirCluster, const u32 remainingFiles, const wxString& dirPath, MemoryCardFileMetadataReference* parent ) {
|
||||||
// flush the current cluster
|
// flush the current cluster
|
||||||
FlushCluster( dirCluster + m_superBlock.data.alloc_offset );
|
FlushCluster( dirCluster + m_superBlock.data.alloc_offset );
|
||||||
|
|
|
@ -381,6 +381,9 @@ protected:
|
||||||
// flush a whole memory card block of the cache to the internal data and/or host file system
|
// flush a whole memory card block of the cache to the internal data and/or host file system
|
||||||
void FlushBlock( const u32 block );
|
void FlushBlock( const u32 block );
|
||||||
|
|
||||||
|
// flush all directory and file entries to the internal data
|
||||||
|
void FlushFileEntries();
|
||||||
|
|
||||||
// flush a directory's file entries and all its subdirectories to the internal data
|
// flush a directory's file entries and all its subdirectories to the internal data
|
||||||
void FlushFileEntries( const u32 dirCluster, const u32 remainingFiles, const wxString& dirPath = L"", MemoryCardFileMetadataReference* parent = nullptr );
|
void FlushFileEntries( const u32 dirCluster, const u32 remainingFiles, const wxString& dirPath = L"", MemoryCardFileMetadataReference* parent = nullptr );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue