VERY experimental Nintendo Switch 2 emulator
C++
Service/Audio: add hwopus service, stub GetWorkBufferSize function
mailwl5ffac050999c
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txtindex 51e4088d24..3dff068df6 100644--- a/src/core/CMakeLists.txt+++ b/src/core/CMakeLists.txt@@ -126,6 +126,8 @@ add_library(core STATIChle/service/audio/audren_u.hhle/service/audio/codecctl.cpphle/service/audio/codecctl.h+ hle/service/audio/hwopus.cpp+ hle/service/audio/hwopus.hhle/service/bcat/module.cpphle/service/bcat/module.hhle/service/bcat/bcat.cppdiff --git a/src/core/hle/service/audio/audio.cpp b/src/core/hle/service/audio/audio.cppindex 92f910b5f4..d231e91e1d 100644--- a/src/core/hle/service/audio/audio.cpp+++ b/src/core/hle/service/audio/audio.cpp@@ -8,6 +8,7 @@#include "core/hle/service/audio/audrec_u.h"#include "core/hle/service/audio/audren_u.h"#include "core/hle/service/audio/codecctl.h"+#include "core/hle/service/audio/hwopus.h"namespace Service::Audio {@@ -17,6 +18,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {std::make_shared<AudRecU>()->InstallAsService(service_manager);std::make_shared<AudRenU>()->InstallAsService(service_manager);std::make_shared<CodecCtl>()->InstallAsService(service_manager);+ std::make_shared<HwOpus>()->InstallAsService(service_manager);}} // namespace Service::Audiodiff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cppnew file mode 100644index 0000000000..7790359e9e--- /dev/null+++ b/src/core/hle/service/audio/hwopus.cpp@@ -0,0 +1,29 @@+// Copyright 2018 yuzu emulator team+// Licensed under GPLv2 or any later version+// Refer to the license.txt file included.++#include "common/logging/log.h"+#include "core/hle/ipc_helpers.h"+#include "core/hle/kernel/hle_ipc.h"+#include "core/hle/service/audio/hwopus.h"++namespace Service::Audio {++void HwOpus::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {+ NGLOG_WARNING(Service_Audio, "(STUBBED) called");+ IPC::ResponseBuilder rb{ctx, 3};+ rb.Push(RESULT_SUCCESS);+ rb.Push<u32>(0x4000);+}++HwOpus::HwOpus() : ServiceFramework("hwopus") {+ static const FunctionInfo functions[] = {+ {0, nullptr, "Initialize"},+ {1, &HwOpus::GetWorkBufferSize, "GetWorkBufferSize"},+ {2, nullptr, "InitializeMultiStream"},+ {3, nullptr, "GetWorkBufferSizeMultiStream"},+ };+ RegisterHandlers(functions);+}++} // namespace Service::Audiodiff --git a/src/core/hle/service/audio/hwopus.h b/src/core/hle/service/audio/hwopus.hnew file mode 100644index 0000000000..090b8c8257--- /dev/null+++ b/src/core/hle/service/audio/hwopus.h@@ -0,0 +1,20 @@+// Copyright 2018 yuzu emulator team+// Licensed under GPLv2 or any later version+// Refer to the license.txt file included.++#pragma once++#include "core/hle/service/service.h"++namespace Service::Audio {++class HwOpus final : public ServiceFramework<HwOpus> {+public:+ explicit HwOpus();+ ~HwOpus() = default;++private:+ void GetWorkBufferSize(Kernel::HLERequestContext& ctx);+};++} // namespace Service::Audio