mirror of
https://github.com/dborth/fceugx.git
synced 2025-01-05 21:38:17 +01:00
fix for ROMs > 3 MB, search for gg and fds bios in /fceugx
This commit is contained in:
parent
4e2f798827
commit
416c00eae0
@ -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)
|
||||
{
|
||||
|
@ -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())
|
||||
|
@ -41,8 +41,6 @@ enum {
|
||||
FILE_RAM,
|
||||
FILE_STATE,
|
||||
FILE_ROM,
|
||||
FILE_FDSBIOS,
|
||||
FILE_GGROM,
|
||||
FILE_CHEAT
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user