summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2019-06-16 20:18:35 +1000
committerGravatar David Marcec2019-06-16 20:18:35 +1000
commit5fb6781c6104a618ee366c444725e32765a0c534 (patch)
tree8df22f0172e08926f9f9057f5f31e357fa56aa58 /src
parentImpl'd IsUserAccountSwitchLocked, SetAudioOutVolume, GetAudioOutVolume & Part... (diff)
downloadyuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar.gz
yuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar.xz
yuzu-5fb6781c6104a618ee366c444725e32765a0c534.zip
Cleanup
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/stream.h2
-rw-r--r--src/core/hle/service/acc/acc.cpp23
-rw-r--r--src/core/hle/service/acc/acc.h4
-rw-r--r--src/core/hle/service/acc/acc_aa.cpp5
-rw-r--r--src/core/hle/service/acc/acc_aa.h4
-rw-r--r--src/core/hle/service/acc/acc_su.cpp5
-rw-r--r--src/core/hle/service/acc/acc_su.h4
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp5
-rw-r--r--src/core/hle/service/acc/acc_u0.h4
-rw-r--r--src/core/hle/service/acc/acc_u1.cpp5
-rw-r--r--src/core/hle/service/acc/acc_u1.h4
-rw-r--r--src/core/hle/service/audio/audout_u.cpp4
12 files changed, 39 insertions, 30 deletions
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h
index 97458c80a..8106cea43 100644
--- a/src/audio_core/stream.h
+++ b/src/audio_core/stream.h
@@ -100,6 +100,7 @@ private:
100 100
101 u32 sample_rate; ///< Sample rate of the stream 101 u32 sample_rate; ///< Sample rate of the stream
102 Format format; ///< Format of the stream 102 Format format; ///< Format of the stream
103 float game_volume = 1.0f; ///< The volume the game currently has set
103 ReleaseCallback release_callback; ///< Buffer release callback for the stream 104 ReleaseCallback release_callback; ///< Buffer release callback for the stream
104 State state{State::Stopped}; ///< Playback state of the stream 105 State state{State::Stopped}; ///< Playback state of the stream
105 Core::Timing::EventType* release_event{}; ///< Core timing release event for the stream 106 Core::Timing::EventType* release_event{}; ///< Core timing release event for the stream
@@ -109,7 +110,6 @@ private:
109 SinkStream& sink_stream; ///< Output sink for the stream 110 SinkStream& sink_stream; ///< Output sink for the stream
110 Core::Timing::CoreTiming& core_timing; ///< Core timing instance. 111 Core::Timing::CoreTiming& core_timing; ///< Core timing instance.
111 std::string name; ///< Name of the stream, must be unique 112 std::string name; ///< Name of the stream, must be unique
112 float game_volume = 1.0f; ///< The volume the game currently has set
113}; 113};
114 114
115using StreamPtr = std::shared_ptr<Stream>; 115using StreamPtr = std::shared_ptr<Stream>;
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 7a4fd636b..f02f54f91 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -233,13 +233,13 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo
233void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) { 233void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) {
234 LOG_DEBUG(Service_ACC, "called"); 234 LOG_DEBUG(Service_ACC, "called");
235 FileSys::NACP nacp; 235 FileSys::NACP nacp;
236 const auto res = Core::System::GetInstance().GetAppLoader().ReadControlData(nacp); 236 const auto res = system.GetAppLoader().ReadControlData(nacp);
237 237
238 bool is_locked = false; 238 bool is_locked = false;
239 239
240 if (res != Loader::ResultStatus::Success) { 240 if (res != Loader::ResultStatus::Success) {
241 FileSys::PatchManager pm{Core::CurrentProcess()->GetTitleID()}; 241 FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()};
242 auto [nacp_unique, discard] = pm.GetControlMetadata(); 242 auto nacp_unique = pm.GetControlMetadata().first;
243 243
244 if (nacp_unique != nullptr) { 244 if (nacp_unique != nullptr) {
245 is_locked = nacp_unique->GetUserAccountSwitchLock(); 245 is_locked = nacp_unique->GetUserAccountSwitchLock();
@@ -250,7 +250,7 @@ void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx
250 250
251 IPC::ResponseBuilder rb{ctx, 3}; 251 IPC::ResponseBuilder rb{ctx, 3};
252 rb.Push(RESULT_SUCCESS); 252 rb.Push(RESULT_SUCCESS);
253 rb.PushRaw<u8>(is_locked); 253 rb.Push(is_locked);
254} 254}
255 255
256void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) { 256void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) {
@@ -278,19 +278,22 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex
278} 278}
279 279
280Module::Interface::Interface(std::shared_ptr<Module> module, 280Module::Interface::Interface(std::shared_ptr<Module> module,
281 std::shared_ptr<ProfileManager> profile_manager, const char* name) 281 std::shared_ptr<ProfileManager> profile_manager, Core::System& system,
282 const char* name)
282 : ServiceFramework(name), module(std::move(module)), 283 : ServiceFramework(name), module(std::move(module)),
283 profile_manager(std::move(profile_manager)) {} 284 profile_manager(std::move(profile_manager)), system(system) {}
284 285
285Module::Interface::~Interface() = default; 286Module::Interface::~Interface() = default;
286 287
287void InstallInterfaces(SM::ServiceManager& service_manager) { 288void InstallInterfaces(SM::ServiceManager& service_manager) {
288 auto module = std::make_shared<Module>(); 289 auto module = std::make_shared<Module>();
289 auto profile_manager = std::make_shared<ProfileManager>(); 290 auto profile_manager = std::make_shared<ProfileManager>();
290 std::make_shared<ACC_AA>(module, profile_manager)->InstallAsService(service_manager); 291 Core::System& system = Core::System::GetInstance();
291 std::make_shared<ACC_SU>(module, profile_manager)->InstallAsService(service_manager); 292
292 std::make_shared<ACC_U0>(module, profile_manager)->InstallAsService(service_manager); 293 std::make_shared<ACC_AA>(module, profile_manager, system)->InstallAsService(service_manager);
293 std::make_shared<ACC_U1>(module, profile_manager)->InstallAsService(service_manager); 294 std::make_shared<ACC_SU>(module, profile_manager, system)->InstallAsService(service_manager);
295 std::make_shared<ACC_U0>(module, profile_manager, system)->InstallAsService(service_manager);
296 std::make_shared<ACC_U1>(module, profile_manager, system)->InstallAsService(service_manager);
294} 297}
295 298
296} // namespace Service::Account 299} // namespace Service::Account
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h
index 6d90af3f1..47a7c46d7 100644
--- a/src/core/hle/service/acc/acc.h
+++ b/src/core/hle/service/acc/acc.h
@@ -15,7 +15,8 @@ public:
15 class Interface : public ServiceFramework<Interface> { 15 class Interface : public ServiceFramework<Interface> {
16 public: 16 public:
17 explicit Interface(std::shared_ptr<Module> module, 17 explicit Interface(std::shared_ptr<Module> module,
18 std::shared_ptr<ProfileManager> profile_manager, const char* name); 18 std::shared_ptr<ProfileManager> profile_manager, Core::System& system,
19 const char* name);
19 ~Interface() override; 20 ~Interface() override;
20 21
21 void GetUserCount(Kernel::HLERequestContext& ctx); 22 void GetUserCount(Kernel::HLERequestContext& ctx);
@@ -33,6 +34,7 @@ public:
33 protected: 34 protected:
34 std::shared_ptr<Module> module; 35 std::shared_ptr<Module> module;
35 std::shared_ptr<ProfileManager> profile_manager; 36 std::shared_ptr<ProfileManager> profile_manager;
37 Core::System& system;
36 }; 38 };
37}; 39};
38 40
diff --git a/src/core/hle/service/acc/acc_aa.cpp b/src/core/hle/service/acc/acc_aa.cpp
index e84d9f7cf..3bac6bcd1 100644
--- a/src/core/hle/service/acc/acc_aa.cpp
+++ b/src/core/hle/service/acc/acc_aa.cpp
@@ -6,8 +6,9 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_AA::ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) 9ACC_AA::ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:aa") { 10 Core::System& system)
11 : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:aa") {
11 static const FunctionInfo functions[] = { 12 static const FunctionInfo functions[] = {
12 {0, nullptr, "EnsureCacheAsync"}, 13 {0, nullptr, "EnsureCacheAsync"},
13 {1, nullptr, "LoadCache"}, 14 {1, nullptr, "LoadCache"},
diff --git a/src/core/hle/service/acc/acc_aa.h b/src/core/hle/service/acc/acc_aa.h
index 9edb0421b..932c04890 100644
--- a/src/core/hle/service/acc/acc_aa.h
+++ b/src/core/hle/service/acc/acc_aa.h
@@ -10,8 +10,8 @@ namespace Service::Account {
10 10
11class ACC_AA final : public Module::Interface { 11class ACC_AA final : public Module::Interface {
12public: 12public:
13 explicit ACC_AA(std::shared_ptr<Module> module, 13 explicit ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
14 std::shared_ptr<ProfileManager> profile_manager); 14 Core::System& system);
15 ~ACC_AA() override; 15 ~ACC_AA() override;
16}; 16};
17 17
diff --git a/src/core/hle/service/acc/acc_su.cpp b/src/core/hle/service/acc/acc_su.cpp
index d66233cad..1b7ec3ed0 100644
--- a/src/core/hle/service/acc/acc_su.cpp
+++ b/src/core/hle/service/acc/acc_su.cpp
@@ -6,8 +6,9 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) 9ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:su") { 10 Core::System& system)
11 : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:su") {
11 // clang-format off 12 // clang-format off
12 static const FunctionInfo functions[] = { 13 static const FunctionInfo functions[] = {
13 {0, &ACC_SU::GetUserCount, "GetUserCount"}, 14 {0, &ACC_SU::GetUserCount, "GetUserCount"},
diff --git a/src/core/hle/service/acc/acc_su.h b/src/core/hle/service/acc/acc_su.h
index fcced063a..0a700d9bf 100644
--- a/src/core/hle/service/acc/acc_su.h
+++ b/src/core/hle/service/acc/acc_su.h
@@ -10,8 +10,8 @@ namespace Service::Account {
10 10
11class ACC_SU final : public Module::Interface { 11class ACC_SU final : public Module::Interface {
12public: 12public:
13 explicit ACC_SU(std::shared_ptr<Module> module, 13 explicit ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
14 std::shared_ptr<ProfileManager> profile_manager); 14 Core::System& system);
15 ~ACC_SU() override; 15 ~ACC_SU() override;
16}; 16};
17 17
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp
index 932838c41..2f239e8c0 100644
--- a/src/core/hle/service/acc/acc_u0.cpp
+++ b/src/core/hle/service/acc/acc_u0.cpp
@@ -6,8 +6,9 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) 9ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:u0") { 10 Core::System& system)
11 : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:u0") {
11 // clang-format off 12 // clang-format off
12 static const FunctionInfo functions[] = { 13 static const FunctionInfo functions[] = {
13 {0, &ACC_U0::GetUserCount, "GetUserCount"}, 14 {0, &ACC_U0::GetUserCount, "GetUserCount"},
diff --git a/src/core/hle/service/acc/acc_u0.h b/src/core/hle/service/acc/acc_u0.h
index a1290e0bd..3bd9c3164 100644
--- a/src/core/hle/service/acc/acc_u0.h
+++ b/src/core/hle/service/acc/acc_u0.h
@@ -10,8 +10,8 @@ namespace Service::Account {
10 10
11class ACC_U0 final : public Module::Interface { 11class ACC_U0 final : public Module::Interface {
12public: 12public:
13 explicit ACC_U0(std::shared_ptr<Module> module, 13 explicit ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
14 std::shared_ptr<ProfileManager> profile_manager); 14 Core::System& system);
15 ~ACC_U0() override; 15 ~ACC_U0() override;
16}; 16};
17 17
diff --git a/src/core/hle/service/acc/acc_u1.cpp b/src/core/hle/service/acc/acc_u1.cpp
index 2dd17d935..6520b3968 100644
--- a/src/core/hle/service/acc/acc_u1.cpp
+++ b/src/core/hle/service/acc/acc_u1.cpp
@@ -6,8 +6,9 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) 9ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:u1") { 10 Core::System& system)
11 : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:u1") {
11 // clang-format off 12 // clang-format off
12 static const FunctionInfo functions[] = { 13 static const FunctionInfo functions[] = {
13 {0, &ACC_U1::GetUserCount, "GetUserCount"}, 14 {0, &ACC_U1::GetUserCount, "GetUserCount"},
diff --git a/src/core/hle/service/acc/acc_u1.h b/src/core/hle/service/acc/acc_u1.h
index 9e79daee3..829f8a744 100644
--- a/src/core/hle/service/acc/acc_u1.h
+++ b/src/core/hle/service/acc/acc_u1.h
@@ -10,8 +10,8 @@ namespace Service::Account {
10 10
11class ACC_U1 final : public Module::Interface { 11class ACC_U1 final : public Module::Interface {
12public: 12public:
13 explicit ACC_U1(std::shared_ptr<Module> module, 13 explicit ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
14 std::shared_ptr<ProfileManager> profile_manager); 14 Core::System& system);
15 ~ACC_U1() override; 15 ~ACC_U1() override;
16}; 16};
17 17
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index 0004f2f47..7db6eb08d 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -185,7 +185,7 @@ private:
185 185
186 void SetAudioOutVolume(Kernel::HLERequestContext& ctx) { 186 void SetAudioOutVolume(Kernel::HLERequestContext& ctx) {
187 IPC::RequestParser rp{ctx}; 187 IPC::RequestParser rp{ctx};
188 float volume = rp.PopRaw<float>(); 188 const float volume = rp.Pop<float>();
189 LOG_DEBUG(Service_Audio, "called, volume={}", volume); 189 LOG_DEBUG(Service_Audio, "called, volume={}", volume);
190 190
191 stream->SetVolume(volume); 191 stream->SetVolume(volume);
@@ -199,7 +199,7 @@ private:
199 199
200 IPC::ResponseBuilder rb{ctx, 3}; 200 IPC::ResponseBuilder rb{ctx, 3};
201 rb.Push(RESULT_SUCCESS); 201 rb.Push(RESULT_SUCCESS);
202 rb.PushRaw<float>(stream->GetVolume()); 202 rb.Push(stream->GetVolume());
203 } 203 }
204 204
205 AudioCore::AudioOut& audio_core; 205 AudioCore::AudioOut& audio_core;