FolderMemoryCard: Filter only system data by default.

This reduces memory card initialization time.
Without this, it always indexes all files when the emulator boots, which
can take a few seconds if you have lots of files.
With this, the only file indexed is the PS2 "your system configuration"
file.

This has the side-effect of not being able to see save files in the PS2
BIOS unless you insert a game disc matching the files you want to see. I
don't think this is a big problem, but there should probably be a "don't
filter" option somewhere in case you want to manage files in the BIOS.
This commit is contained in:
Admiral H. Curtiss 2015-05-25 05:08:02 +02:00
parent b4b55289d6
commit f32f42678c
1 changed files with 3 additions and 1 deletions

View File

@ -298,6 +298,8 @@ bool FolderMemoryCard::AddFolder( MemoryCardFileEntry* const dirEntry, const wxS
bool hasFilter = !filter.IsEmpty(); bool hasFilter = !filter.IsEmpty();
if ( hasFilter ) { if ( hasFilter ) {
localFilter = L"DATA-SYSTEM/" + filter; localFilter = L"DATA-SYSTEM/" + filter;
} else {
localFilter = L"DATA-SYSTEM";
} }
int entryNumber = 2; // include . and .. int entryNumber = 2; // include . and ..
@ -319,7 +321,7 @@ bool FolderMemoryCard::AddFolder( MemoryCardFileEntry* const dirEntry, const wxS
// if possible filter added directories by game serial // if possible filter added directories by game serial
// this has the effective result of only files relevant to the current game being loaded into the memory card // this has the effective result of only files relevant to the current game being loaded into the memory card
// which means every game essentially sees the memory card as if no other files exist // which means every game essentially sees the memory card as if no other files exist
if ( hasFilter && !FilterMatches( fileName, localFilter ) ) { if ( !FilterMatches( fileName, localFilter ) ) {
hasNext = dir.GetNext( &fileName ); hasNext = dir.GetNext( &fileName );
continue; continue;
} }