Update CPStatus before processing the FIFO events and force an exception check on interrupts.

Added more information into the FIFO unknown opcode error message.
This commit is contained in:
skidau 2014-11-14 17:07:11 +11:00
parent b2c02e216c
commit 3d448e49c6
2 changed files with 18 additions and 7 deletions

View File

@ -304,6 +304,9 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
void GatherPipeBursted()
{
if (IsOnThread())
SetCPStatusFromCPU();
ProcessFifoEvents();
// if we aren't linked, we don't care about gather pipe data
if (!m_CPCtrlReg.GPLinkEnable)
@ -326,9 +329,6 @@ void GatherPipeBursted()
return;
}
if (IsOnThread())
SetCPStatusFromCPU();
// update the fifo pointer
if (fifo.CPWritePointer >= fifo.CPEnd)
fifo.CPWritePointer = fifo.CPBase;
@ -369,6 +369,7 @@ void UpdateInterrupts(u64 userdata)
INFO_LOG(COMMANDPROCESSOR,"Interrupt cleared");
ProcessorInterface::SetInterrupt(INT_CAUSE_CP, false);
}
CoreTiming::ForceExceptionCheck(0);
interruptWaiting = false;
}
@ -404,6 +405,7 @@ void SetCPStatusFromGPU()
INFO_LOG(COMMANDPROCESSOR, "Cleared breakpoint at %i", fifo.CPReadPointer);
fifo.bFF_Breakpoint = false;
}
// overflow & underflow check
fifo.bFF_HiWatermark = (fifo.CPReadWriteDistance > fifo.CPHiWatermark);
fifo.bFF_LoWatermark = (fifo.CPReadWriteDistance < fifo.CPLoWatermark);
@ -447,7 +449,7 @@ void SetCPStatusFromCPU()
if (interrupt != interruptSet && !interruptWaiting)
{
u64 userdata = interrupt?1:0;
u64 userdata = interrupt ? 1 : 0;
if (IsOnThread())
{
if (!interrupt || bpInt || undfInt || ovfInt)

View File

@ -118,10 +118,19 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)
"bFF_BPEnable: %s\n"
"bFF_BPInt: %s\n"
"bFF_Breakpoint: %s\n"
"bFF_GPLinkEnable: %s\n"
"bFF_HiWatermarkInt: %s\n"
"bFF_LoWatermarkInt: %s\n"
,cmd_byte, fifo.CPBase, fifo.CPEnd, fifo.CPHiWatermark, fifo.CPLoWatermark, fifo.CPReadWriteDistance
,fifo.CPWritePointer, fifo.CPReadPointer, fifo.CPBreakpoint, fifo.bFF_GPReadEnable ? "true" : "false"
,fifo.bFF_BPEnable ? "true" : "false" ,fifo.bFF_BPInt ? "true" : "false"
,fifo.bFF_Breakpoint ? "true" : "false");
,fifo.CPWritePointer, fifo.CPReadPointer, fifo.CPBreakpoint
,fifo.bFF_GPReadEnable ? "true" : "false"
,fifo.bFF_BPEnable ? "true" : "false"
,fifo.bFF_BPInt ? "true" : "false"
,fifo.bFF_Breakpoint ? "true" : "false"
,fifo.bFF_GPLinkEnable ? "true" : "false"
,fifo.bFF_HiWatermarkInt ? "true" : "false"
,fifo.bFF_LoWatermarkInt ? "true" : "false"
);
}
}