From: notaz Date: Tue, 10 Oct 2023 23:14:08 +0000 (+0300) Subject: unbreak some old savestates X-Git-Tag: r24~118 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=d0af6d75e0f944f31c8c88d053bf88b990fbcfb8 unbreak some old savestates I have too many of them --- diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index ab8beeea..02191c71 100644 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -561,6 +561,7 @@ void psxRcntInit() s32 psxRcntFreeze( void *f, s32 Mode ) { u32 spuSyncCount = 0; + u32 count; s32 i; gzfreeze( &rcnts, sizeof(Rcnt) * CounterQuantity ); @@ -573,7 +574,12 @@ s32 psxRcntFreeze( void *f, s32 Mode ) { rcnts[3].rate = 1; for( i = 0; i < CounterQuantity - 1; ++i ) + { _psxRcntWmode( i, rcnts[i].mode ); + count = (psxRegs.cycle - rcnts[i].cycleStart) / rcnts[i].rate; + if (count > 0x1000) + _psxRcntWcount( i, count & 0xffff ); + } scheduleRcntBase(); psxRcntSet(); } diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index fca387d1..d752acf2 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -190,7 +190,7 @@ typedef union union { struct { int pos; - signed short val[4]; + int val[4]; } gauss; int simple[5]; // 28-32 } interp; diff --git a/plugins/dfsound/freeze.c b/plugins/dfsound/freeze.c index c4afad83..8816a51c 100644 --- a/plugins/dfsound/freeze.c +++ b/plugins/dfsound/freeze.c @@ -341,6 +341,8 @@ long CALLBACK SPUfreeze(uint32_t ulFreezeMode, SPUFreeze_t * pF, load_register(H_CDLeft, cycles); load_register(H_CDRight, cycles); + if (spu.rvb->CurrAddr < spu.rvb->StartAddr) + spu.rvb->CurrAddr = spu.rvb->StartAddr; // fix to prevent new interpolations from crashing spu.interpolation = -1;