diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2019-06-16 12:18:35 +0200 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2019-06-16 12:18:35 +0200 |
commit | 5fb6781c6104a618ee366c444725e32765a0c534 (patch) | |
tree | 8df22f0172e08926f9f9057f5f31e357fa56aa58 /src/core | |
parent | Impl'd IsUserAccountSwitchLocked, SetAudioOutVolume, GetAudioOutVolume & Partial impl of GetAccumulatedSuspendedTickChangedEvent (diff) | |
download | yuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar yuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar.gz yuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar.bz2 yuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar.lz yuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar.xz yuzu-5fb6781c6104a618ee366c444725e32765a0c534.tar.zst yuzu-5fb6781c6104a618ee366c444725e32765a0c534.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/acc/acc.cpp | 23 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_aa.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_aa.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_su.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_su.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_u0.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_u0.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_u1.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc_u1.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 4 |
11 files changed, 38 insertions, 29 deletions
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 void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_ACC, "called"); FileSys::NACP nacp; - const auto res = Core::System::GetInstance().GetAppLoader().ReadControlData(nacp); + const auto res = system.GetAppLoader().ReadControlData(nacp); bool is_locked = false; if (res != Loader::ResultStatus::Success) { - FileSys::PatchManager pm{Core::CurrentProcess()->GetTitleID()}; - auto [nacp_unique, discard] = pm.GetControlMetadata(); + FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()}; + auto nacp_unique = pm.GetControlMetadata().first; if (nacp_unique != nullptr) { is_locked = nacp_unique->GetUserAccountSwitchLock(); @@ -250,7 +250,7 @@ void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.PushRaw<u8>(is_locked); + rb.Push(is_locked); } void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) { @@ -278,19 +278,22 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex } Module::Interface::Interface(std::shared_ptr<Module> module, - std::shared_ptr<ProfileManager> profile_manager, const char* name) + std::shared_ptr<ProfileManager> profile_manager, Core::System& system, + const char* name) : ServiceFramework(name), module(std::move(module)), - profile_manager(std::move(profile_manager)) {} + profile_manager(std::move(profile_manager)), system(system) {} Module::Interface::~Interface() = default; void InstallInterfaces(SM::ServiceManager& service_manager) { auto module = std::make_shared<Module>(); auto profile_manager = std::make_shared<ProfileManager>(); - std::make_shared<ACC_AA>(module, profile_manager)->InstallAsService(service_manager); - std::make_shared<ACC_SU>(module, profile_manager)->InstallAsService(service_manager); - std::make_shared<ACC_U0>(module, profile_manager)->InstallAsService(service_manager); - std::make_shared<ACC_U1>(module, profile_manager)->InstallAsService(service_manager); + Core::System& system = Core::System::GetInstance(); + + std::make_shared<ACC_AA>(module, profile_manager, system)->InstallAsService(service_manager); + std::make_shared<ACC_SU>(module, profile_manager, system)->InstallAsService(service_manager); + std::make_shared<ACC_U0>(module, profile_manager, system)->InstallAsService(service_manager); + std::make_shared<ACC_U1>(module, profile_manager, system)->InstallAsService(service_manager); } } // 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: class Interface : public ServiceFramework<Interface> { public: explicit Interface(std::shared_ptr<Module> module, - std::shared_ptr<ProfileManager> profile_manager, const char* name); + std::shared_ptr<ProfileManager> profile_manager, Core::System& system, + const char* name); ~Interface() override; void GetUserCount(Kernel::HLERequestContext& ctx); @@ -33,6 +34,7 @@ public: protected: std::shared_ptr<Module> module; std::shared_ptr<ProfileManager> profile_manager; + Core::System& system; }; }; 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 @@ namespace Service::Account { -ACC_AA::ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) - : Module::Interface(std::move(module), std::move(profile_manager), "acc:aa") { +ACC_AA::ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system) + : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:aa") { static const FunctionInfo functions[] = { {0, nullptr, "EnsureCacheAsync"}, {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 { class ACC_AA final : public Module::Interface { public: - explicit ACC_AA(std::shared_ptr<Module> module, - std::shared_ptr<ProfileManager> profile_manager); + explicit ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system); ~ACC_AA() override; }; 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 @@ namespace Service::Account { -ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) - : Module::Interface(std::move(module), std::move(profile_manager), "acc:su") { +ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system) + : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:su") { // clang-format off static const FunctionInfo functions[] = { {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 { class ACC_SU final : public Module::Interface { public: - explicit ACC_SU(std::shared_ptr<Module> module, - std::shared_ptr<ProfileManager> profile_manager); + explicit ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system); ~ACC_SU() override; }; 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 @@ namespace Service::Account { -ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) - : Module::Interface(std::move(module), std::move(profile_manager), "acc:u0") { +ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system) + : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:u0") { // clang-format off static const FunctionInfo functions[] = { {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 { class ACC_U0 final : public Module::Interface { public: - explicit ACC_U0(std::shared_ptr<Module> module, - std::shared_ptr<ProfileManager> profile_manager); + explicit ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system); ~ACC_U0() override; }; 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 @@ namespace Service::Account { -ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager) - : Module::Interface(std::move(module), std::move(profile_manager), "acc:u1") { +ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system) + : Module::Interface(std::move(module), std::move(profile_manager), system, "acc:u1") { // clang-format off static const FunctionInfo functions[] = { {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 { class ACC_U1 final : public Module::Interface { public: - explicit ACC_U1(std::shared_ptr<Module> module, - std::shared_ptr<ProfileManager> profile_manager); + explicit ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager, + Core::System& system); ~ACC_U1() override; }; 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: void SetAudioOutVolume(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; - float volume = rp.PopRaw<float>(); + const float volume = rp.Pop<float>(); LOG_DEBUG(Service_Audio, "called, volume={}", volume); stream->SetVolume(volume); @@ -199,7 +199,7 @@ private: IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.PushRaw<float>(stream->GetVolume()); + rb.Push(stream->GetVolume()); } AudioCore::AudioOut& audio_core; |