CDVD: fix ISO swapping (#3788)

This commit is contained in:
GovanifY 2020-10-04 23:34:06 +02:00 committed by GitHub
parent 2c717c3cdb
commit f30b66522f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -42,6 +42,8 @@
#include "x86emitter/x86_intrin.h"
bool g_CDVDReset = false;
// --------------------------------------------------------------------------------------
// SysCoreThread *External Thread* Implementations
// (Called from outside the context of this thread)
@ -307,7 +309,7 @@ void SysCoreThread::OnSuspendInThread()
void SysCoreThread::OnResumeInThread(bool isSuspended)
{
GetCorePlugins().Open();
if (isSuspended || !g_GameStarted)
if (isSuspended)
DoCDVDopen();
FWopen();
SPU2open((void*)pDsp);

View File

@ -314,7 +314,8 @@ bool SysThreadBase::StateCheckInThread()
m_RunningLock.Acquire();
if( m_ExecMode != ExecMode_Closing )
{
OnResumeInThread( false );
OnResumeInThread( g_CDVDReset );
g_CDVDReset = false;
break;
}
m_sem_ChangingExecMode.Post();

View File

@ -265,3 +265,5 @@ protected:
// them to extend the class and override virtual methods).
//
extern SysCoreThread& GetCoreThread();
extern bool g_CDVDReset;

View File

@ -20,6 +20,7 @@
#include "GS.h"
#include "GSFrame.h"
#include "SPU2/spu2.h"
#include "System/SysThreads.h"
#include "ConsoleLogger.h"
#include "MainFrame.h"
@ -164,6 +165,7 @@ wxWindowID SwapOrReset_Iso(wxWindow* owner, IScopedCoreThread& core_control, con
}
}
g_CDVDReset = true;
g_Conf->CdvdSource = CDVD_SourceType::Iso;
SysUpdateIsoSrcFile(isoFilename);
@ -258,6 +260,7 @@ wxWindowID SwapOrReset_CdvdSrc(wxWindow* owner, CDVD_SourceType newsrc)
}
}
g_CDVDReset = true;
CDVD_SourceType oldsrc = g_Conf->CdvdSource;
g_Conf->CdvdSource = newsrc;