diff options
author | Lioncash <mathew1800@gmail.com> | 2021-05-07 01:18:11 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2021-05-07 01:18:14 +0200 |
commit | 8f638e81e9d74eacb7b19c4350340605f703f38b (patch) | |
tree | 0ad8bb4d73ed558c1b5752c6c759c82cb2172b96 /src/core/hle | |
parent | Merge pull request #6283 from lioncash/unused-fields (diff) | |
download | yuzu-8f638e81e9d74eacb7b19c4350340605f703f38b.tar yuzu-8f638e81e9d74eacb7b19c4350340605f703f38b.tar.gz yuzu-8f638e81e9d74eacb7b19c4350340605f703f38b.tar.bz2 yuzu-8f638e81e9d74eacb7b19c4350340605f703f38b.tar.lz yuzu-8f638e81e9d74eacb7b19c4350340605f703f38b.tar.xz yuzu-8f638e81e9d74eacb7b19c4350340605f703f38b.tar.zst yuzu-8f638e81e9d74eacb7b19c4350340605f703f38b.zip |
Diffstat (limited to '')
-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, |