Undo 2136 - not really an optimization since this loop rarely runs more than once. It also may be a cause of spurious bad GetPointer calls.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2251 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-02-15 11:39:24 +00:00
parent 72cf7a5a42
commit a4aac9ec99
1 changed files with 2 additions and 13 deletions

View File

@ -67,38 +67,27 @@ void ResetGatherPipe()
void STACKALIGN CheckGatherPipe()
{
// HyperIris: Memory::GetPointer is an expensive call, call it less, run faster
u8* pGatherPipe = Memory::GetPointer(CPeripheralInterface::Fifo_CPUWritePointer);
// ector: Well not really - this loop will only rarely go more than one lap.
while (m_gatherPipeCount >= GATHER_PIPE_SIZE)
{
// copy the GatherPipe
memcpy(pGatherPipe, m_gatherPipe, GATHER_PIPE_SIZE);
// [F|RES]: i thought GP is forced to mem1 ... strange
memcpy(Memory::GetPointer(CPeripheralInterface::Fifo_CPUWritePointer), m_gatherPipe, GATHER_PIPE_SIZE);
// move back the spill bytes
m_gatherPipeCount -= GATHER_PIPE_SIZE;
// HyperIris: dunno why, but I use memcpy
//for (u32 i=0; i < m_gatherPipeCount; i++)
// m_gatherPipe[i] = m_gatherPipe[i + GATHER_PIPE_SIZE];
memcpy(m_gatherPipe, m_gatherPipe + GATHER_PIPE_SIZE, m_gatherPipeCount);
// increase the CPUWritePointer
CPeripheralInterface::Fifo_CPUWritePointer += GATHER_PIPE_SIZE;
// adjust
pGatherPipe += GATHER_PIPE_SIZE;
if (CPeripheralInterface::Fifo_CPUWritePointer > CPeripheralInterface::Fifo_CPUEnd)
_assert_msg_(DYNA_REC, 0, "Fifo_CPUWritePointer out of bounds: %08x (end = %08x)",
CPeripheralInterface::Fifo_CPUWritePointer, CPeripheralInterface::Fifo_CPUEnd);
if (CPeripheralInterface::Fifo_CPUWritePointer >= CPeripheralInterface::Fifo_CPUEnd)
{
CPeripheralInterface::Fifo_CPUWritePointer = CPeripheralInterface::Fifo_CPUBase;
// adjust, take care
pGatherPipe = Memory::GetPointer(CPeripheralInterface::Fifo_CPUWritePointer);
}
CommandProcessor::GatherPipeBursted();
}
}