summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/process.h1
-rw-r--r--src/core/hle/service/acc/acc.cpp20
-rw-r--r--src/core/hle/service/ncm/ncm.cpp80
-rw-r--r--src/core/hle/service/ns/ns.h18
4 files changed, 90 insertions, 29 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index bf3b7eef3..f027fafa3 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -10,7 +10,6 @@
#include <list>
#include <string>
#include <vector>
-#include <boost/container/static_vector.hpp>
#include "common/common_types.h"
#include "core/hle/kernel/address_arbiter.h"
#include "core/hle/kernel/handle_table.h"
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 86bf53d08..cb66e344b 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -10,6 +10,7 @@
#include "common/logging/log.h"
#include "common/string_util.h"
#include "common/swap.h"
+#include "core/constants.h"
#include "core/core_timing.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/acc/acc.h"
@@ -21,19 +22,6 @@
namespace Service::Account {
-// Smallest JPEG https://github.com/mathiasbynens/small/blob/master/jpeg.jpg
-// used as a backup should the one on disk not exist
-constexpr u32 backup_jpeg_size = 107;
-constexpr std::array<u8, backup_jpeg_size> backup_jpeg{{
- 0xff, 0xd8, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02,
- 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x06, 0x06, 0x05,
- 0x06, 0x09, 0x08, 0x0a, 0x0a, 0x09, 0x08, 0x09, 0x09, 0x0a, 0x0c, 0x0f, 0x0c, 0x0a, 0x0b, 0x0e,
- 0x0b, 0x09, 0x09, 0x0d, 0x11, 0x0d, 0x0e, 0x0f, 0x10, 0x10, 0x11, 0x10, 0x0a, 0x0c, 0x12, 0x13,
- 0x12, 0x10, 0x13, 0x0f, 0x10, 0x10, 0x10, 0xff, 0xc9, 0x00, 0x0b, 0x08, 0x00, 0x01, 0x00, 0x01,
- 0x01, 0x01, 0x11, 0x00, 0xff, 0xcc, 0x00, 0x06, 0x00, 0x10, 0x10, 0x05, 0xff, 0xda, 0x00, 0x08,
- 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9,
-}};
-
static std::string GetImagePath(Common::UUID uuid) {
return FileUtil::GetUserPath(FileUtil::UserPath::NANDDir) +
"/system/save/8000000000000010/su/avators/" + uuid.FormatSwitch() + ".jpg";
@@ -101,8 +89,8 @@ private:
if (!image.IsOpen()) {
LOG_WARNING(Service_ACC,
"Failed to load user provided image! Falling back to built-in backup...");
- ctx.WriteBuffer(backup_jpeg);
- rb.Push<u32>(backup_jpeg_size);
+ ctx.WriteBuffer(Core::Constants::ACCOUNT_BACKUP_JPEG);
+ rb.Push<u32>(Core::Constants::ACCOUNT_BACKUP_JPEG.size());
return;
}
@@ -124,7 +112,7 @@ private:
if (!image.IsOpen()) {
LOG_WARNING(Service_ACC,
"Failed to load user provided image! Falling back to built-in backup...");
- rb.Push<u32>(backup_jpeg_size);
+ rb.Push<u32>(Core::Constants::ACCOUNT_BACKUP_JPEG.size());
} else {
rb.Push<u32>(SanitizeJPEGSize(image.GetSize()));
}
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;