From 05feabdb49cf4547cd016855a778ff3b2de5e40e Mon Sep 17 00:00:00 2001 From: Marcos Vitali Date: Sun, 13 Feb 2011 02:21:11 +0000 Subject: - Reimplemented FifoReset in other way, only call to GPFifo::ResetGatherPipe() ResetVideoBuffer() in FIFO_RW_DISTANCE_LO when this is equal to "0" - In the Command Processor Control Register when GPReadEnable is OFF, wait until the fifo lopp finish with thi actual 32 bytes block. This is necessary to have Safe Disabble GP Read in this way AbortFrame is performed by the software, beside this can help to have accurate GPReadEnable OFF. Please test Metroid Prime 1/2, Guilty Gear XX, X men gc, SMG, and shuffle you can test Harry Potter Prince for WII. :) PD: The fifo code need a clean very soon. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7158 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 48 ++++++++++++++---------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'Source/Core/VideoCommon/Src/CommandProcessor.cpp') diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index d2c746c400..4ada117c4b 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -474,7 +474,6 @@ void Write16(const u16 _Value, const u32 _Address) fifo.bFF_BPInt = tmpCtrl.BPInt; fifo.bFF_BPEnable = tmpCtrl.BPEnable; - fifo.bFF_GPReadEnable = tmpCtrl.GPReadEnable; fifo.bFF_HiWatermarkInt = tmpCtrl.FifoOverflowIntEnable; fifo.bFF_LoWatermarkInt = tmpCtrl.FifoUnderflowIntEnable; fifo.bFF_GPLinkEnable = tmpCtrl.GPLinkEnable; @@ -489,6 +488,15 @@ void Write16(const u16 _Value, const u32 _Address) if (bProcessFifoToLoWatermark) ProcessFifoToLoWatermark(); + if(fifo.bFF_GPReadEnable && !tmpCtrl.GPReadEnable) + { + fifo.bFF_GPReadEnable = tmpCtrl.GPReadEnable; + while(fifo.isFifoProcesingData) Common::YieldCPU(); + } + else + { + fifo.bFF_GPReadEnable = tmpCtrl.GPReadEnable; + } INFO_LOG(COMMANDPROCESSOR,"\t Write to CTRL_REGISTER : %04x", _Value); DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | BP %s | Int %s | OvF %s | UndF %s | LINK %s" @@ -613,6 +621,12 @@ void Write16(const u16 _Value, const u32 _Address) break; case FIFO_RW_DISTANCE_LO: WriteLow((u32 &)fifo.CPReadWriteDistance, _Value & 0xFFE0); + if (fifo.CPReadWriteDistance == 0) + { + GPFifo::ResetGatherPipe(); + ResetVideoBuffer(); + IncrementCheckContextId(); + } DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_LO : %04x", _Value); break; @@ -699,11 +713,7 @@ void STACKALIGN GatherPipeBursted() OnOverflow = true; while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > fifo.CPEnd - fifo.CPBase - 64) - Common::YieldCPU(); - - - - + Common::YieldCPU(); } else { @@ -816,19 +826,19 @@ void SetFifoIdleFromVideoPlugin() // to 0 when PI_FIFO_RESET occurs. void AbortFrame() { - fifo.bFF_GPReadEnable = false; - while(IsFifoProcesingData()) Common::YieldCPU(); - GPFifo::ResetGatherPipe(); - ResetVideoBuffer(); - fifo.CPReadPointer = fifo.CPWritePointer; - fifo.CPReadWriteDistance = 0; - fifo.CPBreakpoint = 0; - fifo.bFF_Breakpoint = false; - fifo.CPCmdIdle = false; - PixelEngine::ResetSetToken(); - PixelEngine::ResetSetFinish(); - fifo.bFF_GPReadEnable = true; - IncrementCheckContextId(); + //fifo.bFF_GPReadEnable = false; + //while(IsFifoProcesingData()) Common::YieldCPU(); + //GPFifo::ResetGatherPipe(); + //ResetVideoBuffer(); + //fifo.CPReadPointer = fifo.CPWritePointer; + //fifo.CPReadWriteDistance = 0; + //fifo.CPBreakpoint = 0; + //fifo.bFF_Breakpoint = false; + //fifo.CPCmdIdle = false; + //PixelEngine::ResetSetToken(); + //PixelEngine::ResetSetFinish(); + //fifo.bFF_GPReadEnable = true; + //IncrementCheckContextId(); } void SetOverflowStatusFromGatherPipe() -- cgit v1.2.3