\r
SPUCHAN_orig s_chan[MAXCHAN]; \r
\r
+ uint32_t cycles_dma_end;\r
+ uint32_t decode_dirty_ch;\r
+ uint32_t dwNoiseVal;\r
+ uint32_t dwNoiseCount;\r
+ uint32_t XARepeat;\r
+ uint32_t XALastVal;\r
+ uint32_t last_keyon_cycles;\r
+\r
} SPUOSSFreeze_t;\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
if(ulFreezeMode==2) return 1; // info mode? ok, bye\r
// save mode:\r
+ regAreaGet(H_SPUctrl) = spu.spuCtrl;\r
+ regAreaGet(H_SPUstat) = spu.spuStat;\r
memcpy(pF->cSPURam,spu.spuMem,0x80000); // copy common infos\r
memcpy(pF->cSPUPort,spu.regArea,0x200);\r
\r
memcpy(spu.spuMem,pF->cSPURam,0x80000); // get ram\r
memcpy(spu.regArea,pF->cSPUPort,0x200);\r
spu.bMemDirty = 1;\r
+ spu.spuCtrl = regAreaGet(H_SPUctrl);\r
+ spu.spuStat = regAreaGet(H_SPUstat);\r
\r
if (!strcmp(pF->szSPUName,"PBOSS") && pF->ulFreezeVersion==5)\r
pFO = LoadStateV5(pF, cycles);\r
FeedCDDA((void *)pF->xaS.pcm, pFO->cdda_left * 4);\r
}\r
\r
+ // not in old savestates\r
+ spu.cycles_dma_end = 0;\r
+ spu.decode_dirty_ch = spu.dwChannelsAudible & 0x0a;\r
+ spu.dwNoiseVal = 0;\r
+ spu.dwNoiseCount = 0;\r
+ spu.XARepeat = 0;\r
+ spu.XALastVal = 0;\r
+ spu.last_keyon_cycles = cycles - 16*786u;\r
+ if (pFO && pF->ulFreezeSize >= sizeof(*pF) + sizeof(*pFO)) {\r
+ spu.cycles_dma_end = pFO->cycles_dma_end;\r
+ spu.decode_dirty_ch = pFO->decode_dirty_ch;\r
+ spu.dwNoiseVal = pFO->dwNoiseVal;\r
+ spu.dwNoiseCount = pFO->dwNoiseCount;\r
+ spu.XARepeat = pFO->XARepeat;\r
+ spu.XALastVal = pFO->XALastVal;\r
+ spu.last_keyon_cycles = pFO->last_keyon_cycles;\r
+ }\r
+\r
// repair some globals\r
for(i=0;i<=62;i+=2)\r
load_register(H_Reverb+i, cycles);\r
load_register(H_SPUReverbAddr, cycles);\r
load_register(H_SPUrvolL, cycles);\r
load_register(H_SPUrvolR, cycles);\r
-\r
- load_register(H_SPUctrl, cycles);\r
- load_register(H_SPUstat, cycles);\r
load_register(H_CDLeft, cycles);\r
load_register(H_CDRight, cycles);\r
\r
+ // reverb\r
+ spu.rvb->StartAddr = regAreaGet(H_SPUReverbAddr) << 2;\r
if (spu.rvb->CurrAddr < spu.rvb->StartAddr)\r
spu.rvb->CurrAddr = spu.rvb->StartAddr;\r
// fix to prevent new interpolations from crashing\r
spu.s_chan[i].pCurr+=(uintptr_t)spu.spuMemC;\r
spu.s_chan[i].pLoop+=(uintptr_t)spu.spuMemC;\r
}\r
+\r
return pFO;\r
}\r
\r
cycle_diff = cycles_to - spu.cycles_played;
if (cycle_diff < -2*1048576 || cycle_diff > 2*1048576)
{
- //xprintf("desync %u %d\n", cycles_to, cycle_diff);
+ log_unhandled("desync %u %d\n", cycles_to, cycle_diff);
spu.cycles_played = cycles_to;
return;
}
ns_to = (cycle_diff / 768 + 1) & ~1;
if (ns_to > NSSIZE) {
// should never happen
- //xprintf("ns_to oflow %d %d\n", ns_to, NSSIZE);
+ log_unhandled("ns_to oflow %d %d\n", ns_to, NSSIZE);
ns_to = NSSIZE;
}