fix GBA games on GC

This commit is contained in:
dborth 2008-12-28 21:58:07 +00:00
parent 6c1c62f7a9
commit 947ca0582a

View File

@ -294,6 +294,9 @@ int VMCPULoadROM(int method)
GBAROMSize = 0; GBAROMSize = 0;
if(!ChangeInterface(method, NOTSILENT))
return 0;
switch (method) switch (method)
{ {
case METHOD_SD: case METHOD_SD:
@ -311,17 +314,16 @@ int VMCPULoadROM(int method)
break; break;
} }
/* Check filename length */ if(!MakeFilePath(filepath, FILE_ROM, method))
if ((strlen(currentdir)+1+strlen(filelist[selection].filename)) < MAXPATHLEN) return false;
sprintf(filepath, "%s/%s",currentdir,filelist[selection].filename);
else
{
WaitPrompt("Maximum filepath length reached!");
return -1;
}
romfile = fopen(filepath, "rb"); // add device to filepath
if ( romfile == NULL ) char fullpath[1024];
sprintf(fullpath, "%s%s", rootdir, filepath);
romfile = fopen(fullpath, "rb");
if (romfile == NULL)
{ {
WaitPrompt("Error opening file!"); WaitPrompt("Error opening file!");
VMClose(); VMClose();