diff options
| author | skidau <skidau@gmail.com> | 2014-11-17 16:05:16 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2014-11-19 12:48:09 +1100 |
| commit | ca3e5ce5e131c6f820d8fa069bf1b1566c60c844 (patch) | |
| tree | 72fa7907a6ab2dd59eee7d8463af87fd6b33db7d /Source/Core/VideoCommon/CommandProcessor.cpp | |
| parent | 3d448e49c6b2cb51121e85046ee4b96c18b12e01 (diff) | |
Added an exception check when the game is close to overflowing. Fixes the fifo overflow that occurs in Battalion Wars 2.
Changed the CPEnd loop check to an exact match.
Diffstat (limited to 'Source/Core/VideoCommon/CommandProcessor.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/CommandProcessor.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index 899438b9e4..a47cfa18b1 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -330,7 +330,7 @@ void GatherPipeBursted() } // update the fifo pointer - if (fifo.CPWritePointer >= fifo.CPEnd) + if (fifo.CPWritePointer == fifo.CPEnd) fifo.CPWritePointer = fifo.CPBase; else fifo.CPWritePointer += GATHER_PIPE_SIZE; @@ -342,6 +342,10 @@ void GatherPipeBursted() ProcessorInterface::Fifo_CPUEnd = fifo.CPEnd; } + // If the game is running close to overflowing, make the exception checking more frequent. + if (fifo.bFF_HiWatermark) + CoreTiming::ForceExceptionCheck(0); + Common::AtomicAdd(fifo.CPReadWriteDistance, GATHER_PIPE_SIZE); RunGpu(); @@ -470,8 +474,7 @@ void ProcessFifoAllDistance() { if (IsOnThread()) { - while (!interruptWaiting && fifo.bFF_GPReadEnable && - fifo.CPReadWriteDistance && !AtBreakpoint()) + while (!interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint()) Common::YieldCPU(); } } |
