diff options
| author | 2018-07-27 23:55:23 -0400 | |
|---|---|---|
| committer | 2018-08-01 00:16:54 -0400 | |
| commit | df5b75694f5abde94ccf05fa6c7a557b1ba9079b (patch) | |
| tree | 70f0cf96b1a9834360fb1c5d5547939693ecd577 /src/core/loader/nca.cpp | |
| parent | Merge pull request #871 from bunnei/audio-config (diff) | |
| download | yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar.gz yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar.xz yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.zip | |
Remove files that are not used
Diffstat (limited to 'src/core/loader/nca.cpp')
| -rw-r--r-- | src/core/loader/nca.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/core/loader/nca.cpp b/src/core/loader/nca.cpp index c80df23be..a1f8235d1 100644 --- a/src/core/loader/nca.cpp +++ b/src/core/loader/nca.cpp | |||
| @@ -25,12 +25,10 @@ namespace Loader { | |||
| 25 | AppLoader_NCA::AppLoader_NCA(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} | 25 | AppLoader_NCA::AppLoader_NCA(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} |
| 26 | 26 | ||
| 27 | FileType AppLoader_NCA::IdentifyType(const FileSys::VirtualFile& file) { | 27 | FileType AppLoader_NCA::IdentifyType(const FileSys::VirtualFile& file) { |
| 28 | // TODO(DarkLordZach): Assuming everything is decrypted. Add crypto support. | 28 | FileSys::NCA nca(file); |
| 29 | FileSys::NCAHeader header{}; | ||
| 30 | if (sizeof(FileSys::NCAHeader) != file->ReadObject(&header)) | ||
| 31 | return FileType::Error; | ||
| 32 | 29 | ||
| 33 | if (IsValidNCA(header) && header.content_type == FileSys::NCAContentType::Program) | 30 | if (nca.GetStatus() == ResultStatus::Success && |
| 31 | nca.GetType() == FileSys::NCAContentType::Program) | ||
| 34 | return FileType::NCA; | 32 | return FileType::NCA; |
| 35 | 33 | ||
| 36 | return FileType::Error; | 34 | return FileType::Error; |
| @@ -98,12 +96,21 @@ ResultStatus AppLoader_NCA::Load(Kernel::SharedPtr<Kernel::Process>& process) { | |||
| 98 | } | 96 | } |
| 99 | 97 | ||
| 100 | ResultStatus AppLoader_NCA::ReadRomFS(FileSys::VirtualFile& dir) { | 98 | ResultStatus AppLoader_NCA::ReadRomFS(FileSys::VirtualFile& dir) { |
| 101 | if (nca == nullptr || nca->GetRomFS() == nullptr || nca->GetRomFS()->GetSize() == 0) | 99 | if (nca == nullptr) |
| 100 | return ResultStatus::ErrorNotLoaded; | ||
| 101 | if (nca->GetRomFS() == nullptr || nca->GetRomFS()->GetSize() == 0) | ||
| 102 | return ResultStatus::ErrorNotUsed; | 102 | return ResultStatus::ErrorNotUsed; |
| 103 | dir = nca->GetRomFS(); | 103 | dir = nca->GetRomFS(); |
| 104 | return ResultStatus::Success; | 104 | return ResultStatus::Success; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) { | ||
| 108 | if (nca == nullptr) | ||
| 109 | return ResultStatus::ErrorNotLoaded; | ||
| 110 | out_program_id = nca->GetTitleId(); | ||
| 111 | return ResultStatus::Success; | ||
| 112 | } | ||
| 113 | |||
| 107 | AppLoader_NCA::~AppLoader_NCA() = default; | 114 | AppLoader_NCA::~AppLoader_NCA() = default; |
| 108 | 115 | ||
| 109 | } // namespace Loader | 116 | } // namespace Loader |