Quick fifo commit:

* Change the process ProcessAllDistace to ClearRegister
* Fix a bug in ProcessFifoEvents() in commandProcessro (thanks Skid)
-- The last 2 items should be improve the speed lost in r6572 and maybe improve a little bit because ProcessFifoEvents() is right. (Test car selection in GxZero)
* Alliviate Fifo desyncs, In the meant time I still Researching for real solution. (This fix RE0 again and maybe others 
"FIFOs linked but out of sync" and "GFX FIFO: Unknown Opcode (0x%x).\n" games suffers these for desync.)


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6837 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Marcos Vitali 2011-01-13 01:29:34 +00:00
parent 9ed3862c0a
commit be5c732254
1 changed files with 10 additions and 9 deletions

View File

@ -208,7 +208,7 @@ void Read16(u16& _rReturnValue, const u32 _Address)
{ {
m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint; m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint;
m_CPStatusReg.ReadIdle = (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint); m_CPStatusReg.ReadIdle = (fifo.CPReadPointer == fifo.CPWritePointer) || (fifo.CPReadPointer == fifo.CPBreakpoint);
m_CPStatusReg.CommandIdle = fifo.CPCmdIdle; m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance;
m_CPStatusReg.UnderflowLoWatermark = fifo.bFF_LoWatermark; m_CPStatusReg.UnderflowLoWatermark = fifo.bFF_LoWatermark;
m_CPStatusReg.OverflowHiWatermark = fifo.bFF_HiWatermark; m_CPStatusReg.OverflowHiWatermark = fifo.bFF_HiWatermark;
} }
@ -278,15 +278,15 @@ void Read16(u16& _rReturnValue, const u32 _Address)
return; return;
case FIFO_READ_POINTER_LO: case FIFO_READ_POINTER_LO:
_rReturnValue = ReadLow (fifo.CPReadPointer); //_rReturnValue = ReadLow (fifo.CPReadPointer);
// hack: CPU will always believe fifo is empty and on idle // hack: CPU will always believe fifo is empty and on idle
//_rReturnValue = ReadLow (fifo.CPWritePointer); _rReturnValue = ReadLow (fifo.CPWritePointer);
DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_LO : %04x", _rReturnValue); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_LO : %04x", _rReturnValue);
return; return;
case FIFO_READ_POINTER_HI: case FIFO_READ_POINTER_HI:
_rReturnValue = ReadHigh(fifo.CPReadPointer); //_rReturnValue = ReadHigh(fifo.CPReadPointer);
// hack: CPU will always believe fifo is empty and on idle // hack: CPU will always believe fifo is empty and on idle
//_rReturnValue = ReadHigh(fifo.CPWritePointer); _rReturnValue = ReadHigh(fifo.CPWritePointer);
DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_HI : %04x", _rReturnValue); DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_HI : %04x", _rReturnValue);
return; return;
@ -471,8 +471,6 @@ void Write16(const u16 _Value, const u32 _Address)
if (bProcessFifoToLoWatemark) if (bProcessFifoToLoWatemark)
ProcessFifoToLoWatemark(); ProcessFifoToLoWatemark();
if (bProcessFifoAllDistance)
ProcessFifoAllDistance();
INFO_LOG(COMMANDPROCESSOR,"\t Write to CTRL_REGISTER : %04x", _Value); 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" DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | BP %s | Int %s | OvF %s | UndF %s | LINK %s"
@ -496,7 +494,10 @@ void Write16(const u16 _Value, const u32 _Address)
bProcessFifoToLoWatemark = true; bProcessFifoToLoWatemark = true;
if (tmpCtrl.ClearFifoUnderflow && tmpCtrl.ClearFifoOverflow) if (tmpCtrl.ClearFifoUnderflow && tmpCtrl.ClearFifoOverflow)
bProcessFifoAllDistance = true; ProcessFifoAllDistance();
if (!tmpCtrl.ClearFifoUnderflow && !tmpCtrl.ClearFifoOverflow)
ProcessFifoAllDistance();
} }
else else
{ {
@ -904,7 +905,7 @@ void ProcessFifoAllDistance()
void ProcessFifoEvents() void ProcessFifoEvents()
{ {
if (g_VideoInitialize.bOnThread || interruptWaiting || interruptFinishWaiting || interruptTokenWaiting) if (g_VideoInitialize.bOnThread && (interruptWaiting || interruptFinishWaiting || interruptTokenWaiting))
g_VideoInitialize.pProcessFifoEvents(); g_VideoInitialize.pProcessFifoEvents();
} }