diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-07 18:46:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 18:46:31 +0200 |
commit | 8acf739b3fac78d25dc60e1a7d1252c05afadd57 (patch) | |
tree | 9315d25e19c41422467bef9d4a3e5fb5dd3fbb87 /src/core/hle/service/ldr | |
parent | Merge pull request #6279 from ogniK5377/nvhost-prof (diff) | |
parent | ldr: Simplify memory copy within LoadNro() (diff) | |
download | yuzu-8acf739b3fac78d25dc60e1a7d1252c05afadd57.tar yuzu-8acf739b3fac78d25dc60e1a7d1252c05afadd57.tar.gz yuzu-8acf739b3fac78d25dc60e1a7d1252c05afadd57.tar.bz2 yuzu-8acf739b3fac78d25dc60e1a7d1252c05afadd57.tar.lz yuzu-8acf739b3fac78d25dc60e1a7d1252c05afadd57.tar.xz yuzu-8acf739b3fac78d25dc60e1a7d1252c05afadd57.tar.zst yuzu-8acf739b3fac78d25dc60e1a7d1252c05afadd57.zip |
Diffstat (limited to 'src/core/hle/service/ldr')
-rw-r--r-- | src/core/hle/service/ldr/ldr.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index c8bc60ad1..89f6f6a2a 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp @@ -387,11 +387,9 @@ public: const VAddr bss_end_addr{ Common::AlignUp(bss_start + nro_header.bss_size, Kernel::PageSize)}; - auto CopyCode{[&](VAddr src_addr, VAddr dst_addr, u64 size) { - std::vector<u8> source_data(size); - system.Memory().ReadBlock(src_addr, source_data.data(), source_data.size()); - system.Memory().WriteBlock(dst_addr, source_data.data(), source_data.size()); - }}; + const auto CopyCode = [this, process](VAddr src_addr, VAddr dst_addr, u64 size) { + system.Memory().CopyBlock(*process, dst_addr, src_addr, size); + }; CopyCode(nro_addr + nro_header.segment_headers[TEXT_INDEX].memory_offset, text_start, nro_header.segment_headers[TEXT_INDEX].memory_size); CopyCode(nro_addr + nro_header.segment_headers[RO_INDEX].memory_offset, ro_start, |