From 1e715316728a5d0c1edbf901152b3cbde9f05536 Mon Sep 17 00:00:00 2001 From: Zachary Cook Date: Fri, 30 Sep 2022 21:38:35 -0400 Subject: [PATCH] Fix SPU samples setting with loading/runahead --- mednafen/psx/spu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mednafen/psx/spu.cpp b/mednafen/psx/spu.cpp index b64ff2b61..513628aef 100644 --- a/mednafen/psx/spu.cpp +++ b/mednafen/psx/spu.cpp @@ -1452,8 +1452,8 @@ int PS_SPU::StateAction(StateMem *sm, int load, int data_only) Voices[i].LoopAddr &= 0x3FFFF; } - if(clock_divider <= 0 || clock_divider > 768) - clock_divider = 768; + if(clock_divider <= 0 || clock_divider > spu_samples*768) + clock_divider = spu_samples*768; RWAddr &= 0x3FFFF; CWA &= 0x1FF;