Lock emulation while saving state on all platforms.
Fixes issue 2805. Fixes issue 3235. If this causes problems on Windows, just use this intead: #if defined(HAVE_X11) && HAVE_X11 || defined __APPLE__ git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6614 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
38a46ddf94
commit
fe9e72d6dc
|
@ -164,9 +164,7 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_X11) && HAVE_X11
|
|
||||||
static volatile u32 s_doStateRequested = FALSE;
|
static volatile u32 s_doStateRequested = FALSE;
|
||||||
#endif
|
|
||||||
|
|
||||||
static volatile struct
|
static volatile struct
|
||||||
{
|
{
|
||||||
|
@ -176,10 +174,8 @@ static volatile struct
|
||||||
|
|
||||||
// Run from the GPU thread on X11, CPU thread on the rest
|
// Run from the GPU thread on X11, CPU thread on the rest
|
||||||
static void check_DoState() {
|
static void check_DoState() {
|
||||||
#if defined(HAVE_X11) && HAVE_X11
|
|
||||||
if (Common::AtomicLoadAcquire(s_doStateRequested))
|
if (Common::AtomicLoadAcquire(s_doStateRequested))
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
// Clear all caches that touch RAM
|
// Clear all caches that touch RAM
|
||||||
CommandProcessor::FifoCriticalEnter();
|
CommandProcessor::FifoCriticalEnter();
|
||||||
TextureCache::Invalidate(false);
|
TextureCache::Invalidate(false);
|
||||||
|
@ -196,10 +192,8 @@ static void check_DoState() {
|
||||||
RecomputeCachedArraybases();
|
RecomputeCachedArraybases();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_X11) && HAVE_X11
|
|
||||||
Common::AtomicStoreRelease(s_doStateRequested, FALSE);
|
Common::AtomicStoreRelease(s_doStateRequested, FALSE);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run from the CPU thread
|
// Run from the CPU thread
|
||||||
|
@ -207,7 +201,6 @@ void DoState(unsigned char **ptr, int mode)
|
||||||
{
|
{
|
||||||
s_doStateArgs.ptr = ptr;
|
s_doStateArgs.ptr = ptr;
|
||||||
s_doStateArgs.mode = mode;
|
s_doStateArgs.mode = mode;
|
||||||
#if defined(HAVE_X11) && HAVE_X11
|
|
||||||
Common::AtomicStoreRelease(s_doStateRequested, TRUE);
|
Common::AtomicStoreRelease(s_doStateRequested, TRUE);
|
||||||
if (g_VideoInitialize.bOnThread)
|
if (g_VideoInitialize.bOnThread)
|
||||||
{
|
{
|
||||||
|
@ -216,7 +209,6 @@ void DoState(unsigned char **ptr, int mode)
|
||||||
Common::YieldCPU();
|
Common::YieldCPU();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
check_DoState();
|
check_DoState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,9 +216,7 @@ void VideoFifo_CheckAsyncRequest()
|
||||||
{
|
{
|
||||||
VideoFifo_CheckSwapRequest();
|
VideoFifo_CheckSwapRequest();
|
||||||
VideoFifo_CheckEFBAccess();
|
VideoFifo_CheckEFBAccess();
|
||||||
#if defined(HAVE_X11) && HAVE_X11
|
check_DoState();
|
||||||
check_DoState();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)
|
void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)
|
||||||
|
|
Loading…
Reference in New Issue