fix for ROMs > 3 MB, search for gg and fds bios in /fceugx

This commit is contained in:
dborth 2010-01-13 05:53:42 +00:00
parent 4e2f798827
commit 416c00eae0
5 changed files with 18 additions and 16 deletions

View File

@ -151,6 +151,12 @@ bool FindGameGenie()
if (GENIEROM)
return true;
if(GCSettings.LoadMethod == DEVICE_AUTO)
GCSettings.LoadMethod = autoLoadMethod();
if(GCSettings.LoadMethod == DEVICE_AUTO)
return false;
char * tmpbuffer = (char *) memalign(32, 512 * 1024);
if(!tmpbuffer)
return false;
@ -158,8 +164,13 @@ bool FindGameGenie()
size_t romSize = 0;
char filepath[1024];
if (MakeFilePath(filepath, FILE_GGROM))
sprintf (filepath, "%s%s/gg.rom", pathPrefix[GCSettings.LoadMethod], APPFOLDER);
romSize = LoadFile(tmpbuffer, filepath, 0, SILENT);
if(romSize == 0 && strlen(appPath) > 0)
{
sprintf (filepath, "%s/gg.rom", appPath);
romSize = LoadFile(tmpbuffer, filepath, 0, SILENT);
}
if (romSize > 0)
{

View File

@ -288,7 +288,7 @@ int main(int argc, char *argv[])
InitGUIThreads();
// allocate memory to store rom
nesrom = (unsigned char *)memalign(32,1024*1024*3); // 3 MB should be plenty
nesrom = (unsigned char *)memalign(32,1024*1024*4); // 4 MB should be plenty
/*** Minimal Emulation Loop ***/
if (!FCEUI_Initialize())

View File

@ -41,8 +41,6 @@ enum {
FILE_RAM,
FILE_STATE,
FILE_ROM,
FILE_FDSBIOS,
FILE_GGROM,
FILE_CHEAT
};

View File

@ -89,8 +89,11 @@ int GCMemROM(int size)
char filepath[1024];
if (MakeFilePath(filepath, FILE_FDSBIOS))
sprintf (filepath, "%s%s/disksys.rom", pathPrefix[GCSettings.LoadMethod], APPFOLDER);
biosSize = LoadFile(tmpbuffer, filepath, 0, SILENT);
if(biosSize == 0 && strlen(appPath) > 0)
{
sprintf (filepath, "%s/disksys.rom", appPath);
biosSize = LoadFile(tmpbuffer, filepath, 0, SILENT);
}

View File

@ -292,16 +292,6 @@ bool MakeFilePath(char filepath[], int type, char * filename, int filenum)
}
break;
case FILE_FDSBIOS:
sprintf(folder, "fceugx");
sprintf(file, "disksys.rom");
break;
case FILE_GGROM:
sprintf(folder, "fceugx");
sprintf(file, "gg.rom");
break;
case FILE_CHEAT:
sprintf(folder, GCSettings.CheatFolder);
sprintf(file, "%s.cht", romFilename);
@ -353,7 +343,7 @@ static bool IsValidROM()
{
// file size should be between 8K and 3MB
if(browserList[browser.selIndex].length < (1024*8) ||
browserList[browser.selIndex].length > (1024*1024*3))
browserList[browser.selIndex].length > (1024*1024*4))
{
ErrorPrompt("Invalid file size!");
return false;