* Added the missing cd image types to the iso browser (img, bin, nrg, etc)

* Minor fix when using cdvdiso in browser mode (keeps the browser from being obscured by the GS window).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1685 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-08-27 03:09:38 +00:00
parent d77ac4786d
commit 62591d04d8
2 changed files with 27 additions and 7 deletions

View File

@ -769,6 +769,10 @@ bool ReportError2(int err, const char *str)
return false; return false;
} }
// used to store non-null filename parameters passed to CDVD plugins, so that the
// value can be retrieved when loading savestates and such.
static string cdvd_FileNameParam;
int InitPlugins() int InitPlugins()
{ {
if (plugins_initialized) return 0; if (plugins_initialized) return 0;
@ -796,6 +800,7 @@ int InitPlugins()
void ShutdownPlugins() void ShutdownPlugins()
{ {
if (!plugins_initialized) return; if (!plugins_initialized) return;
plugins_initialized = false;
mtgsWaitGS(); mtgsWaitGS();
ClosePlugins( true ); ClosePlugins( true );
@ -808,12 +813,11 @@ void ShutdownPlugins()
if (SPU2shutdown != NULL) SPU2shutdown(); if (SPU2shutdown != NULL) SPU2shutdown();
if (CDVDshutdown != NULL) CDVDshutdown(); if (CDVDshutdown != NULL) CDVDshutdown();
cdvd_FileNameParam.clear();
if (DEV9shutdown != NULL) DEV9shutdown(); if (DEV9shutdown != NULL) DEV9shutdown();
if (USBshutdown != NULL) USBshutdown(); if (USBshutdown != NULL) USBshutdown();
if (FWshutdown != NULL) FWshutdown(); if (FWshutdown != NULL) FWshutdown();
plugins_initialized = false;
} }
uptr pDsp; uptr pDsp;
@ -845,7 +849,7 @@ bool OpenGS()
return true; return true;
} }
bool OpenCDVD(const char* pTitleFilename) bool OpenCDVD( const char* pTitleFilename )
{ {
// if this assertion fails it means you didn't call CDVDsys_ChangeSource. You should. // if this assertion fails it means you didn't call CDVDsys_ChangeSource. You should.
// You really should. Really. // You really should. Really.
@ -856,12 +860,19 @@ bool OpenCDVD(const char* pTitleFilename)
{ {
CDVD->newDiskCB( cdvdNewDiskCB ); CDVD->newDiskCB( cdvdNewDiskCB );
if( (pTitleFilename == NULL) && !cdvd_FileNameParam.empty() )
pTitleFilename = cdvd_FileNameParam.c_str();
if (DoCDVDopen(pTitleFilename) != 0) if (DoCDVDopen(pTitleFilename) != 0)
{ {
Msgbox::Alert("Error Opening CDVD Plugin"); Msgbox::Alert("Error Opening CDVD Plugin");
ClosePlugins(true); ClosePlugins(true);
return false; return false;
} }
if( cdvd_FileNameParam.empty() && (pTitleFilename != NULL) )
cdvd_FileNameParam = pTitleFilename;
OpenStatus.CDVD = true; OpenStatus.CDVD = true;
} }
return true; return true;

View File

@ -421,7 +421,7 @@ BOOL Open_File_Proc( std::string& outstr )
OPENFILENAME ofn; OPENFILENAME ofn;
char szFileName[ g_MaxPath ]; char szFileName[ g_MaxPath ];
char szFileTitle[ g_MaxPath ]; char szFileTitle[ g_MaxPath ];
char * filter = "ELF Files (*.ELF)\0*.ELF\0ALL Files (*.*)\0*.*\0"; char * filter = "ELF Files (*.elf)\0*.elf\0All Files (*.*)\0*.*\0";
memzero_obj( szFileName ); memzero_obj( szFileName );
memzero_obj( szFileTitle ); memzero_obj( szFileTitle );
@ -460,7 +460,11 @@ BOOL Open_Iso_File_Proc( std::string& outstr )
OPENFILENAME ofn; OPENFILENAME ofn;
char szFileName[ g_MaxPath ]; char szFileName[ g_MaxPath ];
char szFileTitle[ g_MaxPath ]; char szFileTitle[ g_MaxPath ];
char * filter = "Compatible Disc Image Files (*.ISO, *.MDF)\0*.ISO;*.MDF\0Blockdump Files (*.dump)\0*.dump\0ALL Files (*.*)\0*.*\0"; char * filter =
"All Supported (.iso .mdf .nrg .bin .img .dump)\0*.iso;*.mdf;*.nrg;*.bin;*.img,*.dump\0"
"Disc Images (.iso .mdf .nrg .bin .img)\0*.iso;*.mdf;*.nrg;*.bin;*.img\0"
"Blockdumps (.dump)\0*.dump\0"
"All Files (*.*)\0*.*\0";
memzero_obj( szFileName ); memzero_obj( szFileName );
memzero_obj( szFileTitle ); memzero_obj( szFileTitle );
@ -698,6 +702,7 @@ LRESULT WINAPI MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
SysReset(); SysReset();
CDVDsys_ChangeSource( CDVDsrc_Plugin ); CDVDsys_ChangeSource( CDVDsrc_Plugin );
OpenCDVD( NULL ); // manually open the CDVD plugin even though we don't really have to. (See RUNCD for details)
SysPrepareExecution( outstr.c_str() ); SysPrepareExecution( outstr.c_str() );
} }
} }
@ -731,6 +736,10 @@ LRESULT WINAPI MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case ID_FILE_RUNCD: case ID_FILE_RUNCD:
SysReset(); SysReset();
CDVDsys_ChangeSource( CDVDsrc_Plugin ); CDVDsys_ChangeSource( CDVDsrc_Plugin );
// Note: manually open the CDVD plugin here, even though we don't really have to.
// This ensures that the CDVD plugin's popups (like cdvdiso's browser) don't get obscured
// by the GS window.
OpenCDVD( NULL );
SysPrepareExecution( NULL ); SysPrepareExecution( NULL );
break; break;