Skip to content

Commit

Permalink
IPU: Tidy up and fix up toIPU DMA, remove some hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Dec 26, 2021
1 parent 242655b commit 06bf250
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 245 deletions.
20 changes: 12 additions & 8 deletions pcsx2/IPU/IPU.cpp
Expand Up @@ -60,13 +60,6 @@ __fi void IPUProcessInterrupt()
{
if (ipuRegs.ctrl.BUSY) // && (g_BP.FP || g_BP.IFC || (ipu1ch.chcr.STR && ipu1ch.qwc > 0)))
IPUWorker();
if (ipuRegs.ctrl.BUSY && ipuRegs.cmd.BUSY && ipuRegs.cmd.DATA == 0x000001B7) {
// 0x000001B7 is the MPEG2 sequence end code, signalling the end of a video.
// At the end of a video BUSY values should be automatically set to 0.
// This does not happen for Enthusia - Professional Racing, causing it to get stuck in an endless loop.
ipuRegs.cmd.BUSY = 0;
ipuRegs.ctrl.BUSY = 0;
}
}

/////////////////////////////////////////////////////////
Expand Down Expand Up @@ -287,7 +280,18 @@ __fi RETURNS_R64 ipuRead64(u32 mem)

void ipuSoftReset()
{
if (ipu1ch.chcr.STR && g_BP.IFC < 8 && IPU1Status.DataRequested)
{
DevCon.Warning("Refill input fifo on reset");
ipu1Interrupt();
}

if (!ipu1ch.chcr.STR)
psHu32(DMAC_STAT) &= ~(1 << DMAC_TO_IPU);


ipu_fifo.clear();
memzero(g_BP);

coded_block_pattern = 0;

Expand All @@ -296,7 +300,7 @@ void ipuSoftReset()
ipu_cmd.clear();
ipuRegs.cmd.BUSY = 0;
ipuRegs.cmd.DATA = 0; // required for Enthusia - Professional Racing after fix, or will freeze at start of next video.
memzero(g_BP);

hwIntcIrq(INTC_IPU); // required for FightBox
}

Expand Down
2 changes: 1 addition & 1 deletion pcsx2/IPU/IPU.h
Expand Up @@ -72,7 +72,7 @@ union tIPU_CTRL {
bool test(u32 flags) const { return !!(_u32 & flags); }
void set_flags(u32 flags) { _u32 |= flags; }
void clear_flags(u32 flags) { _u32 &= ~flags; }
void reset() { _u32 = 0; }
void reset() { _u32 &= 0x7F33F00; }
};

struct alignas(16) tIPU_BP {
Expand Down

0 comments on commit 06bf250

Please sign in to comment.