mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-15 06:58:37 +02:00
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.
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user