file code corrections

This commit is contained in:
dborth 2009-03-23 05:53:21 +00:00
parent faea01e64f
commit 26cfad4405
4 changed files with 16 additions and 19 deletions

View File

@ -503,7 +503,7 @@ getentry (int entrycount, unsigned char dvdbuffer[])
* The return value is number of files collected, or -1 on failure.
***************************************************************************/
int
ParseDVDdirectory (bool change)
ParseDVDdirectory ()
{
int pdlength;
u64 pdoffset;
@ -514,9 +514,6 @@ ParseDVDdirectory (bool change)
// reset browser
ResetBrowser();
if(change && !ChangeInterface(METHOD_DVD, NOTSILENT))
return 0;
pdoffset = rdoffset = dvddir;
pdlength = dvddirlength;
@ -605,7 +602,7 @@ static bool SwitchDVDFolderR(char * dir, int maxDepth)
if(browserList[dirindex].isdir) // only parse directories
{
UpdateDirName(METHOD_DVD);
ParseDVDdirectory(false);
ParseDVDdirectory();
}
else
{
@ -640,7 +637,7 @@ bool SwitchDVDFolder(char origdir[])
dvddir = dvdrootdir;
dvddirlength = dvdrootlength;
browser.dir[0] = 0;
ParseDVDdirectory(true);
ParseDVDdirectory();
return SwitchDVDFolderR(dirptr, 0);
}

View File

@ -14,7 +14,7 @@
#define _NGCDVD_
bool MountDVD(bool silent);
int ParseDVDdirectory(bool change);
int ParseDVDdirectory();
void SetDVDdirectory(u64 dir, int length);
bool SwitchDVDFolder(char dir[]);

View File

@ -501,7 +501,7 @@ int BrowserChangeFolder(int method)
switch (method)
{
case METHOD_DVD:
ParseDVDdirectory(true);
ParseDVDdirectory();
break;
default:
@ -535,8 +535,9 @@ OpenGameList ()
{
case METHOD_DVD:
browser.dir[0] = 0;
if(ParseDVDdirectory(true)) // Parse root directory
SwitchDVDFolder(GCSettings.LoadFolder); // switch to ROM folder
if(MountDVD(NOTSILENT))
if(ParseDVDdirectory()) // Parse root directory
SwitchDVDFolder(GCSettings.LoadFolder); // switch to ROM folder
break;
default:
sprintf(browser.dir, "/%s", GCSettings.LoadFolder);

View File

@ -280,6 +280,7 @@ ParseDirectory(int method)
struct tm * timeinfo;
char msg[128];
int retry = 1;
bool mounted = false;
// reset browser
ResetBrowser();
@ -289,16 +290,14 @@ ParseDirectory(int method)
// open the directory
while(dir == NULL && retry == 1)
{
if(ChangeInterface(method, NOTSILENT))
mounted = ChangeInterface(method, NOTSILENT);
sprintf(fulldir, "%s%s", rootdir, browser.dir); // add device to path
if(mounted) dir = diropen(fulldir);
if(dir == NULL)
{
sprintf(fulldir, "%s%s", rootdir, browser.dir); // add device to path
dir = diropen(fulldir);
if(dir == NULL)
{
unmountRequired[method] = true;
sprintf(msg, "Error opening %s", fulldir);
retry = ErrorPromptRetry(msg);
}
unmountRequired[method] = true;
sprintf(msg, "Error opening %s", fulldir);
retry = ErrorPromptRetry(msg);
}
}