unbreak some old savestates
authornotaz <notasas@gmail.com>
Tue, 10 Oct 2023 23:14:08 +0000 (02:14 +0300)
committernotaz <notasas@gmail.com>
Tue, 10 Oct 2023 23:14:08 +0000 (02:14 +0300)
I have too many of them

libpcsxcore/psxcounters.c
plugins/dfsound/externals.h
plugins/dfsound/freeze.c

index ab8beee..02191c7 100644 (file)
@@ -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();
     }
index fca387d..d752acf 100644 (file)
@@ -190,7 +190,7 @@ typedef union
   union {\r
    struct {\r
     int pos;\r
-    signed short val[4];\r
+    int val[4];\r
    } gauss;\r
    int simple[5]; // 28-32\r
   } interp;\r
index c4afad8..8816a51 100644 (file)
@@ -341,6 +341,8 @@ long CALLBACK SPUfreeze(uint32_t ulFreezeMode, SPUFreeze_t * pF,
  load_register(H_CDLeft, cycles);\r
  load_register(H_CDRight, cycles);\r
 \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