uint32_t XALastVal;\r
uint32_t last_keyon_cycles;\r
uint32_t rvb_sb[2][4];\r
+ int32_t interpolation; // which interpolation's data is in SPUCHAN_orig::SB\r
\r
} SPUOSSFreeze_t;\r
\r
// SPUFREEZE: called by main emu on savestate load/save\r
////////////////////////////////////////////////////////////////////////\r
\r
-long CALLBACK SPUfreeze(unsigned int ulFreezeMode, SPUFreeze_t * pF,\r
+long DoFreeze(unsigned int ulFreezeMode, SPUFreeze_t * pF,\r
unsigned int cycles)\r
{\r
SPUOSSFreeze_t * pFO = NULL;\r
pFO->last_keyon_cycles = spu.last_keyon_cycles;\r
for (i = 0; i < 2; i++)\r
memcpy(&pFO->rvb_sb[i], sb_rvb->SB_rvb[i], sizeof(pFO->rvb_sb[i]));\r
+ pFO->interpolation = spu.interpolation;\r
\r
for(i=0;i<MAXCHAN;i++)\r
{\r
spu.XARepeat = 0;\r
spu.XALastVal = 0;\r
spu.last_keyon_cycles = cycles - 16*786u;\r
+ spu.interpolation = -1;\r
if (pFO && pF->ulFreezeSize >= sizeof(*pF) + offsetof(SPUOSSFreeze_t, rvb_sb)) {\r
spu.cycles_dma_end = pFO->cycles_dma_end;\r
spu.decode_dirty_ch = pFO->decode_dirty_ch;\r
for (i = 0; i < 2; i++)\r
for (j = 0; j < 2; j++)\r
memcpy(&sb_rvb->SB_rvb[i][j*4], pFO->rvb_sb[i], 4 * sizeof(sb_rvb->SB_rvb[i][0]));\r
+ spu.interpolation = pFO->interpolation;\r
}\r
\r
// repair some globals\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.interpolation = -1;\r
\r
ClearWorkingState();\r
\r
#endif
+long CALLBACK SPUfreeze(unsigned int ulFreezeMode, struct SPUFreeze * pF,
+ unsigned int cycles)
+{
+ sync_worker_thread(1);
+ return DoFreeze(ulFreezeMode, pF, cycles);
+}
+
// SPUINIT: this func will be called first by the main emu
long CALLBACK SPUinit(void)
{