Skip to content

Commit

Permalink
unbreak some old savestates
Browse files Browse the repository at this point in the history
I have too many of them
  • Loading branch information
notaz committed Oct 10, 2023
1 parent 561aa7a commit d0af6d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions libpcsxcore/psxcounters.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ void psxRcntInit()
s32 psxRcntFreeze( void *f, s32 Mode )
{
u32 spuSyncCount = 0;
u32 count;
s32 i;

gzfreeze( &rcnts, sizeof(Rcnt) * CounterQuantity );
Expand All @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/dfsound/externals.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ typedef union
union {
struct {
int pos;
signed short val[4];
int val[4];
} gauss;
int simple[5]; // 28-32
} interp;
Expand Down
2 changes: 2 additions & 0 deletions plugins/dfsound/freeze.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d0af6d7

Please sign in to comment.