From b62ca12e887678070041eda795e273e5eff5f8b2 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Wed, 28 Nov 2018 00:27:21 -0700 Subject: [PATCH 1/5] HLE: Move NS:S into APT and remove NS --- src/core/CMakeLists.txt | 6 ++-- src/core/hle/service/apt/apt.cpp | 27 ++++++++++++++++ src/core/hle/service/apt/apt.h | 6 ++++ src/core/hle/service/{ns => apt}/ns_s.cpp | 7 ++-- src/core/hle/service/{ns => apt}/ns_s.h | 7 ++-- src/core/hle/service/ns/ns.cpp | 39 ----------------------- src/core/hle/service/ns/ns.h | 24 -------------- src/core/hle/service/service.cpp | 7 +--- 8 files changed, 43 insertions(+), 80 deletions(-) rename src/core/hle/service/{ns => apt}/ns_s.cpp (84%) rename src/core/hle/service/{ns => apt}/ns_s.h (58%) delete mode 100644 src/core/hle/service/ns/ns.cpp delete mode 100644 src/core/hle/service/ns/ns.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 83056ec75..375cdc15a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -205,6 +205,8 @@ add_library(core STATIC hle/service/apt/apt_s.h hle/service/apt/apt_u.cpp hle/service/apt/apt_u.h + hle/service/apt/ns_s.cpp + hle/service/apt/ns_s.h hle/service/apt/bcfnt/bcfnt.cpp hle/service/apt/bcfnt/bcfnt.h hle/service/apt/errors.h @@ -326,10 +328,6 @@ add_library(core STATIC hle/service/nim/nim_s.h hle/service/nim/nim_u.cpp hle/service/nim/nim_u.h - hle/service/ns/ns.cpp - hle/service/ns/ns.h - hle/service/ns/ns_s.cpp - hle/service/ns/ns_s.h hle/service/nwm/nwm.cpp hle/service/nwm/nwm.h hle/service/nwm/nwm_cec.cpp diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 494624dc7..71c6d8b23 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -12,12 +12,14 @@ #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/romfs.h" +#include "core/hle/service/am/am.h" #include "core/hle/service/apt/applet_manager.h" #include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_a.h" #include "core/hle/service/apt/apt_s.h" #include "core/hle/service/apt/apt_u.h" #include "core/hle/service/apt/bcfnt/bcfnt.h" +#include "core/hle/service/apt/ns_s.h" #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/ptm/ptm.h" @@ -878,6 +880,31 @@ void InstallInterfaces(Core::System& system) { std::make_shared(apt)->InstallAsService(service_manager); std::make_shared(apt)->InstallAsService(service_manager); std::make_shared(apt)->InstallAsService(service_manager); + std::make_shared(apt)->InstallAsService(service_manager); } } // namespace Service::APT + +namespace Service::NS { + +Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id) { + std::string path = AM::GetTitleContentPath(media_type, title_id); + auto loader = Loader::GetLoader(path); + + if (!loader) { + LOG_WARNING(Service_NS, "Could not find .app for title 0x{:016x}", title_id); + return nullptr; + } + + Kernel::SharedPtr process; + Loader::ResultStatus result = loader->Load(process); + + if (result != Loader::ResultStatus::Success) { + LOG_WARNING(Service_NS, "Error loading .app for title 0x{:016x}", title_id); + return nullptr; + } + + return process; +} + +} // namespace Service::NS diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 3755be43f..9cf8af055 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -8,6 +8,7 @@ #include #include "common/common_funcs.h" #include "common/common_types.h" +#include "core/hle/service/fs/archive.h" #include "common/swap.h" #include "core/hle/service/service.h" @@ -625,3 +626,8 @@ private: void InstallInterfaces(Core::System& system); } // namespace Service::APT + +namespace Service::NS { +/// Loads and launches the title identified by title_id in the specified media type. +Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id); +} // namespace Service::NS diff --git a/src/core/hle/service/ns/ns_s.cpp b/src/core/hle/service/apt/ns_s.cpp similarity index 84% rename from src/core/hle/service/ns/ns_s.cpp rename to src/core/hle/service/apt/ns_s.cpp index 1709e8bd2..665530487 100644 --- a/src/core/hle/service/ns/ns_s.cpp +++ b/src/core/hle/service/apt/ns_s.cpp @@ -2,11 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ns/ns_s.h" +#include "core/hle/service/apt/ns_s.h" namespace Service::NS { -NS_S::NS_S() : ServiceFramework("ns:s", 2) { +NS_S::NS_S(std::shared_ptr apt) + : Service::APT::Module::Interface(std::move(apt), "NS:S", Service::APT::MaxAPTSessions) { static const FunctionInfo functions[] = { {0x000100C0, nullptr, "LaunchFIRM"}, {0x000200C0, nullptr, "LaunchTitle"}, @@ -27,6 +28,4 @@ NS_S::NS_S() : ServiceFramework("ns:s", 2) { RegisterHandlers(functions); } -NS_S::~NS_S() = default; - } // namespace Service::NS diff --git a/src/core/hle/service/ns/ns_s.h b/src/core/hle/service/apt/ns_s.h similarity index 58% rename from src/core/hle/service/ns/ns_s.h rename to src/core/hle/service/apt/ns_s.h index d6c42b0fd..a302589b0 100644 --- a/src/core/hle/service/ns/ns_s.h +++ b/src/core/hle/service/apt/ns_s.h @@ -4,15 +4,16 @@ #pragma once +#include "core/hle/kernel/kernel.h" +#include "core/hle/service/apt/apt.h" #include "core/hle/service/service.h" namespace Service::NS { /// Interface to "ns:s" service -class NS_S final : public ServiceFramework { +class NS_S final : public Service::APT::Module::Interface { public: - NS_S(); - ~NS_S(); + explicit NS_S(std::shared_ptr apt); }; } // namespace Service::NS diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp deleted file mode 100644 index ba0fd793d..000000000 --- a/src/core/hle/service/ns/ns.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include -#include "core/core.h" -#include "core/hle/service/am/am.h" -#include "core/hle/service/ns/ns.h" -#include "core/hle/service/ns/ns_s.h" -#include "core/loader/loader.h" - -namespace Service::NS { - -std::shared_ptr LaunchTitle(FS::MediaType media_type, u64 title_id) { - std::string path = AM::GetTitleContentPath(media_type, title_id); - auto loader = Loader::GetLoader(path); - - if (!loader) { - LOG_WARNING(Service_NS, "Could not find .app for title 0x{:016x}", title_id); - return nullptr; - } - - std::shared_ptr process; - Loader::ResultStatus result = loader->Load(process); - - if (result != Loader::ResultStatus::Success) { - LOG_WARNING(Service_NS, "Error loading .app for title 0x{:016x}", title_id); - return nullptr; - } - - return process; -} - -void InstallInterfaces(Core::System& system) { - auto& service_manager = system.ServiceManager(); - std::make_shared()->InstallAsService(service_manager); -} - -} // namespace Service::NS diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h deleted file mode 100644 index 25aec246e..000000000 --- a/src/core/hle/service/ns/ns.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include "core/hle/kernel/process.h" -#include "core/hle/service/fs/archive.h" -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::NS { - -/// Loads and launches the title identified by title_id in the specified media type. -std::shared_ptr LaunchTitle(FS::MediaType media_type, u64 title_id); - -/// Registers all NS services with the specified service manager. -void InstallInterfaces(Core::System& system); - -} // namespace Service::NS diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index e9aca4a2e..461d0930f 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -40,7 +40,6 @@ #include "core/hle/service/news/news.h" #include "core/hle/service/nfc/nfc.h" #include "core/hle/service/nim/nim.h" -#include "core/hle/service/ns/ns.h" #include "core/hle/service/nwm/nwm.h" #include "core/hle/service/pm/pm.h" #include "core/hle/service/ps/ps_ps.h" @@ -86,11 +85,7 @@ const std::array service_module_map{ {"NEWS", 0x00040130'00003502, NEWS::InstallInterfaces}, {"NFC", 0x00040130'00004002, NFC::InstallInterfaces}, {"NIM", 0x00040130'00002C02, NIM::InstallInterfaces}, - {"NS", 0x00040130'00008002, - [](Core::System& system) { - NS::InstallInterfaces(system); - APT::InstallInterfaces(system); - }}, + {"NS", 0x00040130'00008002, APT::InstallInterfaces}, {"NWM", 0x00040130'00002D02, NWM::InstallInterfaces}, {"PTM", 0x00040130'00002202, PTM::InstallInterfaces}, {"QTM", 0x00040130'00004202, QTM::InstallInterfaces}, From f2167d76a8b7f6c93ac0164969651a82d5a28cea Mon Sep 17 00:00:00 2001 From: James Rowe Date: Wed, 28 Nov 2018 11:16:19 -0700 Subject: [PATCH 2/5] Service: Add BaseInterface and NSInterface --- src/core/hle/service/apt/apt.cpp | 89 ++++++++++++++++-------------- src/core/hle/service/apt/apt.h | 23 ++++++-- src/core/hle/service/apt/apt_a.cpp | 2 +- src/core/hle/service/apt/apt_a.h | 2 +- src/core/hle/service/apt/apt_s.cpp | 2 +- src/core/hle/service/apt/apt_s.h | 2 +- src/core/hle/service/apt/apt_u.cpp | 2 +- src/core/hle/service/apt/apt_u.h | 2 +- src/core/hle/service/apt/ns_s.cpp | 2 +- src/core/hle/service/apt/ns_s.h | 2 +- 10 files changed, 73 insertions(+), 55 deletions(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 71c6d8b23..bcaf5247e 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -29,7 +29,12 @@ namespace Service::APT { -void Module::Interface::Initialize(Kernel::HLERequestContext& ctx) { +Module::NSInterface::NSInterface(std::shared_ptr apt, const char* name, u32 max_session) + : ServiceFramework(name, max_session), BaseInterface(std::move(apt)) {} + +Module::NSInterface::~NSInterface() = default; + +void Module::APTInterface::Initialize(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x2, 2, 0); // 0x20080 AppletId app_id = rp.PopEnum(); u32 attributes = rp.Pop(); @@ -181,7 +186,7 @@ bool Module::LoadLegacySharedFont() { return false; } -void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetSharedFont(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x44, 0, 0); // 0x00440000 IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); @@ -233,7 +238,7 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) { rb.PushCopyObjects(apt->shared_font_mem); } -void Module::Interface::NotifyToWait(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::NotifyToWait(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x43, 1, 0); // 0x430040 u32 app_id = rp.Pop(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -241,7 +246,7 @@ void Module::Interface::NotifyToWait(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) app_id={}", app_id); } -void Module::Interface::GetLockHandle(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetLockHandle(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x1, 1, 0); // 0x10040 // Bits [0:2] are the applet type (System, Library, etc) @@ -262,7 +267,7 @@ void Module::Interface::GetLockHandle(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called applet_attributes={:#010X}", applet_attributes); } -void Module::Interface::Enable(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::Enable(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x3, 1, 0); // 0x30040 u32 attributes = rp.Pop(); @@ -272,7 +277,7 @@ void Module::Interface::Enable(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->Enable(attributes)); } -void Module::Interface::GetAppletManInfo(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetAppletManInfo(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x5, 1, 0); // 0x50040 u32 unk = rp.Pop(); IPC::RequestBuilder rb = rp.MakeBuilder(5, 0); @@ -285,7 +290,7 @@ void Module::Interface::GetAppletManInfo(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called unk={:#010X}", unk); } -void Module::Interface::IsRegistered(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::IsRegistered(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x9, 1, 0); // 0x90040 AppletId app_id = rp.PopEnum(); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); @@ -295,7 +300,7 @@ void Module::Interface::IsRegistered(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_APT, "called app_id={:#010X}", static_cast(app_id)); } -void Module::Interface::InquireNotification(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::InquireNotification(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xB, 1, 0); // 0xB0040 u32 app_id = rp.Pop(); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); @@ -304,7 +309,7 @@ void Module::Interface::InquireNotification(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called app_id={:#010X}", app_id); } -void Module::Interface::SendParameter(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::SendParameter(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xC, 4, 4); // 0xC0104 AppletId src_app_id = rp.PopEnum(); AppletId dst_app_id = rp.PopEnum(); @@ -331,7 +336,7 @@ void Module::Interface::SendParameter(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->SendParameter(param)); } -void Module::Interface::ReceiveParameter(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::ReceiveParameter(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xD, 2, 0); // 0xD0080 AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); @@ -359,7 +364,7 @@ void Module::Interface::ReceiveParameter(Kernel::HLERequestContext& ctx) { rb.PushStaticBuffer(next_parameter->buffer, 0); } -void Module::Interface::GlanceParameter(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GlanceParameter(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xE, 2, 0); // 0xE0080 AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); @@ -386,7 +391,7 @@ void Module::Interface::GlanceParameter(Kernel::HLERequestContext& ctx) { rb.PushStaticBuffer(next_parameter->buffer, 0); } -void Module::Interface::CancelParameter(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::CancelParameter(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xF, 4, 0); // 0xF0100 bool check_sender = rp.Pop(); @@ -407,7 +412,7 @@ void Module::Interface::CancelParameter(Kernel::HLERequestContext& ctx) { static_cast(receiver_appid)); } -void Module::Interface::PrepareToDoApplicationJump(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::PrepareToDoApplicationJump(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x31, 4, 0); // 0x00310100 auto flags = rp.PopEnum(); u64 title_id = rp.Pop(); @@ -423,7 +428,7 @@ void Module::Interface::PrepareToDoApplicationJump(Kernel::HLERequestContext& ct rb.Push(result); } -void Module::Interface::DoApplicationJump(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::DoApplicationJump(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x32, 2, 4); // 0x00320084 u32 param_size = rp.Pop(); u32 hmac_size = rp.Pop(); @@ -440,7 +445,7 @@ void Module::Interface::DoApplicationJump(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->DoApplicationJump()); } -void Module::Interface::GetProgramIdOnApplicationJump(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetProgramIdOnApplicationJump(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x33, 0, 0); // 0x00330000 LOG_DEBUG(Service_APT, "called"); @@ -455,7 +460,7 @@ void Module::Interface::GetProgramIdOnApplicationJump(Kernel::HLERequestContext& rb.Push(static_cast(parameters.next_media_type)); } -void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::PrepareToStartApplication(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x15, 5, 0); // 0x00150140 u32 title_info1 = rp.Pop(); u32 title_info2 = rp.Pop(); @@ -476,7 +481,7 @@ void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx title_info1, title_info2, title_info3, title_info4, flags); } -void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::StartApplication(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x1B, 3, 4); // 0x001B00C4 u32 buffer1_size = rp.Pop(); u32 buffer2_size = rp.Pop(); @@ -492,7 +497,7 @@ void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { buffer1_size, buffer2_size, flag); } -void Module::Interface::AppletUtility(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::AppletUtility(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x4B, 3, 2); // 0x004B00C2 // These are from 3dbrew - I'm not really sure what they're used for. @@ -509,7 +514,7 @@ void Module::Interface::AppletUtility(Kernel::HLERequestContext& ctx) { utility_command, input_size, output_size); } -void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x4F, 2, 0); // 0x4F0080 u32 value = rp.Pop(); apt->cpu_percent = rp.Pop(); @@ -524,7 +529,7 @@ void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, value); } -void Module::Interface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x50, 1, 0); // 0x500040 u32 value = rp.Pop(); @@ -539,7 +544,7 @@ void Module::Interface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called, value={}", value); } -void Module::Interface::PrepareToStartLibraryApplet(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::PrepareToStartLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x18, 1, 0); // 0x180040 AppletId applet_id = rp.PopEnum(); @@ -549,7 +554,7 @@ void Module::Interface::PrepareToStartLibraryApplet(Kernel::HLERequestContext& c rb.Push(apt->applet_manager->PrepareToStartLibraryApplet(applet_id)); } -void Module::Interface::PrepareToStartNewestHomeMenu(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::PrepareToStartNewestHomeMenu(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x1A, 0, 0); // 0x1A0000 IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -563,7 +568,7 @@ void Module::Interface::PrepareToStartNewestHomeMenu(Kernel::HLERequestContext& LOG_DEBUG(Service_APT, "called"); } -void Module::Interface::PreloadLibraryApplet(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::PreloadLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x16, 1, 0); // 0x160040 AppletId applet_id = rp.PopEnum(); @@ -573,7 +578,7 @@ void Module::Interface::PreloadLibraryApplet(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->PreloadLibraryApplet(applet_id)); } -void Module::Interface::FinishPreloadingLibraryApplet(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::FinishPreloadingLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x17, 1, 0); // 0x00170040 AppletId applet_id = rp.PopEnum(); @@ -583,7 +588,7 @@ void Module::Interface::FinishPreloadingLibraryApplet(Kernel::HLERequestContext& LOG_WARNING(Service_APT, "(STUBBED) called, applet_id={:#05X}", static_cast(applet_id)); } -void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x1E, 2, 4); // 0x1E0084 AppletId applet_id = rp.PopEnum(); @@ -597,7 +602,7 @@ void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->StartLibraryApplet(applet_id, object, buffer)); } -void Module::Interface::CloseApplication(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::CloseApplication(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x27, 1, 4); u32 parameters_size = rp.Pop(); std::shared_ptr object = rp.PopGenericObject(); @@ -611,7 +616,7 @@ void Module::Interface::CloseApplication(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } -void Module::Interface::CancelLibraryApplet(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::CancelLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x3B, 1, 0); // 0x003B0040 bool exiting = rp.Pop(); @@ -621,7 +626,7 @@ void Module::Interface::CancelLibraryApplet(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called exiting={}", exiting); } -void Module::Interface::PrepareToCloseLibraryApplet(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::PrepareToCloseLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x25, 3, 0); // 0x002500C0 bool not_pause = rp.Pop(); bool exiting = rp.Pop(); @@ -634,7 +639,7 @@ void Module::Interface::PrepareToCloseLibraryApplet(Kernel::HLERequestContext& c rb.Push(apt->applet_manager->PrepareToCloseLibraryApplet(not_pause, exiting, jump_to_home)); } -void Module::Interface::CloseLibraryApplet(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::CloseLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x28, 1, 4); // 0x00280044 u32 parameter_size = rp.Pop(); auto object = rp.PopGenericObject(); @@ -646,7 +651,7 @@ void Module::Interface::CloseLibraryApplet(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->CloseLibraryApplet(std::move(object), std::move(buffer))); } -void Module::Interface::SendCaptureBufferInfo(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::SendCaptureBufferInfo(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x40, 1, 2); // 0x00400042 u32 size = rp.Pop(); ASSERT(size == 0x20); @@ -656,7 +661,7 @@ void Module::Interface::SendCaptureBufferInfo(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } -void Module::Interface::ReceiveCaptureBufferInfo(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::ReceiveCaptureBufferInfo(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x41, 1, 0); // 0x00410040 u32 size = rp.Pop(); ASSERT(size == 0x20); @@ -667,7 +672,7 @@ void Module::Interface::ReceiveCaptureBufferInfo(Kernel::HLERequestContext& ctx) rb.PushStaticBuffer(std::move(apt->screen_capture_buffer), 0); } -void Module::Interface::SetScreenCapPostPermission(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::SetScreenCapPostPermission(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x55, 1, 0); // 0x00550040 apt->screen_capture_post_permission = static_cast(rp.Pop() & 0xF); @@ -678,7 +683,7 @@ void Module::Interface::SetScreenCapPostPermission(Kernel::HLERequestContext& ct static_cast(apt->screen_capture_post_permission)); } -void Module::Interface::GetScreenCapPostPermission(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetScreenCapPostPermission(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x56, 0, 0); // 0x00560000 IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); @@ -688,7 +693,7 @@ void Module::Interface::GetScreenCapPostPermission(Kernel::HLERequestContext& ct static_cast(apt->screen_capture_post_permission)); } -void Module::Interface::GetAppletInfo(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetAppletInfo(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x6, 1, 0); // 0x60040 auto app_id = rp.PopEnum(); @@ -709,7 +714,7 @@ void Module::Interface::GetAppletInfo(Kernel::HLERequestContext& ctx) { } } -void Module::Interface::GetStartupArgument(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::GetStartupArgument(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x51, 2, 0); // 0x00510080 u32 parameter_size = rp.Pop(); StartupArgumentType startup_argument_type = static_cast(rp.Pop()); @@ -735,7 +740,7 @@ void Module::Interface::GetStartupArgument(Kernel::HLERequestContext& ctx) { rb.PushStaticBuffer(parameter, 0); } -void Module::Interface::Wrap(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::Wrap(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x46, 4, 4); const u32 output_size = rp.Pop(); const u32 input_size = rp.Pop(); @@ -780,7 +785,7 @@ void Module::Interface::Wrap(Kernel::HLERequestContext& ctx) { rb.PushMappedBuffer(output); } -void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::Unwrap(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x47, 4, 4); const u32 output_size = rp.Pop(); const u32 input_size = rp.Pop(); @@ -831,7 +836,7 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { rb.PushMappedBuffer(output); } -void Module::Interface::CheckNew3DSApp(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::CheckNew3DSApp(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x101, 0, 0); // 0x01010000 IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); @@ -845,7 +850,7 @@ void Module::Interface::CheckNew3DSApp(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called"); } -void Module::Interface::CheckNew3DS(Kernel::HLERequestContext& ctx) { +void Module::APTInterface::CheckNew3DS(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x102, 0, 0); // 0x01020000 IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); @@ -854,10 +859,10 @@ void Module::Interface::CheckNew3DS(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_APT, "(STUBBED) called"); } -Module::Interface::Interface(std::shared_ptr apt, const char* name, u32 max_session) - : ServiceFramework(name, max_session), apt(std::move(apt)) {} +Module::APTInterface::APTInterface(std::shared_ptr apt, const char* name, u32 max_session) + : ServiceFramework(name, max_session), BaseInterface(std::move(apt)) {} -Module::Interface::~Interface() = default; +Module::APTInterface::~APTInterface() = default; Module::Module(Core::System& system) : system(system) { applet_manager = std::make_shared(system); diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 9cf8af055..858757bd5 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -8,8 +8,8 @@ #include #include "common/common_funcs.h" #include "common/common_types.h" -#include "core/hle/service/fs/archive.h" #include "common/swap.h" +#include "core/hle/kernel/kernel.h" #include "core/hle/service/service.h" namespace Core { @@ -60,10 +60,24 @@ public: explicit Module(Core::System& system); ~Module(); - class Interface : public ServiceFramework { + class BaseInterface { public: - Interface(std::shared_ptr apt, const char* name, u32 max_session); - ~Interface(); + explicit BaseInterface(std::shared_ptr apt) : apt(apt) {} + + protected: + std::shared_ptr apt; + }; + + class NSInterface : public ServiceFramework, public BaseInterface { + public: + NSInterface(std::shared_ptr apt, const char* name, u32 max_session); + ~NSInterface(); + }; + + class APTInterface : public ServiceFramework, public BaseInterface { + public: + APTInterface(std::shared_ptr apt, const char* name, u32 max_session); + ~APTInterface(); protected: /** @@ -593,7 +607,6 @@ public: void CheckNew3DS(Kernel::HLERequestContext& ctx); private: - std::shared_ptr apt; bool application_reset_prepared{}; }; diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index 7eb1f0f99..7d5c96139 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp @@ -7,7 +7,7 @@ namespace Service::APT { APT_A::APT_A(std::shared_ptr apt) - : Module::Interface(std::move(apt), "APT:A", MaxAPTSessions) { + : Module::APTInterface(std::move(apt), "APT:A", MaxAPTSessions) { static const FunctionInfo functions[] = { {0x00010040, &APT_A::GetLockHandle, "GetLockHandle"}, {0x00020080, &APT_A::Initialize, "Initialize"}, diff --git a/src/core/hle/service/apt/apt_a.h b/src/core/hle/service/apt/apt_a.h index 7682b9f3f..f481fa1c9 100644 --- a/src/core/hle/service/apt/apt_a.h +++ b/src/core/hle/service/apt/apt_a.h @@ -8,7 +8,7 @@ namespace Service::APT { -class APT_A final : public Module::Interface { +class APT_A final : public Module::APTInterface { public: explicit APT_A(std::shared_ptr apt); }; diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index 3ffc480af..1843bdd9a 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp @@ -7,7 +7,7 @@ namespace Service::APT { APT_S::APT_S(std::shared_ptr apt) - : Module::Interface(std::move(apt), "APT:S", MaxAPTSessions) { + : Module::APTInterface(std::move(apt), "APT:S", MaxAPTSessions) { static const FunctionInfo functions[] = { {0x00010040, &APT_S::GetLockHandle, "GetLockHandle"}, {0x00020080, &APT_S::Initialize, "Initialize"}, diff --git a/src/core/hle/service/apt/apt_s.h b/src/core/hle/service/apt/apt_s.h index 3913727e8..7e041cbda 100644 --- a/src/core/hle/service/apt/apt_s.h +++ b/src/core/hle/service/apt/apt_s.h @@ -15,7 +15,7 @@ namespace Service::APT { // svcBreak when the command isn't accessible). See http://3dbrew.org/wiki/NS#APT_Services. /// Interface to "APT:S" service -class APT_S final : public Module::Interface { +class APT_S final : public Module::APTInterface { public: explicit APT_S(std::shared_ptr apt); }; diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 725bae3cb..0ecbd65da 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp @@ -7,7 +7,7 @@ namespace Service::APT { APT_U::APT_U(std::shared_ptr apt) - : Module::Interface(std::move(apt), "APT:U", MaxAPTSessions) { + : Module::APTInterface(std::move(apt), "APT:U", MaxAPTSessions) { static const FunctionInfo functions[] = { {0x00010040, &APT_U::GetLockHandle, "GetLockHandle"}, {0x00020080, &APT_U::Initialize, "Initialize"}, diff --git a/src/core/hle/service/apt/apt_u.h b/src/core/hle/service/apt/apt_u.h index fa87f00e8..3b342ed55 100644 --- a/src/core/hle/service/apt/apt_u.h +++ b/src/core/hle/service/apt/apt_u.h @@ -15,7 +15,7 @@ namespace Service::APT { // svcBreak when the command isn't accessible). See http://3dbrew.org/wiki/NS#APT_Services. /// Interface to "APT:U" service -class APT_U final : public Module::Interface { +class APT_U final : public Module::APTInterface { public: explicit APT_U(std::shared_ptr apt); }; diff --git a/src/core/hle/service/apt/ns_s.cpp b/src/core/hle/service/apt/ns_s.cpp index 665530487..df570bf8e 100644 --- a/src/core/hle/service/apt/ns_s.cpp +++ b/src/core/hle/service/apt/ns_s.cpp @@ -7,7 +7,7 @@ namespace Service::NS { NS_S::NS_S(std::shared_ptr apt) - : Service::APT::Module::Interface(std::move(apt), "NS:S", Service::APT::MaxAPTSessions) { + : Service::APT::Module::NSInterface(std::move(apt), "NS:S", Service::APT::MaxAPTSessions) { static const FunctionInfo functions[] = { {0x000100C0, nullptr, "LaunchFIRM"}, {0x000200C0, nullptr, "LaunchTitle"}, diff --git a/src/core/hle/service/apt/ns_s.h b/src/core/hle/service/apt/ns_s.h index a302589b0..5a5b311b0 100644 --- a/src/core/hle/service/apt/ns_s.h +++ b/src/core/hle/service/apt/ns_s.h @@ -11,7 +11,7 @@ namespace Service::NS { /// Interface to "ns:s" service -class NS_S final : public Service::APT::Module::Interface { +class NS_S final : public Service::APT::Module::NSInterface { public: explicit NS_S(std::shared_ptr apt); }; From 6c8faaf2c261ed14f381d4ee2868d4e810c27c02 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Wed, 28 Nov 2018 23:20:51 -0700 Subject: [PATCH 3/5] HLE: Remove BaseInterface and add ns.cpp back --- src/core/CMakeLists.txt | 2 ++ src/core/hle/service/apt/applet_manager.cpp | 2 +- src/core/hle/service/apt/apt.cpp | 28 ++--------------- src/core/hle/service/apt/apt.h | 21 ++++--------- src/core/hle/service/apt/ns.cpp | 33 +++++++++++++++++++++ src/core/hle/service/apt/ns.h | 20 +++++++++++++ 6 files changed, 64 insertions(+), 42 deletions(-) create mode 100644 src/core/hle/service/apt/ns.cpp create mode 100644 src/core/hle/service/apt/ns.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 375cdc15a..0c7bbbecf 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -205,6 +205,8 @@ add_library(core STATIC hle/service/apt/apt_s.h hle/service/apt/apt_u.cpp hle/service/apt/apt_u.h + hle/service/apt/ns.cpp + hle/service/apt/ns.h hle/service/apt/ns_s.cpp hle/service/apt/ns_s.h hle/service/apt/bcfnt/bcfnt.cpp diff --git a/src/core/hle/service/apt/applet_manager.cpp b/src/core/hle/service/apt/applet_manager.cpp index 307a9f0a7..a613eb339 100644 --- a/src/core/hle/service/apt/applet_manager.cpp +++ b/src/core/hle/service/apt/applet_manager.cpp @@ -7,8 +7,8 @@ #include "core/hle/applets/applet.h" #include "core/hle/service/apt/applet_manager.h" #include "core/hle/service/apt/errors.h" +#include "core/hle/service/apt/ns.h" #include "core/hle/service/cfg/cfg.h" -#include "core/hle/service/ns/ns.h" namespace Service::APT { diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index bcaf5247e..f2de090b2 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -30,7 +30,7 @@ namespace Service::APT { Module::NSInterface::NSInterface(std::shared_ptr apt, const char* name, u32 max_session) - : ServiceFramework(name, max_session), BaseInterface(std::move(apt)) {} + : ServiceFramework(name, max_session), apt(std::move(apt)) {} Module::NSInterface::~NSInterface() = default; @@ -860,7 +860,7 @@ void Module::APTInterface::CheckNew3DS(Kernel::HLERequestContext& ctx) { } Module::APTInterface::APTInterface(std::shared_ptr apt, const char* name, u32 max_session) - : ServiceFramework(name, max_session), BaseInterface(std::move(apt)) {} + : ServiceFramework(name, max_session), apt(std::move(apt)) {} Module::APTInterface::~APTInterface() = default; @@ -889,27 +889,3 @@ void InstallInterfaces(Core::System& system) { } } // namespace Service::APT - -namespace Service::NS { - -Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id) { - std::string path = AM::GetTitleContentPath(media_type, title_id); - auto loader = Loader::GetLoader(path); - - if (!loader) { - LOG_WARNING(Service_NS, "Could not find .app for title 0x{:016x}", title_id); - return nullptr; - } - - Kernel::SharedPtr process; - Loader::ResultStatus result = loader->Load(process); - - if (result != Loader::ResultStatus::Success) { - LOG_WARNING(Service_NS, "Error loading .app for title 0x{:016x}", title_id); - return nullptr; - } - - return process; -} - -} // namespace Service::NS diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 858757bd5..2e2c219cd 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -60,21 +60,16 @@ public: explicit Module(Core::System& system); ~Module(); - class BaseInterface { - public: - explicit BaseInterface(std::shared_ptr apt) : apt(apt) {} - - protected: - std::shared_ptr apt; - }; - - class NSInterface : public ServiceFramework, public BaseInterface { + class NSInterface : public ServiceFramework { public: NSInterface(std::shared_ptr apt, const char* name, u32 max_session); ~NSInterface(); + + private: + std::shared_ptr apt; }; - class APTInterface : public ServiceFramework, public BaseInterface { + class APTInterface : public ServiceFramework { public: APTInterface(std::shared_ptr apt, const char* name, u32 max_session); ~APTInterface(); @@ -608,6 +603,7 @@ public: private: bool application_reset_prepared{}; + std::shared_ptr apt; }; private: @@ -639,8 +635,3 @@ private: void InstallInterfaces(Core::System& system); } // namespace Service::APT - -namespace Service::NS { -/// Loads and launches the title identified by title_id in the specified media type. -Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id); -} // namespace Service::NS diff --git a/src/core/hle/service/apt/ns.cpp b/src/core/hle/service/apt/ns.cpp new file mode 100644 index 000000000..1347be752 --- /dev/null +++ b/src/core/hle/service/apt/ns.cpp @@ -0,0 +1,33 @@ +// Copyright 2017 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include "core/core.h" +#include "core/hle/service/am/am.h" +#include "core/hle/service/apt/ns.h" +#include "core/loader/loader.h" + +namespace Service::NS { + +Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id) { + std::string path = AM::GetTitleContentPath(media_type, title_id); + auto loader = Loader::GetLoader(path); + + if (!loader) { + LOG_WARNING(Service_NS, "Could not find .app for title 0x{:016x}", title_id); + return nullptr; + } + + Kernel::SharedPtr process; + Loader::ResultStatus result = loader->Load(process); + + if (result != Loader::ResultStatus::Success) { + LOG_WARNING(Service_NS, "Error loading .app for title 0x{:016x}", title_id); + return nullptr; + } + + return process; +} + +} // namespace Service::NS diff --git a/src/core/hle/service/apt/ns.h b/src/core/hle/service/apt/ns.h new file mode 100644 index 000000000..e1515ad8f --- /dev/null +++ b/src/core/hle/service/apt/ns.h @@ -0,0 +1,20 @@ +// Copyright 2017 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/kernel/process.h" +#include "core/hle/service/fs/archive.h" +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::NS { + +/// Loads and launches the title identified by title_id in the specified media type. +Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id); + +} // namespace Service::NS \ No newline at end of file From 61ebeca765bb9c63415ef09b98e6bcafe6020e36 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Tue, 4 Dec 2018 20:11:21 -0700 Subject: [PATCH 4/5] NS: Lowercase NS:S to ns:s like it should be --- src/core/hle/service/apt/ns.h | 2 +- src/core/hle/service/apt/ns_s.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/apt/ns.h b/src/core/hle/service/apt/ns.h index e1515ad8f..7587ef54c 100644 --- a/src/core/hle/service/apt/ns.h +++ b/src/core/hle/service/apt/ns.h @@ -17,4 +17,4 @@ namespace Service::NS { /// Loads and launches the title identified by title_id in the specified media type. Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id); -} // namespace Service::NS \ No newline at end of file +} // namespace Service::NS diff --git a/src/core/hle/service/apt/ns_s.cpp b/src/core/hle/service/apt/ns_s.cpp index df570bf8e..e9eb87174 100644 --- a/src/core/hle/service/apt/ns_s.cpp +++ b/src/core/hle/service/apt/ns_s.cpp @@ -7,7 +7,7 @@ namespace Service::NS { NS_S::NS_S(std::shared_ptr apt) - : Service::APT::Module::NSInterface(std::move(apt), "NS:S", Service::APT::MaxAPTSessions) { + : Service::APT::Module::NSInterface(std::move(apt), "ns:s", 2) { static const FunctionInfo functions[] = { {0x000100C0, nullptr, "LaunchFIRM"}, {0x000200C0, nullptr, "LaunchTitle"}, From 331a9fc12b614ce04cb5d0bcf8ccf4d0fb2923bb Mon Sep 17 00:00:00 2001 From: James Rowe Date: Wed, 14 Aug 2019 21:30:49 -0600 Subject: [PATCH 5/5] Change over to std::shared_ptr --- src/core/hle/service/apt/apt.cpp | 1 - src/core/hle/service/apt/ns.cpp | 4 ++-- src/core/hle/service/apt/ns.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index f2de090b2..f7fb0660f 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -12,7 +12,6 @@ #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/romfs.h" -#include "core/hle/service/am/am.h" #include "core/hle/service/apt/applet_manager.h" #include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_a.h" diff --git a/src/core/hle/service/apt/ns.cpp b/src/core/hle/service/apt/ns.cpp index 1347be752..cff88a5aa 100644 --- a/src/core/hle/service/apt/ns.cpp +++ b/src/core/hle/service/apt/ns.cpp @@ -10,7 +10,7 @@ namespace Service::NS { -Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id) { +std::shared_ptr LaunchTitle(FS::MediaType media_type, u64 title_id) { std::string path = AM::GetTitleContentPath(media_type, title_id); auto loader = Loader::GetLoader(path); @@ -19,7 +19,7 @@ Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 tit return nullptr; } - Kernel::SharedPtr process; + std::shared_ptr process; Loader::ResultStatus result = loader->Load(process); if (result != Loader::ResultStatus::Success) { diff --git a/src/core/hle/service/apt/ns.h b/src/core/hle/service/apt/ns.h index 7587ef54c..ce52fb462 100644 --- a/src/core/hle/service/apt/ns.h +++ b/src/core/hle/service/apt/ns.h @@ -15,6 +15,6 @@ class System; namespace Service::NS { /// Loads and launches the title identified by title_id in the specified media type. -Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 title_id); +std::shared_ptr LaunchTitle(FS::MediaType media_type, u64 title_id); } // namespace Service::NS