diff options
| author | 2018-06-21 11:16:23 -0400 | |
|---|---|---|
| committer | 2018-06-21 11:16:23 -0400 | |
| commit | 63f26d5c40adb49094b03b232528672f526afe49 (patch) | |
| tree | b76a154e17c819df7803d5860f08406446507a5c /src/core/loader/loader.cpp | |
| parent | Merge pull request #576 from Subv/warnings1 (diff) | |
| download | yuzu-63f26d5c40adb49094b03b232528672f526afe49.tar.gz yuzu-63f26d5c40adb49094b03b232528672f526afe49.tar.xz yuzu-63f26d5c40adb49094b03b232528672f526afe49.zip | |
Add support for decrypted NCA files (#567)
* Start to add NCA support in loader
* More nca stuff
* More changes to nca.cpp
* Now identifies decrypted NCA cont.
* Game list fixes and more structs and stuff
* More updates to Nca class
* Now reads ExeFs (i think)
* ACTUALLY LOADS EXEFS!
* RomFS loads and games execute
* Cleanup and Finalize
* plumbing, cleanup and testing
* fix some things that i didnt think of before
* Preliminary Review Changes
* Review changes for bunnei and subv
Diffstat (limited to 'src/core/loader/loader.cpp')
| -rw-r--r-- | src/core/loader/loader.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index 6a4fd38cb..20cc0bac0 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "core/hle/kernel/process.h" | 9 | #include "core/hle/kernel/process.h" |
| 10 | #include "core/loader/deconstructed_rom_directory.h" | 10 | #include "core/loader/deconstructed_rom_directory.h" |
| 11 | #include "core/loader/elf.h" | 11 | #include "core/loader/elf.h" |
| 12 | #include "core/loader/nca.h" | ||
| 12 | #include "core/loader/nro.h" | 13 | #include "core/loader/nro.h" |
| 13 | #include "core/loader/nso.h" | 14 | #include "core/loader/nso.h" |
| 14 | 15 | ||
| @@ -32,6 +33,7 @@ FileType IdentifyFile(FileUtil::IOFile& file, const std::string& filepath) { | |||
| 32 | CHECK_TYPE(ELF) | 33 | CHECK_TYPE(ELF) |
| 33 | CHECK_TYPE(NSO) | 34 | CHECK_TYPE(NSO) |
| 34 | CHECK_TYPE(NRO) | 35 | CHECK_TYPE(NRO) |
| 36 | CHECK_TYPE(NCA) | ||
| 35 | 37 | ||
| 36 | #undef CHECK_TYPE | 38 | #undef CHECK_TYPE |
| 37 | 39 | ||
| @@ -57,6 +59,8 @@ FileType GuessFromExtension(const std::string& extension_) { | |||
| 57 | return FileType::NRO; | 59 | return FileType::NRO; |
| 58 | else if (extension == ".nso") | 60 | else if (extension == ".nso") |
| 59 | return FileType::NSO; | 61 | return FileType::NSO; |
| 62 | else if (extension == ".nca") | ||
| 63 | return FileType::NCA; | ||
| 60 | 64 | ||
| 61 | return FileType::Unknown; | 65 | return FileType::Unknown; |
| 62 | } | 66 | } |
| @@ -69,6 +73,8 @@ const char* GetFileTypeString(FileType type) { | |||
| 69 | return "NRO"; | 73 | return "NRO"; |
| 70 | case FileType::NSO: | 74 | case FileType::NSO: |
| 71 | return "NSO"; | 75 | return "NSO"; |
| 76 | case FileType::NCA: | ||
| 77 | return "NCA"; | ||
| 72 | case FileType::DeconstructedRomDirectory: | 78 | case FileType::DeconstructedRomDirectory: |
| 73 | return "Directory"; | 79 | return "Directory"; |
| 74 | case FileType::Error: | 80 | case FileType::Error: |
| @@ -104,6 +110,10 @@ static std::unique_ptr<AppLoader> GetFileLoader(FileUtil::IOFile&& file, FileTyp | |||
| 104 | case FileType::NRO: | 110 | case FileType::NRO: |
| 105 | return std::make_unique<AppLoader_NRO>(std::move(file), filepath); | 111 | return std::make_unique<AppLoader_NRO>(std::move(file), filepath); |
| 106 | 112 | ||
| 113 | // NX NCA file format. | ||
| 114 | case FileType::NCA: | ||
| 115 | return std::make_unique<AppLoader_NCA>(std::move(file), filepath); | ||
| 116 | |||
| 107 | // NX deconstructed ROM directory. | 117 | // NX deconstructed ROM directory. |
| 108 | case FileType::DeconstructedRomDirectory: | 118 | case FileType::DeconstructedRomDirectory: |
| 109 | return std::make_unique<AppLoader_DeconstructedRomDirectory>(std::move(file), filepath); | 119 | return std::make_unique<AppLoader_DeconstructedRomDirectory>(std::move(file), filepath); |