summaryrefslogtreecommitdiff
path: root/src/core/loader/loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader/loader.cpp')
-rw-r--r--src/core/loader/loader.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index d8cc30959..59ca7091a 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -11,6 +11,7 @@
11#include "core/hle/kernel/process.h" 11#include "core/hle/kernel/process.h"
12#include "core/loader/deconstructed_rom_directory.h" 12#include "core/loader/deconstructed_rom_directory.h"
13#include "core/loader/elf.h" 13#include "core/loader/elf.h"
14#include "core/loader/kip.h"
14#include "core/loader/nax.h" 15#include "core/loader/nax.h"
15#include "core/loader/nca.h" 16#include "core/loader/nca.h"
16#include "core/loader/nro.h" 17#include "core/loader/nro.h"
@@ -36,6 +37,7 @@ FileType IdentifyFile(FileSys::VirtualFile file) {
36 CHECK_TYPE(XCI) 37 CHECK_TYPE(XCI)
37 CHECK_TYPE(NAX) 38 CHECK_TYPE(NAX)
38 CHECK_TYPE(NSP) 39 CHECK_TYPE(NSP)
40 CHECK_TYPE(KIP)
39 41
40#undef CHECK_TYPE 42#undef CHECK_TYPE
41 43
@@ -63,6 +65,8 @@ FileType GuessFromFilename(const std::string& name) {
63 return FileType::XCI; 65 return FileType::XCI;
64 if (extension == "nsp") 66 if (extension == "nsp")
65 return FileType::NSP; 67 return FileType::NSP;
68 if (extension == "kip")
69 return FileType::KIP;
66 70
67 return FileType::Unknown; 71 return FileType::Unknown;
68} 72}
@@ -83,6 +87,8 @@ std::string GetFileTypeString(FileType type) {
83 return "NAX"; 87 return "NAX";
84 case FileType::NSP: 88 case FileType::NSP:
85 return "NSP"; 89 return "NSP";
90 case FileType::KIP:
91 return "KIP";
86 case FileType::DeconstructedRomDirectory: 92 case FileType::DeconstructedRomDirectory:
87 return "Directory"; 93 return "Directory";
88 case FileType::Error: 94 case FileType::Error:
@@ -93,7 +99,7 @@ std::string GetFileTypeString(FileType type) {
93 return "unknown"; 99 return "unknown";
94} 100}
95 101
96constexpr std::array<const char*, 62> RESULT_MESSAGES{ 102constexpr std::array<const char*, 66> RESULT_MESSAGES{
97 "The operation completed successfully.", 103 "The operation completed successfully.",
98 "The loader requested to load is already loaded.", 104 "The loader requested to load is already loaded.",
99 "The operation is not implemented.", 105 "The operation is not implemented.",
@@ -156,6 +162,10 @@ constexpr std::array<const char*, 62> RESULT_MESSAGES{
156 "The BKTR-type NCA has a bad Subsection bucket.", 162 "The BKTR-type NCA has a bad Subsection bucket.",
157 "The BKTR-type NCA is missing the base RomFS.", 163 "The BKTR-type NCA is missing the base RomFS.",
158 "The NSP or XCI does not contain an update in addition to the base game.", 164 "The NSP or XCI does not contain an update in addition to the base game.",
165 "The KIP file has a bad header.",
166 "The KIP BLZ decompression of the section failed unexpectedly.",
167 "The INI file has a bad header.",
168 "The INI file contains more than the maximum allowable number of KIP files.",
159}; 169};
160 170
161std::ostream& operator<<(std::ostream& os, ResultStatus status) { 171std::ostream& operator<<(std::ostream& os, ResultStatus status) {
@@ -205,6 +215,10 @@ static std::unique_ptr<AppLoader> GetFileLoader(FileSys::VirtualFile file, FileT
205 case FileType::NSP: 215 case FileType::NSP:
206 return std::make_unique<AppLoader_NSP>(std::move(file)); 216 return std::make_unique<AppLoader_NSP>(std::move(file));
207 217
218 // NX KIP (Kernel Internal Process) file format
219 case FileType::KIP:
220 return std::make_unique<AppLoader_KIP>(std::move(file));
221
208 // NX deconstructed ROM directory. 222 // NX deconstructed ROM directory.
209 case FileType::DeconstructedRomDirectory: 223 case FileType::DeconstructedRomDirectory:
210 return std::make_unique<AppLoader_DeconstructedRomDirectory>(std::move(file)); 224 return std::make_unique<AppLoader_DeconstructedRomDirectory>(std::move(file));