Sorry, this is the working fix for r4759

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4762 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2009-12-31 20:49:04 +00:00
parent 2788222be3
commit 6e87ef943f
2 changed files with 13 additions and 13 deletions

View File

@ -184,7 +184,6 @@ void Read16(u16& _rReturnValue, const u32 _Address)
//m_CPStatusReg.ReadIdle = 1;
//m_CPStatusReg.CommandIdle = 1;
//m_CPStatusReg.ReadIdle = fifo.CPReadIdle; // This seems not necessary though
m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint;
_rReturnValue = m_CPStatusReg.Hex;
@ -198,6 +197,7 @@ void Read16(u16& _rReturnValue, const u32 _Address)
, m_CPStatusReg.OverflowHiWatermark ? "ON" : "OFF"
, m_CPStatusReg.UnderflowLoWatermark ? "ON" : "OFF"
);
return;
case CTRL_REGISTER: _rReturnValue = m_CPCtrlReg.Hex; return;
@ -411,11 +411,11 @@ void Write16(const u16 _Value, const u32 _Address)
}
DEBUG_LOG(COMMANDPROCESSOR,"\t write to CTRL_REGISTER : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | LINK %s | BP %s || Int %s | OvF %s | UndF %s"
DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | LINK %s | BP %s || Init %s | OvF %s | UndF %s"
, fifo.bFF_GPReadEnable ? "ON" : "OFF"
, fifo.bFF_GPLinkEnable ? "ON" : "OFF"
, fifo.bFF_BPEnable ? "ON" : "OFF"
, m_CPCtrlReg.CPIntEnable ? "ON" : "OFF"
, m_CPCtrlReg.BPInit ? "ON" : "OFF"
, m_CPCtrlReg.FifoOverflowIntEnable ? "ON" : "OFF"
, m_CPCtrlReg.FifoUnderflowIntEnable ? "ON" : "OFF"
);
@ -649,7 +649,7 @@ void CatchUpGPU()
if (
(fifo.CPReadPointer == fifo.CPBreakpoint) ||
(fifo.CPReadPointer == fifo.CPWritePointer) ||
(fifo.CPWritePointer < fifo.CPBreakpoint)
(fifo.CPReadPointer > fifo.CPBreakpoint && fifo.CPBreakpoint > fifo.CPWritePointer)
)
{
//_assert_msg_(POWERPC,0,"BP: %08x",fifo.CPBreakpoint);

View File

@ -126,19 +126,19 @@ void Fifo_SendFifoData(u8* _uData, u32 len)
// Purpose: Keep the Core HW updated about the CPU-GPU distance
void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
{
fifoStateRun = true;
SCPFifoStruct &_fifo = CommandProcessor::fifo;
fifoStateRun = true;
SCPFifoStruct &_fifo = CommandProcessor::fifo;
s32 distToSend;
while (fifoStateRun)
{
while (fifoStateRun)
{
video_initialize.pPeekMessages();
VideoFifo_CheckEFBAccess();
VideoFifo_CheckSwapRequest();
// check if we are able to run this buffer
while (_fifo.bFF_GPReadEnable && _fifo.CPReadWriteDistance && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint))
// check if we are able to run this buffer
while (_fifo.bFF_GPReadEnable && ((!_fifo.bFF_BPEnable && _fifo.CPReadWriteDistance) || (_fifo.bFF_BPEnable && !_fifo.bFF_Breakpoint)))
{
if (!fifoStateRun)
break;
@ -157,7 +157,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
if (
(readPtr == _fifo.CPBreakpoint) ||
(readPtr == _fifo.CPWritePointer) ||
(_fifo.CPWritePointer < _fifo.CPBreakpoint)
(readPtr > _fifo.CPBreakpoint && _fifo.CPBreakpoint > _fifo.CPWritePointer)
)
{
Common::AtomicStore(_fifo.bFF_Breakpoint, 1);
@ -172,6 +172,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
else
readPtr += 32;
}
// If we are not in BP mode we send all the chunk we have to speed up
else
{
distToSend = _fifo.CPReadWriteDistance;
@ -202,8 +203,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
VideoFifo_CheckSwapRequest();
CommandProcessor::SetFifoIdleFromVideoPlugin();
}
}
Common::YieldCPU();
}
fifo_exit_event.Set();