diff options
| author | donkopunchstania <donkopunchstania@gmail.com> | 2009-11-12 01:51:40 +0000 |
|---|---|---|
| committer | donkopunchstania <donkopunchstania@gmail.com> | 2009-11-12 01:51:40 +0000 |
| commit | dee90fa7aa2d6252f1fe4b51ba11b82e71add9df (patch) | |
| tree | 4352bab256a8a2fa1e2e6e3fa5bc61269d8c8bcd /Source/Core/VideoCommon/Src/Fifo.cpp | |
| parent | ebc696c58e21e2657c03801bb5f9bb7cd65e6e40 (diff) | |
The WGP does not loop if the write pointer is set beyond the end of the fifo. Updated the video plugins this time.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4531 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/Fifo.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/Fifo.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 6285e37afe..0375fdfd0a 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -165,18 +165,21 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) break; } distToSend = 32; - readPtr += 32; + if ( readPtr >= _fifo.CPEnd) readPtr = _fifo.CPBase; + else + readPtr += 32; } else { distToSend = _fifo.CPReadWriteDistance; // send 1024B chunk max length to have better control over PeekMessages' period distToSend = distToSend > 1024 ? 1024 : distToSend; - if ((distToSend + readPtr) >= _fifo.CPEnd) // TODO: better? + // add 32 bytes because the cp end points to the start of the last 32 byte chunk + if ((distToSend + readPtr) >= (_fifo.CPEnd + 32)) // TODO: better? { - distToSend =_fifo.CPEnd - readPtr; + distToSend =(_fifo.CPEnd + 32) - readPtr; readPtr = _fifo.CPBase; } else |
