CTR sets 0 irq address, and savestates mess up
ClearWorkingState();\r
spu.cycles_played = cycles;\r
\r
+ if (spu.spuCtrl & CTRL_IRQ)\r
+ schedule_next_irq();\r
+\r
return 1;\r
}\r
\r
\r
pFO=(SPUOSSFreeze_t *)(pF+1);\r
\r
- if(pFO->pSpuIrq) spu.pSpuIrq = spu.spuMemC+((long)pFO->pSpuIrq&0x7fff0); else spu.pSpuIrq=NULL;\r
+ spu.pSpuIrq = spu.spuMemC + ((spu.regArea[(H_SPUirqAddr - 0x0c00) / 2] << 3) & ~0xf);\r
\r
if(pFO->spuAddr)\r
{\r
spu.dwNewChannel=0;\r
spu.dwChannelOn=0;\r
spu.dwChannelDead=0;\r
- spu.pSpuIrq=0;\r
+ spu.pSpuIrq=spu.spuMemC;\r
\r
for(i=0;i<0xc0;i++)\r
{\r
// an IRQ.
if (unlikely((spu.spuCtrl & CTRL_IRQ)
- && spu.pSpuIrq && spu.pSpuIrq < spu.spuMemC+0x1000))
+ && spu.pSpuIrq < spu.spuMemC+0x1000))
{
int irq_pos = (spu.pSpuIrq - spu.spuMemC) / 2 & 0x1ff;
int left = (irq_pos - spu.decode_pos) & 0x1ff;
spu.spuAddr = 0xffffffff;
spu.decode_pos = 0;
memset((void *)s_chan, 0, sizeof(s_chan));
- spu.pSpuIrq = 0;
+ spu.pSpuIrq = spu.spuMemC;
SetupStreams(); // prepare streaming