From 90d6babfb008b023de677866764a2db0167ec970 Mon Sep 17 00:00:00 2001
From: Connor McLaughlin <stenzek@gmail.com>
Date: Sat, 14 Mar 2020 15:01:23 +1000
Subject: [PATCH] SPU: Always run, not only when enabled

---
 src/core/spu.cpp | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/core/spu.cpp b/src/core/spu.cpp
index 1ba2addfe..67c96d4d7 100644
--- a/src/core/spu.cpp
+++ b/src/core/spu.cpp
@@ -626,8 +626,6 @@ void SPU::IncrementCaptureBufferPosition()
 
 void SPU::Execute(TickCount ticks)
 {
-  DebugAssert(m_SPUCNT.enable || m_SPUCNT.cd_audio_enable);
-
   u32 remaining_frames = static_cast<u32>((ticks + m_ticks_carry) / SYSCLK_TICKS_PER_SPU_TICK);
   m_ticks_carry = (ticks + m_ticks_carry) % SYSCLK_TICKS_PER_SPU_TICK;
 
@@ -697,19 +695,13 @@ void SPU::Execute(TickCount ticks)
 
 void SPU::UpdateEventInterval()
 {
-  if (!m_SPUCNT.enable && !m_SPUCNT.cd_audio_enable)
-  {
-    m_sample_event->Deactivate();
-    return;
-  }
-
   // Don't generate more than the audio buffer since in a single slice, otherwise we'll both overflow the buffers when
   // we do write it, and the audio thread will underflow since it won't have enough data it the game isn't messing with
   // the SPU state.
   const u32 max_slice_frames = m_system->GetHostInterface()->GetAudioStream()->GetBufferSize();
 
   // TODO: Make this predict how long until the interrupt will be hit instead...
-  const u32 interval = m_SPUCNT.irq9_enable ? 1 : max_slice_frames;
+  const u32 interval = (m_SPUCNT.enable && m_SPUCNT.irq9_enable) ? 1 : max_slice_frames;
   const TickCount interval_ticks = static_cast<TickCount>(interval) * SYSCLK_TICKS_PER_SPU_TICK;
   if (m_sample_event->IsActive() && m_sample_event->GetInterval() == interval_ticks)
     return;