diff options
author | Max Thomas <mtinc2@gmail.com> | 2017-09-25 08:17:38 +0200 |
---|---|---|
committer | B3n30 <bene_thomas@web.de> | 2017-09-25 08:17:38 +0200 |
commit | c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84 (patch) | |
tree | d56b08a52a11f229e9ce30aeda2b22bfccd48034 /src/core/file_sys/archive_selfncch.cpp | |
parent | Services/UDS: Added a function to send EAPoL-Start packets (#2920) (diff) | |
download | yuzu-c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84.tar yuzu-c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84.tar.gz yuzu-c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84.tar.bz2 yuzu-c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84.tar.lz yuzu-c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84.tar.xz yuzu-c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84.tar.zst yuzu-c91ccbd0ba4118554d7377bbc3bd4c64f9bccf84.zip |
Diffstat (limited to 'src/core/file_sys/archive_selfncch.cpp')
-rw-r--r-- | src/core/file_sys/archive_selfncch.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/core/file_sys/archive_selfncch.cpp b/src/core/file_sys/archive_selfncch.cpp index 298a37a44..7dc91a405 100644 --- a/src/core/file_sys/archive_selfncch.cpp +++ b/src/core/file_sys/archive_selfncch.cpp @@ -102,8 +102,7 @@ public: switch (static_cast<SelfNCCHFilePathType>(file_path.type)) { case SelfNCCHFilePathType::UpdateRomFS: - LOG_WARNING(Service_FS, "(STUBBED) open update RomFS"); - return OpenRomFS(); + return OpenUpdateRomFS(); case SelfNCCHFilePathType::RomFS: return OpenRomFS(); @@ -179,6 +178,17 @@ private: } } + ResultVal<std::unique_ptr<FileBackend>> OpenUpdateRomFS() const { + if (ncch_data.update_romfs_file) { + return MakeResult<std::unique_ptr<FileBackend>>(std::make_unique<IVFCFile>( + ncch_data.update_romfs_file, ncch_data.update_romfs_offset, + ncch_data.update_romfs_size)); + } else { + LOG_INFO(Service_FS, "Unable to read update RomFS"); + return ERROR_ROMFS_NOT_FOUND; + } + } + ResultVal<std::unique_ptr<FileBackend>> OpenExeFS(const std::string& filename) const { if (filename == "icon") { if (ncch_data.icon) { @@ -218,11 +228,19 @@ private: }; ArchiveFactory_SelfNCCH::ArchiveFactory_SelfNCCH(Loader::AppLoader& app_loader) { - std::shared_ptr<FileUtil::IOFile> romfs_file_; + std::shared_ptr<FileUtil::IOFile> romfs_file; + if (Loader::ResultStatus::Success == + app_loader.ReadRomFS(romfs_file, ncch_data.romfs_offset, ncch_data.romfs_size)) { + + ncch_data.romfs_file = std::move(romfs_file); + } + + std::shared_ptr<FileUtil::IOFile> update_romfs_file; if (Loader::ResultStatus::Success == - app_loader.ReadRomFS(romfs_file_, ncch_data.romfs_offset, ncch_data.romfs_size)) { + app_loader.ReadUpdateRomFS(update_romfs_file, ncch_data.update_romfs_offset, + ncch_data.update_romfs_size)) { - ncch_data.romfs_file = std::move(romfs_file_); + ncch_data.update_romfs_file = std::move(update_romfs_file); } std::vector<u8> buffer; |