diff --git a/src/audio_core/hle/hle.cpp b/src/audio_core/hle/hle.cpp index 6b331b277..ecb2fb81c 100644 --- a/src/audio_core/hle/hle.cpp +++ b/src/audio_core/hle/hle.cpp @@ -114,8 +114,7 @@ private: ar& dsp_memory.raw_memory; ar& sources; ar& mixers; - // interrupt_handler is function pointer and cant be serialised, fortunately though, it - // should be registerd before the game has started + // interrupt_handler is reregistered when loading state from DSP_DSP } friend class boost::serialization::access; }; diff --git a/src/core/hle/service/dsp/dsp_dsp.cpp b/src/core/hle/service/dsp/dsp_dsp.cpp index fd28925a0..54cb58071 100644 --- a/src/core/hle/service/dsp/dsp_dsp.cpp +++ b/src/core/hle/service/dsp/dsp_dsp.cpp @@ -394,6 +394,12 @@ DSP_DSP::DSP_DSP(Core::System& system) semaphore_event->SetHLENotifier( [this]() { this->system.DSP().SetSemaphore(preset_semaphore); }); + + system.DSP().SetInterruptHandler([dsp_ref = this](InterruptType type, DspPipe pipe) { + if (dsp_ref) { + dsp_ref->SignalInterrupt(type, pipe); + } + }); } DSP_DSP::~DSP_DSP() { @@ -405,12 +411,6 @@ void InstallInterfaces(Core::System& system) { auto& service_manager = system.ServiceManager(); auto dsp = std::make_shared(system); dsp->InstallAsService(service_manager); - system.DSP().SetInterruptHandler( - [dsp_ref = std::weak_ptr(dsp)](InterruptType type, DspPipe pipe) { - if (auto locked = dsp_ref.lock()) { - locked->SignalInterrupt(type, pipe); - } - }); } } // namespace Service::DSP