mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-10-30 19:57:52 +00:00
dsp_dsp.cpp: fix registering Interrupt handler on loading savestates (#7055)
This commit is contained in:
parent
4220f69c06
commit
1acb03b579
2 changed files with 7 additions and 8 deletions
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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<DSP_DSP>(system);
|
||||
dsp->InstallAsService(service_manager);
|
||||
system.DSP().SetInterruptHandler(
|
||||
[dsp_ref = std::weak_ptr<DSP_DSP>(dsp)](InterruptType type, DspPipe pipe) {
|
||||
if (auto locked = dsp_ref.lock()) {
|
||||
locked->SignalInterrupt(type, pipe);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Service::DSP
|
||||
|
|
Loading…
Reference in a new issue