From c0571ae9de432654d79254922132ab12f09c8167 Mon Sep 17 00:00:00 2001 From: Marcos Vitali Date: Sat, 29 Jan 2011 21:26:46 +0000 Subject: [PATCH] Improve for my last commit, also reset the VideoBuffer and Forget turn on GPReadEnable. If this is not enoughs for GC games. I will replace CPReadWriteDistance = 0 for ProcessFifoAllDistance. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6974 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 3 ++- Source/Core/VideoCommon/Src/Fifo.cpp | 6 ++++++ Source/Core/VideoCommon/Src/Fifo.h | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 14187548f4..bae72b3516 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -805,11 +805,11 @@ void SetFifoIdleFromVideoPlugin() // to 0 when PI_FIFO_RESET occurs. void AbortFrame() { - g_VideoInitialize.pResetGatherPipe(); fifo.bFF_GPReadEnable = false; while (CommandProcessor::isFifoBusy) Common::YieldCPU(); g_VideoInitialize.pResetGatherPipe(); + ResetVideoBuffer(); fifo.CPReadPointer = fifo.CPWritePointer; fifo.CPReadWriteDistance = 0; fifo.CPBreakpoint = 0; @@ -817,6 +817,7 @@ void AbortFrame() fifo.CPCmdIdle = false; PixelEngine::ResetSetToken(); PixelEngine::ResetSetFinish(); + fifo.bFF_GPReadEnable = true; } void SetOverflowStatusFromGatherPipe() diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 3aa6ec1fbc..89e7c6aebe 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -129,6 +129,12 @@ void Fifo_SendFifoData(u8* _uData, u32 len) size += len; } +void ResetVideoBuffer() +{ + g_pVideoData = videoBuffer; + size = 0; +} + // Description: Main FIFO update loop // Purpose: Keep the Core HW updated about the CPU-GPU distance diff --git a/Source/Core/VideoCommon/Src/Fifo.h b/Source/Core/VideoCommon/Src/Fifo.h index 2a3a5e4221..3789406af6 100644 --- a/Source/Core/VideoCommon/Src/Fifo.h +++ b/Source/Core/VideoCommon/Src/Fifo.h @@ -40,7 +40,7 @@ void Fifo_ExitLoopNonBlocking(); void Fifo_RunLoop(bool run); bool AtBreakpoint(); void Fifo_DoState(PointerWrap &f); - +void ResetVideoBuffer(); void Fifo_SetRendering(bool bEnabled); // Implemented by the Video Plugin