From 2a4730cbee231d91577d8af439f3e30a149c5247 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 21 Sep 2019 23:00:19 -0400 Subject: [PATCH] pl_u: Use kernel physical memory --- src/core/file_sys/system_archive/shared_font.cpp | 11 +++++++---- src/core/hle/service/ns/pl_u.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/file_sys/system_archive/shared_font.cpp b/src/core/file_sys/system_archive/shared_font.cpp index 8613a39b7..5bb596824 100644 --- a/src/core/file_sys/system_archive/shared_font.cpp +++ b/src/core/file_sys/system_archive/shared_font.cpp @@ -18,13 +18,16 @@ namespace { template VirtualFile PackBFTTF(const std::array& data, const std::string& name) { - std::vector vec(Size / sizeof(u32)); - std::memcpy(vec.data(), data.data(), vec.size() * sizeof(u32)); + std::vector vec(Size); + std::memcpy(vec.data(), data.data(), vec.size()); - std::vector bfttf(Size + sizeof(u64)); + Kernel::PhysicalMemory bfttf(Size + sizeof(u64)); Service::NS::EncryptSharedFont(vec, bfttf); - return std::make_shared(std::move(bfttf), name); + + std::vector bfttf_vec(Size + sizeof(u64)); + std::memcpy(bfttf_vec.data(), bfttf.data(), bfttf_vec.size()); + return std::make_shared(std::move(bfttf_vec), name); } } // Anonymous namespace diff --git a/src/core/hle/service/ns/pl_u.h b/src/core/hle/service/ns/pl_u.h index 08574c6b4..7375c1c6f 100644 --- a/src/core/hle/service/ns/pl_u.h +++ b/src/core/hle/service/ns/pl_u.h @@ -5,6 +5,7 @@ #pragma once #include +#include "core/hle/kernel/physical_memory.h" #include "core/hle/service/service.h" namespace Service::NS {