Added the EmuRunningState check to the GPU thread's FIFO loop so that the GPU thread services any waiting save states. This is needed for games that have the Sync GPU option enabled.

This commit is contained in:
skidau 2014-09-04 22:02:21 +10:00
parent f8e24de833
commit 86db0bf8c3

View File

@ -153,7 +153,7 @@ void RunGpuLoop()
Common::AtomicStore(CommandProcessor::VITicks, CommandProcessor::m_cpClockOrigin);
// check if we are able to run this buffer
while (GpuRunningState && !CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint())
while (GpuRunningState && EmuRunningState && !CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint())
{
fifo.isGpuReadingData = true;
CommandProcessor::isPossibleWaitingSetDrawDone = fifo.bFF_GPLinkEnable ? true : false;
@ -175,7 +175,7 @@ void RunGpuLoop()
cyclesExecuted = OpcodeDecoder_Run(g_bSkipCurrentFrame);
if (Core::g_CoreStartupParameter.bSyncGPU && Common::AtomicLoad(CommandProcessor::VITicks) > cyclesExecuted)
if (Core::g_CoreStartupParameter.bSyncGPU && Common::AtomicLoad(CommandProcessor::VITicks) >= cyclesExecuted)
Common::AtomicAdd(CommandProcessor::VITicks, -(s32)cyclesExecuted);
Common::AtomicStore(fifo.CPReadPointer, readPtr);