code tidy

This commit is contained in:
dborth 2009-10-07 18:04:26 +00:00
parent 46efa8c104
commit 607d5d0f97
2 changed files with 4 additions and 17 deletions

View File

@ -929,19 +929,7 @@ bool LoadGBROM()
} }
else else
{ {
int device = GCSettings.LoadMethod; gbRomSize = LoadSzFile(szpath, (unsigned char *)gbRom);
switch (device)
{
case DEVICE_SD:
case DEVICE_USB:
case DEVICE_SMB:
gbRomSize = LoadSzFile(szpath, (unsigned char *)gbRom);
break;
case DEVICE_DVD:
gbRomSize = SzExtractFile(browserList[browser.selIndex].filenum, (unsigned char *)gbRom);
break;
}
} }
if(gbRomSize <= 0) if(gbRomSize <= 0)

View File

@ -268,7 +268,7 @@ int VMCPULoadROM()
char filepath[MAXPATHLEN]; char filepath[MAXPATHLEN];
if(!MakeFilePath(filepath, FILE_ROM)) if(!MakeFilePath(filepath, FILE_ROM))
return false; return 0;
// loading compressed files via VM is not supported // loading compressed files via VM is not supported
if(!utilIsGBAImage(filepath)) if(!utilIsGBAImage(filepath))
@ -304,9 +304,8 @@ int VMCPULoadROM()
return 0; return 0;
} }
struct stat fileinfo; fseeko(romfile,0,SEEK_END);
fstat(romfile->_file, &fileinfo); GBAROMSize = ftello(romfile);
GBAROMSize = fileinfo.st_size;
vmpageno = 0; vmpageno = 0;
vmpage[0].pageptr = rombase; vmpage[0].pageptr = rombase;