diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-15 02:24:15 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-15 02:24:18 +0200 |
commit | 0732786ddc8837bd50b6d27b7ec83d7d5806ee37 (patch) | |
tree | dc503bbba5f79771c02356902cf166de452485f0 /src/core/loader/nro.cpp | |
parent | Merge pull request #1492 from lioncash/proc (diff) | |
download | yuzu-0732786ddc8837bd50b6d27b7ec83d7d5806ee37.tar yuzu-0732786ddc8837bd50b6d27b7ec83d7d5806ee37.tar.gz yuzu-0732786ddc8837bd50b6d27b7ec83d7d5806ee37.tar.bz2 yuzu-0732786ddc8837bd50b6d27b7ec83d7d5806ee37.tar.lz yuzu-0732786ddc8837bd50b6d27b7ec83d7d5806ee37.tar.xz yuzu-0732786ddc8837bd50b6d27b7ec83d7d5806ee37.tar.zst yuzu-0732786ddc8837bd50b6d27b7ec83d7d5806ee37.zip |
Diffstat (limited to 'src/core/loader/nro.cpp')
-rw-r--r-- | src/core/loader/nro.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 576fe692a..243b499f2 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -127,10 +127,10 @@ static constexpr u32 PageAlignSize(u32 size) { return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; } -bool AppLoader_NRO::LoadNro(FileSys::VirtualFile file, VAddr load_base) { +bool AppLoader_NRO::LoadNro(const FileSys::VfsFile& file, VAddr load_base) { // Read NSO header NroHeader nro_header{}; - if (sizeof(NroHeader) != file->ReadObject(&nro_header)) { + if (sizeof(NroHeader) != file.ReadObject(&nro_header)) { return {}; } if (nro_header.magic != Common::MakeMagic('N', 'R', 'O', '0')) { @@ -138,7 +138,7 @@ bool AppLoader_NRO::LoadNro(FileSys::VirtualFile file, VAddr load_base) { } // Build program image - std::vector<u8> program_image = file->ReadBytes(PageAlignSize(nro_header.file_size)); + std::vector<u8> program_image = file.ReadBytes(PageAlignSize(nro_header.file_size)); if (program_image.size() != PageAlignSize(nro_header.file_size)) { return {}; } @@ -182,7 +182,7 @@ bool AppLoader_NRO::LoadNro(FileSys::VirtualFile file, VAddr load_base) { Core::CurrentProcess()->LoadModule(std::move(codeset), load_base); // Register module with GDBStub - GDBStub::RegisterModule(file->GetName(), load_base, load_base); + GDBStub::RegisterModule(file.GetName(), load_base, load_base); return true; } @@ -195,7 +195,7 @@ ResultStatus AppLoader_NRO::Load(Kernel::Process& process) { // Load NRO const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress(); - if (!LoadNro(file, base_address)) { + if (!LoadNro(*file, base_address)) { return ResultStatus::ErrorLoadingNRO; } |