diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index 1d6586c229..750fe42a14 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -331,6 +331,11 @@ static __forceinline void _reloadElfInfo(wxString elfpath) // Now's a good time to reload the ELF info... ScopedLock locker( Mutex_NewDiskCB ); + if (elfpath == LastELF) + return; + + LastELF = elfpath; + wxString fname = elfpath.AfterLast('\\'); if (!fname) fname = elfpath.AfterLast('/'); @@ -374,20 +379,17 @@ void cdvdReloadElfInfo(wxString elfoverride) wxString elfpath; u32 discType = GetPS2ElfName(elfpath); - if (ElfCRC == 0) + switch (discType) { - switch (discType) - { - case 2: // Is a PS2 disc. - _reloadElfInfo(elfpath); - break; - case 1: // Is a PS1 disc. - if (ENABLE_LOADING_PS1_GAMES) _reloadElfInfo(elfpath); - break; - default: // Isn't a disc we recognise. - break; - } - } + case 2: // Is a PS2 disc. + _reloadElfInfo(elfpath); + break; + case 1: // Is a PS1 disc. + if (ENABLE_LOADING_PS1_GAMES) _reloadElfInfo(elfpath); + break; + default: // Isn't a disc we recognise. + break; + } } static __forceinline s32 StrToS32(const wxString& str, int base = 10) diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp index a13ee56062..a3af4fd5c4 100644 --- a/pcsx2/Elfheader.cpp +++ b/pcsx2/Elfheader.cpp @@ -23,6 +23,7 @@ using namespace std; u32 ElfCRC; u32 ElfEntry; +wxString LastELF; #if 0 // fixme: ELF command line option system. diff --git a/pcsx2/Elfheader.h b/pcsx2/Elfheader.h index 79dacc06a7..591d5f3fdf 100644 --- a/pcsx2/Elfheader.h +++ b/pcsx2/Elfheader.h @@ -165,5 +165,6 @@ extern int GetPS2ElfName( wxString& dest ); extern u32 ElfCRC; extern u32 ElfEntry; +extern wxString LastELF; #endif diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index d9bd7df118..ada985d4d8 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -92,6 +92,7 @@ void cpuReset() ElfCRC = 0; DiscID = L""; ElfEntry = -1; + LastELF = L""; } __releaseinline void cpuException(u32 code, u32 bd)