Index: pcsx2/IPU/IPU.cpp =================================================================== --- pcsx2/IPU/IPU.cpp (revision 531) +++ pcsx2/IPU/IPU.cpp (working copy) @@ -67,6 +67,7 @@ u8* g_pIPU0Pointer = NULL; int g_nCmdPos[2] = {0}, g_nCmdIndex = 0; int ipuCurCmd = 0xffffffff; +int ipuRunDelay = 0; int FOreadpos = 0, FOwritepos = 0; @@ -83,7 +84,6 @@ static u32 s_tempstack[0x4000]; // 64k void IPUCMD_WRITE(u32 val); -void IPUWorker(); int IPU0dma(); int IPU1dma(); @@ -421,13 +421,19 @@ //other stuff g_decoder.dcr =1;//resets DC prediction value + s_RoutineDone = 0; s_routine = so_create(mpeg2sliceIDEC, &s_RoutineDone, s_tempstack, sizeof(s_tempstack)); assert( s_routine != NULL ); +#if 0 so_call(s_routine); if(s_RoutineDone) s_routine = NULL; return s_RoutineDone; +#endif + + ipuRunDelay = 500; + return 0; } #ifdef _DEBUG @@ -470,12 +476,20 @@ memzero_obj(mb8); memzero_obj(mb16); + s_RoutineDone = 0; s_routine = so_create(mpeg2_slice, &s_RoutineDone, s_tempstack, sizeof(s_tempstack)); assert( s_routine != NULL ); +#if 0 so_call(s_routine); if(s_RoutineDone) s_routine = NULL; + return s_RoutineDone; +#endif + + ipuRunDelay = 500; + + return 0; } static BOOL __fastcall ipuVDEC(u32 val) { Index: pcsx2/IPU/IPU.h =================================================================== --- pcsx2/IPU/IPU.h (revision 531) +++ pcsx2/IPU/IPU.h (working copy) @@ -221,6 +221,7 @@ extern int coded_block_pattern; extern int g_nIPU0Data; // or 0x80000000 whenever transferring extern u8* g_pIPU0Pointer; +extern int ipuRunDelay; void dmaIPU0(); @@ -248,6 +249,7 @@ extern void IPUProcessInterrupt(); extern void ipu0Interrupt(); extern void ipu1Interrupt(); +extern void IPUWorker(); extern u16 __fastcall FillInternalBuffer(u32 * pointer, u32 advance, u32 size); extern u8 __fastcall getBits32(u8 *address, u32 advance); Index: pcsx2/R5900.cpp =================================================================== --- pcsx2/R5900.cpp (revision 531) +++ pcsx2/R5900.cpp (working copy) @@ -442,6 +442,13 @@ eeEventTestIsActive = true; g_nextBranchCycle = cpuRegs.cycle + eeWaitCycles; + // this is probably not the right place to run it, but do I look like I care? + if (ipuRunDelay > 0) { + ipuRunDelay -= cpuRegs.cycle - EEoCycle; + if (ipuRunDelay <= 0 && ipuRegs->ctrl.BUSY) + IPUWorker(); + } + EEsCycle += cpuRegs.cycle - EEoCycle; EEoCycle = cpuRegs.cycle;