diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index 2190a90a1f..d920a2d801 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -81,7 +81,7 @@ void DoState(PointerWrap &p) p.Do(cookie); if (cookie != 0xBAADBABE + STATE_VERSION) { - PanicAlert("Savestate version mismatch !\nSorry, you can't load states from others revisions."); + PanicAlert("Savestate version mismatch !\nSorry, you can't load states from other revisions."); return; } // Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index b258eb97f2..6285e37afe 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -145,49 +145,63 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) { Common::AtomicStore(_fifo.CPReadIdle, 0); - do + while (_fifo.bFF_GPReadEnable && _fifo.CPReadWriteDistance) { if (!fifoStateRun) break; - // Get the Read Pointer - // Create pointer to video data and send it to the VideoPlugin + // Create pointer to video data and send it to the VideoPlugin u32 readPtr = _fifo.CPReadPointer; - - // Set distance - // if we are on BP mode we must send 32B chunks to Video plugin for BP checking - distToSend = _fifo.bFF_BPEnable ? 32 : _fifo.CPReadWriteDistance; - // send 1024B chunk max length to have better control over PeekMessages' period - //distToSend = distToSend > 1024 ? 1024 : distToSend; - - // Get Data based on pointer u8 *uData = video_initialize.pGetMemoryPointer(readPtr); - // Check Pointer and move pointer - if ((distToSend + readPtr) >= _fifo.CPEnd) + // if we are on BP mode we must send 32B chunks to Video plugin for BP checking + // TODO (mb2): test & check if MP1/MP2 realy need this now. + if (_fifo.bFF_BPEnable) { - distToSend =_fifo.CPEnd - readPtr; - readPtr = _fifo.CPBase; + if (readPtr == _fifo.CPBreakpoint) + { + Common::AtomicStore(_fifo.bFF_Breakpoint, 1); + CommandProcessor::UpdateInterruptsFromVideoPlugin(); + break; + } + distToSend = 32; + readPtr += 32; + if ( readPtr >= _fifo.CPEnd) + readPtr = _fifo.CPBase; } else - readPtr += distToSend; + { + 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? + { + distToSend =_fifo.CPEnd - readPtr; + readPtr = _fifo.CPBase; + } + else + readPtr += distToSend; + } // Execute new instructions found in uData Fifo_SendFifoData(uData, distToSend); - //Check BP Mode - Pokemon XD wants this to be called after the pointer move + // The following condition is what keeps Pokemon XD "sorta booting" weird isn't it ? if (_fifo.bFF_BPEnable && (readPtr == _fifo.CPBreakpoint)) - { - Common::AtomicStore(_fifo.bFF_Breakpoint, 1); - CommandProcessor::UpdateInterruptsFromVideoPlugin(); - } + { + Common::AtomicStore(_fifo.bFF_Breakpoint, 1); + CommandProcessor::UpdateInterruptsFromVideoPlugin(); + } - // Update CPReadPointer and RWDistance - Common::AtomicStore(_fifo.CPReadPointer, readPtr); - Common::AtomicAdd(_fifo.CPReadWriteDistance, -distToSend); + Common::AtomicStore(_fifo.CPReadPointer, readPtr); + Common::AtomicAdd(_fifo.CPReadWriteDistance, -distToSend); + video_initialize.pPeekMessages(); - } while (_fifo.bFF_GPReadEnable && _fifo.CPReadWriteDistance && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint)); + VideoFifo_CheckEFBAccess(); + + VideoFifo_CheckSwapRequest(); + } Common::AtomicStore(_fifo.CPReadIdle, 1); CommandProcessor::SetFifoIdleFromVideoPlugin(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 16c49cfaaa..789bf43ba7 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -1042,8 +1042,8 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight) GL_REPORT_ERRORD(); // Clear framebuffer - //glClearColor(0, 0, 0, 0); - //glClear(GL_COLOR_BUFFER_BIT); + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT); GL_REPORT_ERRORD();