diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-09-22 15:38:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-22 15:38:13 +0200 |
commit | 4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b (patch) | |
tree | cbf3e722bf583a48f851744c8276a2caf0b2e8ef /src/core/hle/service/aoc/aoc_u.cpp | |
parent | Merge pull request #2870 from FernandoS27/multi-draw (diff) | |
parent | removed unneeded semicolon (diff) | |
download | yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.gz yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.bz2 yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.lz yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.xz yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.zst yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.zip |
Diffstat (limited to 'src/core/hle/service/aoc/aoc_u.cpp')
-rw-r--r-- | src/core/hle/service/aoc/aoc_u.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index d3e97776b..e9cf1e840 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp @@ -29,9 +29,9 @@ static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) { return (title_id & DLC_BASE_TITLE_ID_MASK) == base; } -static std::vector<u64> AccumulateAOCTitleIDs() { +static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) { std::vector<u64> add_on_content; - const auto& rcu = Core::System::GetInstance().GetContentProvider(); + const auto& rcu = system.GetContentProvider(); const auto list = rcu.ListEntriesFilter(FileSys::TitleType::AOC, FileSys::ContentRecordType::Data); std::transform(list.begin(), list.end(), std::back_inserter(add_on_content), @@ -47,7 +47,8 @@ static std::vector<u64> AccumulateAOCTitleIDs() { return add_on_content; } -AOC_U::AOC_U() : ServiceFramework("aoc:u"), add_on_content(AccumulateAOCTitleIDs()) { +AOC_U::AOC_U(Core::System& system) + : ServiceFramework("aoc:u"), add_on_content(AccumulateAOCTitleIDs(system)), system(system) { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "CountAddOnContentByApplicationId"}, @@ -65,7 +66,7 @@ AOC_U::AOC_U() : ServiceFramework("aoc:u"), add_on_content(AccumulateAOCTitleIDs RegisterHandlers(functions); - auto& kernel = Core::System::GetInstance().Kernel(); + auto& kernel = system.Kernel(); aoc_change_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, "GetAddOnContentListChanged:Event"); } @@ -86,7 +87,7 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); + const auto current = system.CurrentProcess()->GetTitleID(); const auto& disabled = Settings::values.disabled_addons[current]; if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) { @@ -113,7 +114,7 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_AOC, "called with offset={}, count={}, process_id={}", offset, count, process_id); - const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); + const auto current = system.CurrentProcess()->GetTitleID(); std::vector<u32> out; const auto& disabled = Settings::values.disabled_addons[current]; @@ -159,7 +160,7 @@ void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); - const auto title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); + const auto title_id = system.CurrentProcess()->GetTitleID(); FileSys::PatchManager pm{title_id}; const auto res = pm.GetControlMetadata(); @@ -196,8 +197,8 @@ void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) { rb.PushCopyObjects(aoc_change_event.readable); } -void InstallInterfaces(SM::ServiceManager& service_manager) { - std::make_shared<AOC_U>()->InstallAsService(service_manager); +void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { + std::make_shared<AOC_U>(system)->InstallAsService(service_manager); } } // namespace Service::AOC |