mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-12-26 19:21:50 +01:00
file code corrections
This commit is contained in:
parent
faea01e64f
commit
26cfad4405
@ -503,7 +503,7 @@ getentry (int entrycount, unsigned char dvdbuffer[])
|
|||||||
* The return value is number of files collected, or -1 on failure.
|
* The return value is number of files collected, or -1 on failure.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int
|
int
|
||||||
ParseDVDdirectory (bool change)
|
ParseDVDdirectory ()
|
||||||
{
|
{
|
||||||
int pdlength;
|
int pdlength;
|
||||||
u64 pdoffset;
|
u64 pdoffset;
|
||||||
@ -515,9 +515,6 @@ ParseDVDdirectory (bool change)
|
|||||||
// reset browser
|
// reset browser
|
||||||
ResetBrowser();
|
ResetBrowser();
|
||||||
|
|
||||||
if(change && !ChangeInterface(METHOD_DVD, NOTSILENT))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
pdoffset = rdoffset = dvddir;
|
pdoffset = rdoffset = dvddir;
|
||||||
pdlength = dvddirlength;
|
pdlength = dvddirlength;
|
||||||
filecount = 0;
|
filecount = 0;
|
||||||
@ -605,7 +602,7 @@ static bool SwitchDVDFolderR(char * dir, int maxDepth)
|
|||||||
if(browserList[dirindex].isdir) // only parse directories
|
if(browserList[dirindex].isdir) // only parse directories
|
||||||
{
|
{
|
||||||
UpdateDirName(METHOD_DVD);
|
UpdateDirName(METHOD_DVD);
|
||||||
ParseDVDdirectory(false);
|
ParseDVDdirectory();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -640,7 +637,7 @@ bool SwitchDVDFolder(char origdir[])
|
|||||||
dvddir = dvdrootdir;
|
dvddir = dvdrootdir;
|
||||||
dvddirlength = dvdrootlength;
|
dvddirlength = dvdrootlength;
|
||||||
browser.dir[0] = 0;
|
browser.dir[0] = 0;
|
||||||
ParseDVDdirectory(true);
|
ParseDVDdirectory();
|
||||||
|
|
||||||
return SwitchDVDFolderR(dirptr, 0);
|
return SwitchDVDFolderR(dirptr, 0);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#define _NGCDVD_
|
#define _NGCDVD_
|
||||||
|
|
||||||
bool MountDVD(bool silent);
|
bool MountDVD(bool silent);
|
||||||
int ParseDVDdirectory(bool change);
|
int ParseDVDdirectory();
|
||||||
void SetDVDdirectory(u64 dir, int length);
|
void SetDVDdirectory(u64 dir, int length);
|
||||||
bool SwitchDVDFolder(char dir[]);
|
bool SwitchDVDFolder(char dir[]);
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ int BrowserChangeFolder(int method)
|
|||||||
switch (method)
|
switch (method)
|
||||||
{
|
{
|
||||||
case METHOD_DVD:
|
case METHOD_DVD:
|
||||||
ParseDVDdirectory(true);
|
ParseDVDdirectory();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -535,7 +535,8 @@ OpenGameList ()
|
|||||||
{
|
{
|
||||||
case METHOD_DVD:
|
case METHOD_DVD:
|
||||||
browser.dir[0] = 0;
|
browser.dir[0] = 0;
|
||||||
if(ParseDVDdirectory(true)) // Parse root directory
|
if(MountDVD(NOTSILENT))
|
||||||
|
if(ParseDVDdirectory()) // Parse root directory
|
||||||
SwitchDVDFolder(GCSettings.LoadFolder); // switch to ROM folder
|
SwitchDVDFolder(GCSettings.LoadFolder); // switch to ROM folder
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -280,6 +280,7 @@ ParseDirectory(int method)
|
|||||||
struct tm * timeinfo;
|
struct tm * timeinfo;
|
||||||
char msg[128];
|
char msg[128];
|
||||||
int retry = 1;
|
int retry = 1;
|
||||||
|
bool mounted = false;
|
||||||
|
|
||||||
// reset browser
|
// reset browser
|
||||||
ResetBrowser();
|
ResetBrowser();
|
||||||
@ -289,10 +290,9 @@ ParseDirectory(int method)
|
|||||||
// open the directory
|
// open the directory
|
||||||
while(dir == NULL && retry == 1)
|
while(dir == NULL && retry == 1)
|
||||||
{
|
{
|
||||||
if(ChangeInterface(method, NOTSILENT))
|
mounted = ChangeInterface(method, NOTSILENT);
|
||||||
{
|
|
||||||
sprintf(fulldir, "%s%s", rootdir, browser.dir); // add device to path
|
sprintf(fulldir, "%s%s", rootdir, browser.dir); // add device to path
|
||||||
dir = diropen(fulldir);
|
if(mounted) dir = diropen(fulldir);
|
||||||
if(dir == NULL)
|
if(dir == NULL)
|
||||||
{
|
{
|
||||||
unmountRequired[method] = true;
|
unmountRequired[method] = true;
|
||||||
@ -300,7 +300,6 @@ ParseDirectory(int method)
|
|||||||
retry = ErrorPromptRetry(msg);
|
retry = ErrorPromptRetry(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// if we can't open the dir, try opening the root dir
|
// if we can't open the dir, try opening the root dir
|
||||||
if (dir == NULL)
|
if (dir == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user