diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ns/pl_u.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 77f6da478..923a52cc5 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp | |||
| @@ -84,7 +84,8 @@ void DecryptSharedFont(const std::vector<u32>& input, std::vector<u8>& output, s | |||
| 84 | offset += transformed_font.size() * sizeof(u32); | 84 | offset += transformed_font.size() * sizeof(u32); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | void EncryptSharedFont(const std::vector<u8>& input, std::vector<u8>& output, size_t& offset) { | 87 | static void EncryptSharedFont(const std::vector<u8>& input, std::vector<u8>& output, |
| 88 | size_t& offset) { | ||
| 88 | ASSERT_MSG(offset + input.size() + 8 < SHARED_FONT_MEM_SIZE, "Shared fonts exceeds 17mb!"); | 89 | ASSERT_MSG(offset + input.size() + 8 < SHARED_FONT_MEM_SIZE, "Shared fonts exceeds 17mb!"); |
| 89 | const u32 KEY = EXPECTED_MAGIC ^ EXPECTED_RESULT; | 90 | const u32 KEY = EXPECTED_MAGIC ^ EXPECTED_RESULT; |
| 90 | std::memcpy(output.data() + offset, &EXPECTED_RESULT, sizeof(u32)); // Magic header | 91 | std::memcpy(output.data() + offset, &EXPECTED_RESULT, sizeof(u32)); // Magic header |
| @@ -185,10 +186,10 @@ PL_U::PL_U() : ServiceFramework("pl:u") { | |||
| 185 | } | 186 | } |
| 186 | 187 | ||
| 187 | bool using_ttf = false; | 188 | bool using_ttf = false; |
| 188 | for (auto FontTTF : SHARED_FONTS_TTF) { | 189 | for (const char* font_ttf : SHARED_FONTS_TTF) { |
| 189 | if (FileUtil::Exists(user_path + FontTTF)) { | 190 | if (FileUtil::Exists(user_path + font_ttf)) { |
| 190 | using_ttf = true; | 191 | using_ttf = true; |
| 191 | FileUtil::IOFile file(user_path + FontTTF, "rb"); | 192 | FileUtil::IOFile file(user_path + font_ttf, "rb"); |
| 192 | if (file.IsOpen()) { | 193 | if (file.IsOpen()) { |
| 193 | std::vector<u8> ttf_bytes(file.GetSize()); | 194 | std::vector<u8> ttf_bytes(file.GetSize()); |
| 194 | file.ReadBytes<u8>(ttf_bytes.data(), ttf_bytes.size()); | 195 | file.ReadBytes<u8>(ttf_bytes.data(), ttf_bytes.size()); |
| @@ -199,10 +200,10 @@ PL_U::PL_U() : ServiceFramework("pl:u") { | |||
| 199 | EncryptSharedFont(ttf_bytes, *shared_font, offset); | 200 | EncryptSharedFont(ttf_bytes, *shared_font, offset); |
| 200 | SHARED_FONT_REGIONS.push_back(region); | 201 | SHARED_FONT_REGIONS.push_back(region); |
| 201 | } else { | 202 | } else { |
| 202 | LOG_WARNING(Service_NS, "Unable to load font: {}", FontTTF); | 203 | LOG_WARNING(Service_NS, "Unable to load font: {}", font_ttf); |
| 203 | } | 204 | } |
| 204 | } else if (using_ttf) { | 205 | } else if (using_ttf) { |
| 205 | LOG_WARNING(Service_NS, "Unable to find font: {}", FontTTF); | 206 | LOG_WARNING(Service_NS, "Unable to find font: {}", font_ttf); |
| 206 | } | 207 | } |
| 207 | } | 208 | } |
| 208 | if (using_ttf) | 209 | if (using_ttf) |