diff --git a/src/audio_core/dsp_interface.h b/src/audio_core/dsp_interface.h index f44c77534a..5d7119cb6e 100644 --- a/src/audio_core/dsp_interface.h +++ b/src/audio_core/dsp_interface.h @@ -47,6 +47,12 @@ public: */ virtual bool RecvDataIsReady(u32 register_number) const = 0; + /** + * Sets the DSP semaphore register + * @param semaphore_value the value set to the semaphore register + */ + virtual void SetSemaphore(u16 semaphore_value) = 0; + /** * Reads `length` bytes from the DSP pipe identified with `pipe_number`. * @note Can read up to the maximum value of a u16 in bytes (65,535). diff --git a/src/audio_core/hle/hle.cpp b/src/audio_core/hle/hle.cpp index 3b3d03d55d..c5f3d0f440 100644 --- a/src/audio_core/hle/hle.cpp +++ b/src/audio_core/hle/hle.cpp @@ -375,6 +375,10 @@ bool DspHle::RecvDataIsReady(u32 register_number) const { return impl->RecvDataIsReady(register_number); } +void DspHle::SetSemaphore(u16 semaphore_value) { + // Do nothing in HLE +} + std::vector DspHle::PipeRead(DspPipe pipe_number, u32 length) { return impl->PipeRead(pipe_number, length); } diff --git a/src/audio_core/hle/hle.h b/src/audio_core/hle/hle.h index 8db78cf53a..1c756b60fa 100644 --- a/src/audio_core/hle/hle.h +++ b/src/audio_core/hle/hle.h @@ -26,6 +26,7 @@ public: u16 RecvData(u32 register_number) override; bool RecvDataIsReady(u32 register_number) const override; + void SetSemaphore(u16 semaphore_value) override; std::vector PipeRead(DspPipe pipe_number, u32 length) override; std::size_t GetPipeReadableSize(DspPipe pipe_number) const override; void PipeWrite(DspPipe pipe_number, const std::vector& buffer) override; diff --git a/src/audio_core/lle/lle.cpp b/src/audio_core/lle/lle.cpp index 7c9da30e20..bc030b77c9 100644 --- a/src/audio_core/lle/lle.cpp +++ b/src/audio_core/lle/lle.cpp @@ -27,6 +27,10 @@ bool DspLle::RecvDataIsReady(u32 register_number) const { return impl->teakra.RecvDataIsReady(register_number); } +void DspLle::SetSemaphore(u16 semaphore_value) { + impl->teakra.SetSemaphore(semaphore_value); +} + DspLle::DspLle() : impl(std::make_unique()) {} DspLle::~DspLle() = default; diff --git a/src/audio_core/lle/lle.h b/src/audio_core/lle/lle.h index dc5def3dd3..d6f7160d67 100644 --- a/src/audio_core/lle/lle.h +++ b/src/audio_core/lle/lle.h @@ -15,6 +15,7 @@ public: u16 RecvData(u32 register_number) override; bool RecvDataIsReady(u32 register_number) const override; + void SetSemaphore(u16 semaphore_value) override; private: struct Impl; diff --git a/src/core/hle/service/dsp/dsp_dsp.cpp b/src/core/hle/service/dsp/dsp_dsp.cpp index 6acfad5660..97993a30ec 100644 --- a/src/core/hle/service/dsp/dsp_dsp.cpp +++ b/src/core/hle/service/dsp/dsp_dsp.cpp @@ -46,6 +46,8 @@ void DSP_DSP::SetSemaphore(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x07, 1, 0); const u16 semaphore_value = rp.Pop(); + system.DSP().SetSemaphore(semaphore_value); + IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS);