fix saves issue

This commit is contained in:
dborth 2010-07-15 06:55:40 +00:00
parent ee2277f76f
commit d6cfb51b59
3 changed files with 8 additions and 5 deletions

View File

@ -57,6 +57,7 @@ bool isMounted[7] = { false, false, false, false, false, false, false };
static lwp_t parsethread = LWP_THREAD_NULL; static lwp_t parsethread = LWP_THREAD_NULL;
static DIR_ITER * dirIter = NULL; static DIR_ITER * dirIter = NULL;
static bool parseHalt = true; static bool parseHalt = true;
static bool parseFilter = true;
bool ParseDirEntries(); bool ParseDirEntries();
int selectLoadedFile = 0; int selectLoadedFile = 0;
@ -526,7 +527,7 @@ bool ParseDirEntries()
ext = GetExt(filename); ext = GetExt(filename);
// don't show the file if it's not a valid ROM // don't show the file if it's not a valid ROM
if((filestat.st_mode & _IFDIR) == 0) if(parseFilter && (filestat.st_mode & _IFDIR) == 0)
{ {
if(ext == NULL) if(ext == NULL)
continue; continue;
@ -615,10 +616,11 @@ bool ParseDirEntries()
* Browse subdirectories * Browse subdirectories
**************************************************************************/ **************************************************************************/
int int
ParseDirectory(bool waitParse) ParseDirectory(bool waitParse, bool filter)
{ {
int retry = 1; int retry = 1;
bool mounted = false; bool mounted = false;
parseFilter = filter;
ResetBrowser(); // reset browser ResetBrowser(); // reset browser
@ -680,7 +682,8 @@ ParseDirectory(bool waitParse)
if(waitParse) // wait for complete parsing if(waitParse) // wait for complete parsing
{ {
ShowAction("Loading..."); ShowAction("Loading...");
while(!LWP_ThreadIsSuspended(parsethread)) while(!LWP_ThreadIsSuspended(parsethread))
usleep(THREAD_SLEEP); usleep(THREAD_SLEEP);

View File

@ -34,7 +34,7 @@ char * StripDevice(char * path);
bool ChangeInterface(int device, bool silent); bool ChangeInterface(int device, bool silent);
bool ChangeInterface(char * filepath, bool silent); bool ChangeInterface(char * filepath, bool silent);
void CreateAppPath(char * origpath); void CreateAppPath(char * origpath);
int ParseDirectory(bool waitParse = false); int ParseDirectory(bool waitParse = false, bool filter = true);
void AllocSaveBuffer(); void AllocSaveBuffer();
void FreeSaveBuffer(); void FreeSaveBuffer();
size_t LoadFile(char * rbuffer, char *filepath, size_t length, bool silent); size_t LoadFile(char * rbuffer, char *filepath, size_t length, bool silent);

View File

@ -1603,7 +1603,7 @@ static int MenuGameSaves(int action)
memset(&saves, 0, sizeof(saves)); memset(&saves, 0, sizeof(saves));
sprintf(browser.dir, "%s%s", pathPrefix[GCSettings.SaveMethod], GCSettings.SaveFolder); sprintf(browser.dir, "%s%s", pathPrefix[GCSettings.SaveMethod], GCSettings.SaveFolder);
ParseDirectory(true); ParseDirectory(true, false);
len = strlen(Memory.ROMFilename); len = strlen(Memory.ROMFilename);