better fix for my elf-fix a while back.

basically if you run an elf file now, the cdvd plugin will attempt to open once, and if it has an error (like loading no-game), it'll let you continue running the elf file, and it won't bug you again.
but if it did open successfully, it'll initiate the cdvd plugin normally (allowing elf files to read the cdvd contents, like the Snes emu for ps2...)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1154 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-05-08 05:44:02 +00:00
parent e330c57556
commit f63bea379a
3 changed files with 15 additions and 7 deletions

View File

@ -25,7 +25,8 @@ enum StartupMode
{
BootMode_Bios,
BootMode_Quick,
BootMode_Elf
BootMode_Elf,
BootMode_Normal
};
class StartupParams

View File

@ -607,6 +607,7 @@ static PluginOpenStatusFlags OpenStatus = {0};
static bool loadp = false;
static bool initp = false;
static bool cdvdElf = false;
int LoadPlugins()
{
@ -659,6 +660,7 @@ int InitPlugins()
ret = FWinit();
if (ret != 0) { Msgbox::Alert("FWinit error: %d", params ret); return -1; }
cdvdElf = false;
initp = true;
return 0;
}
@ -725,19 +727,24 @@ int OpenPlugins(const char* pTitleFilename)
}*/
#endif
// Don't Open CDVD plugin if directly loading an elf file
if( !OpenStatus.CDVD && g_Startup.BootMode != BootMode_Elf)
// Don't Repetitively Open CDVD plugin if directly loading an elf file and Open failed once already
if( !OpenStatus.CDVD && !cdvdElf)
{
//first we need the data
if (CDVDnewDiskCB) CDVDnewDiskCB(cdvdNewDiskCB);
ret = CDVDopen(pTitleFilename);
if (ret != 0) { Msgbox::Alert("Error Opening CDVD Plugin"); goto OpenError; }
if (ret != 0) {
if (g_Startup.BootMode != BootMode_Elf) { Msgbox::Alert("Error Opening CDVD Plugin"); goto OpenError; }
else { Console::Notice("Running ELF File Without CDVD Plugin Support!"); cdvdElf = 1; goto skipOpenCDVD; }
}
OpenStatus.CDVD = true;
cdvdNewDiskCB();
}
skipOpenCDVD:
if( !OpenStatus.GS ) {
ret = gsOpen();
if (ret != 0) { Msgbox::Alert("Error Opening GS Plugin"); goto OpenError; }
@ -833,7 +840,7 @@ OpenError:
void ClosePlugins( bool closegs )
{
// Close pads first since they attatch to the GS's window.
// Close pads first since they attach to the GS's window.
CLOSE_PLUGIN( PAD1 );
CLOSE_PLUGIN( PAD2 );

View File

@ -400,8 +400,8 @@ void SysPrepareExecution( const char* elf_file, bool use_bios )
return;
}
// Don't Open CDVD plugin if directly loading an elf file
if (elf_file) { g_Startup.BootMode = BootMode_Elf; }
g_Startup.BootMode = (elf_file) ? BootMode_Elf : BootMode_Normal;
if (OpenPlugins(NULL) == -1) {
return;
}