Minor changes to how the commandline auorun feature works, so that it initializes in the same general order/pattern as using the GUI. May fix some spotty problems.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1732 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-09-03 15:52:15 +00:00
parent ac58ea42e3
commit 592781e7fc
3 changed files with 21 additions and 7 deletions

View File

@ -851,7 +851,11 @@ bool OpenCDVD( const char* pTitleFilename )
// if this assertion fails it means you didn't call CDVDsys_ChangeSource. You should.
// You really should. Really.
jASSUME( CDVD != NULL );
// hack to fix the new cdvd system, to ensure the plugin is always initialized when it's manually
// opened separately from the rest.
if( InitPlugins() == -1 ) return -1;
// Don't repetitively open the CDVD plugin if directly loading an elf file and open failed once already.
if (!OpenStatus.CDVD)
{
@ -861,7 +865,7 @@ bool OpenCDVD( const char* pTitleFilename )
pTitleFilename = cdvd_FileNameParam.c_str();
if (DoCDVDopen(pTitleFilename) != 0)
{
{
Msgbox::Alert("Error Opening CDVD Plugin");
ClosePlugins(true);
return false;

View File

@ -48,7 +48,8 @@ static void _loadStateOrExcept( const string& file )
// Make sure the cpu and plugins are ready to be state-ified!
cpuReset();
OpenPlugins();
if( OpenPlugins() == -1 )
throw Exception::PluginFailure( "Could not open all configured plugins." );
joe.FreezeAll();

View File

@ -368,8 +368,6 @@ static std::string str_Default( "default" );
void RunGui()
{
MSG msg;
PCSX2_MEM_PROTECT_BEGIN();
LoadPatch( str_Default );
@ -378,9 +376,19 @@ void RunGui()
{
// Initially bypass GUI and start PCSX2 directly.
SysReset();
CDVDsys_ChangeSource( g_Startup.CdvdSource );
if( !OpenCDVD( g_Startup.ImageName ) ) return;
if( OpenPlugins() == -1 ) return;
if( !OpenCDVD( g_Startup.ImageName ) )
{
Console::Error( "CDVD Initialization returned error, aborting autorun..." );
return;
}
if( OpenPlugins() == -1 )
{
Console::Error( "Some plugin failed to open, aborting autorun..." );
return;
}
SysPrepareExecution( (g_Startup.StartupMode == Startup_FromELF) ? g_Startup.ImageName : NULL, !g_Startup.SkipBios );
}
@ -395,6 +403,7 @@ void RunGui()
while( true )
{
MSG msg;
if( PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) != 0 )
{
if( msg.message == WM_QUIT )