diff options
| author | 2019-04-18 15:57:16 -0400 | |
|---|---|---|
| committer | 2019-04-18 16:39:54 -0400 | |
| commit | 19f8f86bdbe86486017e2fd60ecc17a799bf9a96 (patch) | |
| tree | 77b06d9cfe6ca8bfb7bad1fcbedf16b9a5e29440 /src | |
| parent | Merge pull request #2397 from lioncash/thread-unused (diff) | |
| download | yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar.gz yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.tar.xz yuzu-19f8f86bdbe86486017e2fd60ecc17a799bf9a96.zip | |
service/audctl: Implement GetTargetVolumeMin() and GetTargetVolumeMax()
These two service functions are literally hardcoded to always return
these values without any other error checking.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/audio/audctl.cpp | 30 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audctl.h | 4 |
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 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/logging/log.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | ||
| 5 | #include "core/hle/service/audio/audctl.h" | 7 | #include "core/hle/service/audio/audctl.h" |
| 6 | 8 | ||
| 7 | namespace Service::Audio { | 9 | namespace Service::Audio { |
| @@ -11,8 +13,8 @@ AudCtl::AudCtl() : ServiceFramework{"audctl"} { | |||
| 11 | static const FunctionInfo functions[] = { | 13 | static const FunctionInfo functions[] = { |
| 12 | {0, nullptr, "GetTargetVolume"}, | 14 | {0, nullptr, "GetTargetVolume"}, |
| 13 | {1, nullptr, "SetTargetVolume"}, | 15 | {1, nullptr, "SetTargetVolume"}, |
| 14 | {2, nullptr, "GetTargetVolumeMin"}, | 16 | {2, &AudCtl::GetTargetVolumeMin, "GetTargetVolumeMin"}, |
| 15 | {3, nullptr, "GetTargetVolumeMax"}, | 17 | {3, &AudCtl::GetTargetVolumeMax, "GetTargetVolumeMax"}, |
| 16 | {4, nullptr, "IsTargetMute"}, | 18 | {4, nullptr, "IsTargetMute"}, |
| 17 | {5, nullptr, "SetTargetMute"}, | 19 | {5, nullptr, "SetTargetMute"}, |
| 18 | {6, nullptr, "IsTargetConnected"}, | 20 | {6, nullptr, "IsTargetConnected"}, |
| @@ -44,4 +46,28 @@ AudCtl::AudCtl() : ServiceFramework{"audctl"} { | |||
| 44 | 46 | ||
| 45 | AudCtl::~AudCtl() = default; | 47 | AudCtl::~AudCtl() = default; |
| 46 | 48 | ||
| 49 | void AudCtl::GetTargetVolumeMin(Kernel::HLERequestContext& ctx) { | ||
| 50 | LOG_DEBUG(Audio, "called."); | ||
| 51 | |||
| 52 | // This service function is currently hardcoded on the | ||
| 53 | // actual console to this value (as of 6.0.0). | ||
| 54 | constexpr s32 target_min_volume = 0; | ||
| 55 | |||
| 56 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 57 | rb.Push(RESULT_SUCCESS); | ||
| 58 | rb.Push(target_min_volume); | ||
| 59 | } | ||
| 60 | |||
| 61 | void AudCtl::GetTargetVolumeMax(Kernel::HLERequestContext& ctx) { | ||
| 62 | LOG_DEBUG(Audio, "called."); | ||
| 63 | |||
| 64 | // This service function is currently hardcoded on the | ||
| 65 | // actual console to this value (as of 6.0.0). | ||
| 66 | constexpr s32 target_max_volume = 15; | ||
| 67 | |||
| 68 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 69 | rb.Push(RESULT_SUCCESS); | ||
| 70 | rb.Push(target_max_volume); | ||
| 71 | } | ||
| 72 | |||
| 47 | } // namespace Service::Audio | 73 | } // 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> { | |||
| 12 | public: | 12 | public: |
| 13 | explicit AudCtl(); | 13 | explicit AudCtl(); |
| 14 | ~AudCtl() override; | 14 | ~AudCtl() override; |
| 15 | |||
| 16 | private: | ||
| 17 | void GetTargetVolumeMin(Kernel::HLERequestContext& ctx); | ||
| 18 | void GetTargetVolumeMax(Kernel::HLERequestContext& ctx); | ||
| 15 | }; | 19 | }; |
| 16 | 20 | ||
| 17 | } // namespace Service::Audio | 21 | } // namespace Service::Audio |