From c7a814f10fd927dfcc3591fada7d6732213892b2 Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Sat, 3 Sep 2022 13:30:29 -0500 Subject: core: ns: Implement pl:s service --- .../hle/service/ns/iplatform_service_manager.h | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/core/hle/service/ns/iplatform_service_manager.h (limited to 'src/core/hle/service/ns/iplatform_service_manager.h') diff --git a/src/core/hle/service/ns/iplatform_service_manager.h b/src/core/hle/service/ns/iplatform_service_manager.h new file mode 100644 index 000000000..ed6eda89f --- /dev/null +++ b/src/core/hle/service/ns/iplatform_service_manager.h @@ -0,0 +1,58 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include +#include "core/hle/service/service.h" + +namespace Service { + +namespace FileSystem { +class FileSystemController; +} // namespace FileSystem + +namespace NS { + +enum class FontArchives : u64 { + Extension = 0x0100000000000810, + Standard = 0x0100000000000811, + Korean = 0x0100000000000812, + ChineseTraditional = 0x0100000000000813, + ChineseSimple = 0x0100000000000814, +}; + +constexpr std::array, 7> SHARED_FONTS{ + std::make_pair(FontArchives::Standard, "nintendo_udsg-r_std_003.bfttf"), + std::make_pair(FontArchives::ChineseSimple, "nintendo_udsg-r_org_zh-cn_003.bfttf"), + std::make_pair(FontArchives::ChineseSimple, "nintendo_udsg-r_ext_zh-cn_003.bfttf"), + std::make_pair(FontArchives::ChineseTraditional, "nintendo_udjxh-db_zh-tw_003.bfttf"), + std::make_pair(FontArchives::Korean, "nintendo_udsg-r_ko_003.bfttf"), + std::make_pair(FontArchives::Extension, "nintendo_ext_003.bfttf"), + std::make_pair(FontArchives::Extension, "nintendo_ext2_003.bfttf"), +}; + +void DecryptSharedFontToTTF(const std::vector& input, std::vector& output); +void EncryptSharedFont(const std::vector& input, std::vector& output, std::size_t& offset); + +class IPlatformServiceManager final : public ServiceFramework { +public: + explicit IPlatformServiceManager(Core::System& system_, const char* service_name_); + ~IPlatformServiceManager() override; + +private: + void RequestLoad(Kernel::HLERequestContext& ctx); + void GetLoadState(Kernel::HLERequestContext& ctx); + void GetSize(Kernel::HLERequestContext& ctx); + void GetSharedMemoryAddressOffset(Kernel::HLERequestContext& ctx); + void GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx); + void GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx); + + struct Impl; + std::unique_ptr impl; +}; + +} // namespace NS + +} // namespace Service -- cgit v1.2.3