mirror of
https://github.com/dborth/fceugx.git
synced 2025-01-07 14:28:18 +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)
|
if (GENIEROM)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if(GCSettings.LoadMethod == DEVICE_AUTO)
|
||||||
|
GCSettings.LoadMethod = autoLoadMethod();
|
||||||
|
|
||||||
|
if(GCSettings.LoadMethod == DEVICE_AUTO)
|
||||||
|
return false;
|
||||||
|
|
||||||
char * tmpbuffer = (char *) memalign(32, 512 * 1024);
|
char * tmpbuffer = (char *) memalign(32, 512 * 1024);
|
||||||
if(!tmpbuffer)
|
if(!tmpbuffer)
|
||||||
return false;
|
return false;
|
||||||
@ -158,8 +164,13 @@ bool FindGameGenie()
|
|||||||
size_t romSize = 0;
|
size_t romSize = 0;
|
||||||
char filepath[1024];
|
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);
|
romSize = LoadFile(tmpbuffer, filepath, 0, SILENT);
|
||||||
|
}
|
||||||
|
|
||||||
if (romSize > 0)
|
if (romSize > 0)
|
||||||
{
|
{
|
||||||
|
@ -288,7 +288,7 @@ int main(int argc, char *argv[])
|
|||||||
InitGUIThreads();
|
InitGUIThreads();
|
||||||
|
|
||||||
// allocate memory to store rom
|
// 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 ***/
|
/*** Minimal Emulation Loop ***/
|
||||||
if (!FCEUI_Initialize())
|
if (!FCEUI_Initialize())
|
||||||
|
@ -41,8 +41,6 @@ enum {
|
|||||||
FILE_RAM,
|
FILE_RAM,
|
||||||
FILE_STATE,
|
FILE_STATE,
|
||||||
FILE_ROM,
|
FILE_ROM,
|
||||||
FILE_FDSBIOS,
|
|
||||||
FILE_GGROM,
|
|
||||||
FILE_CHEAT
|
FILE_CHEAT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -89,8 +89,11 @@ int GCMemROM(int size)
|
|||||||
|
|
||||||
char filepath[1024];
|
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);
|
biosSize = LoadFile(tmpbuffer, filepath, 0, SILENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,16 +292,6 @@ bool MakeFilePath(char filepath[], int type, char * filename, int filenum)
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
case FILE_CHEAT:
|
||||||
sprintf(folder, GCSettings.CheatFolder);
|
sprintf(folder, GCSettings.CheatFolder);
|
||||||
sprintf(file, "%s.cht", romFilename);
|
sprintf(file, "%s.cht", romFilename);
|
||||||
@ -353,7 +343,7 @@ static bool IsValidROM()
|
|||||||
{
|
{
|
||||||
// file size should be between 8K and 3MB
|
// file size should be between 8K and 3MB
|
||||||
if(browserList[browser.selIndex].length < (1024*8) ||
|
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!");
|
ErrorPrompt("Invalid file size!");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user