diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 4d9a160a1c..01d38ed0f5 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -80,10 +80,14 @@ void STACKALIGN CheckGatherPipe() memcpy(m_gatherPipe, m_gatherPipe + GATHER_PIPE_SIZE, m_gatherPipeCount); // increase the CPUWritePointer - if (ProcessorInterface::Fifo_CPUWritePointer == ProcessorInterface::Fifo_CPUEnd) - ProcessorInterface::Fifo_CPUWritePointer = ProcessorInterface::Fifo_CPUBase; - else - ProcessorInterface::Fifo_CPUWritePointer += GATHER_PIPE_SIZE; + ProcessorInterface::Fifo_CPUWritePointer += GATHER_PIPE_SIZE; + + if (ProcessorInterface::Fifo_CPUWritePointer > ProcessorInterface::Fifo_CPUEnd) + _assert_msg_(DYNA_REC, 0, "Fifo_CPUWritePointer out of bounds: %08x (end = %08x)", + ProcessorInterface::Fifo_CPUWritePointer, ProcessorInterface::Fifo_CPUEnd); + + if (ProcessorInterface::Fifo_CPUWritePointer >= ProcessorInterface::Fifo_CPUEnd) + ProcessorInterface::Fifo_CPUWritePointer = ProcessorInterface::Fifo_CPUBase; // TODO store video plugin pointer CPluginManager::GetInstance().GetVideo()->Video_GatherPipeBursted();