From 607d5d0f979823f2db4485d36a692f221610d244 Mon Sep 17 00:00:00 2001 From: dborth Date: Wed, 7 Oct 2009 18:04:26 +0000 Subject: [PATCH] code tidy --- source/ngc/vbasupport.cpp | 14 +------------- source/ngc/vmmem.cpp | 7 +++---- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/source/ngc/vbasupport.cpp b/source/ngc/vbasupport.cpp index 1b57534..84e21c0 100644 --- a/source/ngc/vbasupport.cpp +++ b/source/ngc/vbasupport.cpp @@ -929,19 +929,7 @@ bool LoadGBROM() } else { - int device = GCSettings.LoadMethod; - - 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; - } + gbRomSize = LoadSzFile(szpath, (unsigned char *)gbRom); } if(gbRomSize <= 0) diff --git a/source/ngc/vmmem.cpp b/source/ngc/vmmem.cpp index 0b53e1b..3ab1b2f 100644 --- a/source/ngc/vmmem.cpp +++ b/source/ngc/vmmem.cpp @@ -268,7 +268,7 @@ int VMCPULoadROM() char filepath[MAXPATHLEN]; if(!MakeFilePath(filepath, FILE_ROM)) - return false; + return 0; // loading compressed files via VM is not supported if(!utilIsGBAImage(filepath)) @@ -304,9 +304,8 @@ int VMCPULoadROM() return 0; } - struct stat fileinfo; - fstat(romfile->_file, &fileinfo); - GBAROMSize = fileinfo.st_size; + fseeko(romfile,0,SEEK_END); + GBAROMSize = ftello(romfile); vmpageno = 0; vmpage[0].pageptr = rombase;