diff options
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/am/applets/applets.cpp | 15 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/applets.h | 27 | ||||
-rw-r--r-- | src/core/hle/service/ncm/ncm.cpp | 80 | ||||
-rw-r--r-- | src/core/hle/service/ns/ns.h | 18 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 3 | ||||
-rw-r--r-- | src/core/hle/service/time/time.cpp | 9 |
6 files changed, 130 insertions, 22 deletions
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index e812c66e9..14fa92318 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -121,6 +121,21 @@ void Applet::Initialize() { initialized = true; } +AppletFrontendSet::AppletFrontendSet() = default; + +AppletFrontendSet::AppletFrontendSet(ErrorApplet error, PhotoViewer photo_viewer, + ProfileSelect profile_select, + SoftwareKeyboard software_keyboard, WebBrowser web_browser) + : error{std::move(error)}, photo_viewer{std::move(photo_viewer)}, profile_select{std::move( + profile_select)}, + software_keyboard{std::move(software_keyboard)}, web_browser{std::move(web_browser)} {} + +AppletFrontendSet::~AppletFrontendSet() = default; + +AppletFrontendSet::AppletFrontendSet(AppletFrontendSet&&) noexcept = default; + +AppletFrontendSet& AppletFrontendSet::operator=(AppletFrontendSet&&) noexcept = default; + AppletManager::AppletManager() = default; AppletManager::~AppletManager() = default; diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index 7f932672c..b46e10a4a 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h @@ -137,11 +137,28 @@ protected: }; struct AppletFrontendSet { - std::unique_ptr<Core::Frontend::ErrorApplet> error; - std::unique_ptr<Core::Frontend::PhotoViewerApplet> photo_viewer; - std::unique_ptr<Core::Frontend::ProfileSelectApplet> profile_select; - std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet> software_keyboard; - std::unique_ptr<Core::Frontend::WebBrowserApplet> web_browser; + using ErrorApplet = std::unique_ptr<Core::Frontend::ErrorApplet>; + using PhotoViewer = std::unique_ptr<Core::Frontend::PhotoViewerApplet>; + using ProfileSelect = std::unique_ptr<Core::Frontend::ProfileSelectApplet>; + using SoftwareKeyboard = std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet>; + using WebBrowser = std::unique_ptr<Core::Frontend::WebBrowserApplet>; + + AppletFrontendSet(); + AppletFrontendSet(ErrorApplet error, PhotoViewer photo_viewer, ProfileSelect profile_select, + SoftwareKeyboard software_keyboard, WebBrowser web_browser); + ~AppletFrontendSet(); + + AppletFrontendSet(const AppletFrontendSet&) = delete; + AppletFrontendSet& operator=(const AppletFrontendSet&) = delete; + + AppletFrontendSet(AppletFrontendSet&&) noexcept; + AppletFrontendSet& operator=(AppletFrontendSet&&) noexcept; + + ErrorApplet error; + PhotoViewer photo_viewer; + ProfileSelect profile_select; + SoftwareKeyboard software_keyboard; + WebBrowser web_browser; }; class AppletManager { diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index 5d31f638f..b405a4b66 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp @@ -4,15 +4,89 @@ #include <memory> +#include "core/file_sys/romfs_factory.h" +#include "core/hle/ipc_helpers.h" #include "core/hle/service/ncm/ncm.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" namespace Service::NCM { -class LocationResolver final : public ServiceFramework<LocationResolver> { +class ILocationResolver final : public ServiceFramework<ILocationResolver> { public: - explicit LocationResolver() : ServiceFramework{"lr"} { + explicit ILocationResolver(FileSys::StorageId id) + : ServiceFramework{"ILocationResolver"}, storage(id) { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ResolveProgramPath"}, + {1, nullptr, "RedirectProgramPath"}, + {2, nullptr, "ResolveApplicationControlPath"}, + {3, nullptr, "ResolveApplicationHtmlDocumentPath"}, + {4, nullptr, "ResolveDataPath"}, + {5, nullptr, "RedirectApplicationControlPath"}, + {6, nullptr, "RedirectApplicationHtmlDocumentPath"}, + {7, nullptr, "ResolveApplicationLegalInformationPath"}, + {8, nullptr, "RedirectApplicationLegalInformationPath"}, + {9, nullptr, "Refresh"}, + {10, nullptr, "RedirectProgramPath2"}, + {11, nullptr, "Refresh2"}, + {12, nullptr, "DeleteProgramPath"}, + {13, nullptr, "DeleteApplicationControlPath"}, + {14, nullptr, "DeleteApplicationHtmlDocumentPath"}, + {15, nullptr, "DeleteApplicationLegalInformationPath"}, + {16, nullptr, ""}, + {17, nullptr, ""}, + {18, nullptr, ""}, + {19, nullptr, ""}, + }; + // clang-format on + + RegisterHandlers(functions); + } + +private: + FileSys::StorageId storage; +}; + +class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> { +public: + explicit IRegisteredLocationResolver() : ServiceFramework{"IRegisteredLocationResolver"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ResolveProgramPath"}, + {1, nullptr, "RegisterProgramPath"}, + {2, nullptr, "UnregisterProgramPath"}, + {3, nullptr, "RedirectProgramPath"}, + {4, nullptr, "ResolveHtmlDocumentPath"}, + {5, nullptr, "RegisterHtmlDocumentPath"}, + {6, nullptr, "UnregisterHtmlDocumentPath"}, + {7, nullptr, "RedirectHtmlDocumentPath"}, + {8, nullptr, ""}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class IAddOnContentLocationResolver final : public ServiceFramework<IAddOnContentLocationResolver> { +public: + explicit IAddOnContentLocationResolver() : ServiceFramework{"IAddOnContentLocationResolver"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "ResolveAddOnContentPath"}, + {1, nullptr, "RegisterAddOnContentStorage"}, + {2, nullptr, "UnregisterAllAddOnContentPath"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class LR final : public ServiceFramework<LR> { +public: + explicit LR() : ServiceFramework{"lr"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "OpenLocationResolver"}, @@ -52,7 +126,7 @@ public: }; void InstallInterfaces(SM::ServiceManager& sm) { - std::make_shared<LocationResolver>()->InstallAsService(sm); + std::make_shared<LR>()->InstallAsService(sm); std::make_shared<NCM>()->InstallAsService(sm); } diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h index 0f4bab4cb..0e8256cb4 100644 --- a/src/core/hle/service/ns/ns.h +++ b/src/core/hle/service/ns/ns.h @@ -11,13 +11,13 @@ namespace Service::NS { class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> { public: explicit IAccountProxyInterface(); - ~IAccountProxyInterface(); + ~IAccountProxyInterface() override; }; class IApplicationManagerInterface final : public ServiceFramework<IApplicationManagerInterface> { public: explicit IApplicationManagerInterface(); - ~IApplicationManagerInterface(); + ~IApplicationManagerInterface() override; ResultVal<u8> GetApplicationDesiredLanguage(u32 supported_languages); ResultVal<u64> ConvertApplicationLanguageToLanguageCode(u8 application_language); @@ -31,43 +31,43 @@ private: class IApplicationVersionInterface final : public ServiceFramework<IApplicationVersionInterface> { public: explicit IApplicationVersionInterface(); - ~IApplicationVersionInterface(); + ~IApplicationVersionInterface() override; }; class IContentManagerInterface final : public ServiceFramework<IContentManagerInterface> { public: explicit IContentManagerInterface(); - ~IContentManagerInterface(); + ~IContentManagerInterface() override; }; class IDocumentInterface final : public ServiceFramework<IDocumentInterface> { public: explicit IDocumentInterface(); - ~IDocumentInterface(); + ~IDocumentInterface() override; }; class IDownloadTaskInterface final : public ServiceFramework<IDownloadTaskInterface> { public: explicit IDownloadTaskInterface(); - ~IDownloadTaskInterface(); + ~IDownloadTaskInterface() override; }; class IECommerceInterface final : public ServiceFramework<IECommerceInterface> { public: explicit IECommerceInterface(); - ~IECommerceInterface(); + ~IECommerceInterface() override; }; class IFactoryResetInterface final : public ServiceFramework<IFactoryResetInterface> { public: explicit IFactoryResetInterface(); - ~IFactoryResetInterface(); + ~IFactoryResetInterface() override; }; class NS final : public ServiceFramework<NS> { public: explicit NS(const char* name); - ~NS(); + ~NS() override; std::shared_ptr<IApplicationManagerInterface> GetApplicationManagerInterface() const; diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 45812d238..0e28755bd 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -185,7 +185,8 @@ u32 nvhost_ctrl_gpu::GetGpuTime(const std::vector<u8>& input, std::vector<u8>& o IoctlGetGpuTime params{}; std::memcpy(¶ms, input.data(), input.size()); - params.gpu_time = Core::Timing::cyclesToNs(Core::System::GetInstance().CoreTiming().GetTicks()); + const auto ns = Core::Timing::CyclesToNs(Core::System::GetInstance().CoreTiming().GetTicks()); + params.gpu_time = static_cast<u64_le>(ns.count()); std::memcpy(output.data(), ¶ms, output.size()); return 0; } diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index aa115935d..346bad80d 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -108,8 +108,9 @@ private: LOG_DEBUG(Service_Time, "called"); const auto& core_timing = Core::System::GetInstance().CoreTiming(); - const SteadyClockTimePoint steady_clock_time_point{ - Core::Timing::cyclesToMs(core_timing.GetTicks()) / 1000}; + const auto ms = Core::Timing::CyclesToMs(core_timing.GetTicks()); + const SteadyClockTimePoint steady_clock_time_point{static_cast<u64_le>(ms.count() / 1000), + {}}; IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2}; rb.Push(RESULT_SUCCESS); rb.PushRaw(steady_clock_time_point); @@ -284,8 +285,8 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { } const auto& core_timing = Core::System::GetInstance().CoreTiming(); - const SteadyClockTimePoint steady_clock_time_point{ - Core::Timing::cyclesToMs(core_timing.GetTicks()) / 1000, {}}; + const auto ms = Core::Timing::CyclesToMs(core_timing.GetTicks()); + const SteadyClockTimePoint steady_clock_time_point{static_cast<u64_le>(ms.count() / 1000), {}}; CalendarTime calendar_time{}; calendar_time.year = tm->tm_year + 1900; |