Skip to content

Commit

Permalink
IPU: Pause IPU_TO on tag edge. Stop repeat Interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Nov 6, 2023
1 parent b824c2d commit 0fc9fa5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pcsx2/IPU/IPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ __fi void IPUCMD_WRITE(u32 val)
{
IPUCoreStatus.WaitingOnIPUFrom = false;
IPUCoreStatus.WaitingOnIPUTo = false;
CPU_INT(IPU_PROCESS, 64);
IPU_INT_PROCESS(64);
}
else
IPUWorker();
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/IPU/IPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define IPU_INT_TO( cycles ) if(!(cpuRegs.interrupt & (1<<4))) CPU_INT( DMAC_TO_IPU, cycles )
#define IPU_INT_FROM( cycles ) CPU_INT( DMAC_FROM_IPU, cycles )

#define IPU_INT_PROCESS( cycles ) if(!(cpuRegs.interrupt & (1 << IPU_PROCESS))) CPU_INT( IPU_PROCESS, cycles )
//
// Bitfield Structures
//
Expand Down
4 changes: 2 additions & 2 deletions pcsx2/IPU/IPU_Fifo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ void WriteFIFO_IPUin(const mem128_t* value)
//committing every 16 bytes
if( ipu_fifo.in.write(value->_u32, 1) > 0 )
{
if (ipuRegs.ctrl.BUSY && IPUCoreStatus.WaitingOnIPUTo)
if (ipuRegs.ctrl.BUSY /*&& IPUCoreStatus.WaitingOnIPUTo*/)
{
IPUCoreStatus.WaitingOnIPUFrom = false;
IPUCoreStatus.WaitingOnIPUTo = false;
CPU_INT(IPU_PROCESS, 2 * BIAS);
IPU_INT_PROCESS(2 * BIAS);
}
}
}
4 changes: 2 additions & 2 deletions pcsx2/IPU/IPU_MultiISA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ __ri static bool mpeg2sliceIDEC()
ready_to_decode = false;
IPUCoreStatus.WaitingOnIPUFrom = false;
IPUCoreStatus.WaitingOnIPUTo = false;
CPU_INT(IPU_PROCESS, 64); // Should probably be much higher, but myst 3 doesn't like it right now.
IPU_INT_PROCESS( 64); // Should probably be much higher, but myst 3 doesn't like it right now.
ipu_cmd.pos[1] = 2;
return false;
}
Expand Down Expand Up @@ -1522,7 +1522,7 @@ __fi static bool mpeg2_slice()
ready_to_decode = false;
IPUCoreStatus.WaitingOnIPUFrom = false;
IPUCoreStatus.WaitingOnIPUTo = false;
CPU_INT(IPU_PROCESS, 64); // Should probably be much higher, but myst 3 doesn't like it right now.
IPU_INT_PROCESS( 64); // Should probably be much higher, but myst 3 doesn't like it right now.
return false;
}

Expand Down
10 changes: 5 additions & 5 deletions pcsx2/IPU/IPUdma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void IPU1dma()
if (IPUCoreStatus.WaitingOnIPUTo)
{
IPUCoreStatus.WaitingOnIPUTo = false;
CPU_INT(IPU_PROCESS, 4 * BIAS);
IPU_INT_PROCESS(4 * BIAS);
}
return;
}
Expand Down Expand Up @@ -130,7 +130,7 @@ void IPU1dma()
totalqwc += IPU1chain();

// Nothing has been processed except maybe a tag, or the DMA is ending
if(totalqwc == 0 || (IPU1Status.DMAFinished && !IPU1Status.InProgress) || IPUCoreStatus.DataRequested)
if(totalqwc == 0 || (IPU1Status.DMAFinished && !IPU1Status.InProgress))
{
totalqwc = std::max(4, totalqwc) + tagcycles;
IPU_INT_TO(totalqwc * BIAS);
Expand All @@ -144,7 +144,7 @@ void IPU1dma()
if (IPUCoreStatus.WaitingOnIPUTo && g_BP.IFC >= 1)
{
IPUCoreStatus.WaitingOnIPUTo = false;
CPU_INT(IPU_PROCESS, totalqwc * BIAS);
IPU_INT_PROCESS(totalqwc * BIAS);
}

IPU_LOG("Completed Call IPU1 DMA QWC Remaining %x Finished %d In Progress %d tadr %x", ipu1ch.qwc, IPU1Status.DMAFinished, IPU1Status.InProgress, ipu1ch.tadr);
Expand Down Expand Up @@ -174,7 +174,7 @@ void IPU0dma()
if (IPUCoreStatus.WaitingOnIPUFrom)
{
IPUCoreStatus.WaitingOnIPUFrom = false;
CPU_INT(IPU_PROCESS, ipuRegs.ctrl.OFC * BIAS);
IPU_INT_PROCESS(ipuRegs.ctrl.OFC * BIAS);
}
return;
}
Expand Down Expand Up @@ -208,7 +208,7 @@ void IPU0dma()
if (ipuRegs.ctrl.BUSY && IPUCoreStatus.WaitingOnIPUFrom)
{
IPUCoreStatus.WaitingOnIPUFrom = false;
CPU_INT(IPU_PROCESS, readsize * BIAS);
IPU_INT_PROCESS(readsize * BIAS);
}
}

Expand Down

0 comments on commit 0fc9fa5

Please sign in to comment.