MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / CopyEntryDictIntoTree

Method CopyEntryDictIntoTree

pcsx2/SIO/Memcard/MemoryCardFolder.cpp:1569–1599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1567}
1568
1569void FolderMemoryCard::CopyEntryDictIntoTree(std::vector<MemoryCardFileEntryTreeNode>* fileEntryTree, const u32 cluster, const u32 fileCount)
1570{
1571 const MemoryCardFileEntryCluster* entryCluster = &m_fileEntryDict[cluster];
1572 u32 fileCluster = cluster;
1573
1574 for (size_t i = 0; i < fileCount; ++i)
1575 {
1576 const MemoryCardFileEntry* entry = &entryCluster->entries[i % 2];
1577
1578 if (entry->IsValid() && entry->IsUsed())
1579 {
1580 fileEntryTree->emplace_back(*entry);
1581
1582 if (entry->IsDir() && !entry->IsDotDir())
1583 {
1584 MemoryCardFileEntryTreeNode* treeEntry = &fileEntryTree->back();
1585 CopyEntryDictIntoTree(&treeEntry->subdir, entry->entry.data.cluster, entry->entry.data.length);
1586 }
1587 }
1588
1589 if (i % 2 == 1)
1590 {
1591 fileCluster = m_fat.data[0][0][fileCluster] & 0x7FFFFFFFu;
1592 if (fileCluster == 0x7FFFFFFFu)
1593 {
1594 return;
1595 }
1596 entryCluster = &m_fileEntryDict[fileCluster];
1597 }
1598 }
1599}
1600
1601const MemoryCardFileEntry* FolderMemoryCard::FindEquivalent(const MemoryCardFileEntry* searchEntry, const u32 cluster, const u32 fileCount)
1602{

Callers

nothing calls this directly

Calls 5

IsDirMethod · 0.80
IsDotDirMethod · 0.80
IsValidMethod · 0.45
IsUsedMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected