summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-04-18 21:57:16 +0200
committerLioncash <mathew1800@gmail.com>2019-04-18 22:39:54 +0200
commit19f8f86bdbe86486017e2fd60ecc17a799bf9a96 (patch)
tree77b06d9cfe6ca8bfb7bad1fcbedf16b9a5e29440 /src/core/hle/service
parentMerge pull request #2397 from lioncash/thread-unused (diff)
downloadyuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar
yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar.gz
yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar.bz2
yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar.lz
yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar.xz
yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar.zst
yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/audio/audctl.cpp30
-rw-r--r--src/core/hle/service/audio/audctl.h4
2 files changed, 32 insertions, 2 deletions
diff --git a/src/core/hle/service/audio/audctl.cpp b/src/core/hle/service/audio/audctl.cpp
index b6b71f966..f43e512e9 100644
--- a/src/core/hle/service/audio/audctl.cpp
+++ b/src/core/hle/service/audio/audctl.cpp
@@ -2,6 +2,8 @@
// 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/service/audio/audctl.h"
namespace Service::Audio {
@@ -11,8 +13,8 @@ AudCtl::AudCtl() : ServiceFramework{"audctl"} {
static const FunctionInfo functions[] = {
{0, nullptr, "GetTargetVolume"},
{1, nullptr, "SetTargetVolume"},
- {2, nullptr, "GetTargetVolumeMin"},
- {3, nullptr, "GetTargetVolumeMax"},
+ {2, &AudCtl::GetTargetVolumeMin, "GetTargetVolumeMin"},
+ {3, &AudCtl::GetTargetVolumeMax, "GetTargetVolumeMax"},
{4, nullptr, "IsTargetMute"},
{5, nullptr, "SetTargetMute"},
{6, nullptr, "IsTargetConnected"},
@@ -44,4 +46,28 @@ AudCtl::AudCtl() : ServiceFramework{"audctl"} {
AudCtl::~AudCtl() = default;
+void AudCtl::GetTargetVolumeMin(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Audio, "called.");
+
+ // This service function is currently hardcoded on the
+ // actual console to this value (as of 6.0.0).
+ constexpr s32 target_min_volume = 0;
+
+ IPC::ResponseBuilder rb{ctx, 3};
+ rb.Push(RESULT_SUCCESS);
+ rb.Push(target_min_volume);
+}
+
+void AudCtl::GetTargetVolumeMax(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Audio, "called.");
+
+ // This service function is currently hardcoded on the
+ // actual console to this value (as of 6.0.0).
+ constexpr s32 target_max_volume = 15;
+
+ IPC::ResponseBuilder rb{ctx, 3};
+ rb.Push(RESULT_SUCCESS);
+ rb.Push(target_max_volume);
+}
+
} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audctl.h b/src/core/hle/service/audio/audctl.h
index 9d2d9e83b..c7fafc02e 100644
--- a/src/core/hle/service/audio/audctl.h
+++ b/src/core/hle/service/audio/audctl.h
@@ -12,6 +12,10 @@ class AudCtl final : public ServiceFramework<AudCtl> {
public:
explicit AudCtl();
~AudCtl() override;
+
+private:
+ void GetTargetVolumeMin(Kernel::HLERequestContext& ctx);
+ void GetTargetVolumeMax(Kernel::HLERequestContext& ctx);
};
} // namespace Service::Audio