summaryrefslogtreecommitdiffstats
path: root/src/core/loader/loader.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-11-25 00:16:24 +0100
committerbunnei <bunneidev@gmail.com>2020-11-25 00:16:24 +0100
commit5f75d9712540d53ad779babff8edd75627882006 (patch)
tree859ab2bb7b8350bf2c59cac4c84310a9e8aaff55 /src/core/loader/loader.cpp
parenthle: services: Fix a crash with improper NVFlinger lifetime management. (#4977) (diff)
downloadyuzu-5f75d9712540d53ad779babff8edd75627882006.tar
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.gz
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.bz2
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.lz
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.xz
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.zst
yuzu-5f75d9712540d53ad779babff8edd75627882006.zip
Diffstat (limited to '')
-rw-r--r--src/core/loader/loader.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index deffe7379..d91c15561 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -198,10 +198,11 @@ AppLoader::~AppLoader() = default;
* @param system The system context to use.
* @param file The file to retrieve the loader for
* @param type The file type
+ * @param program_index Specifies the index within the container of the program to launch.
* @return std::unique_ptr<AppLoader> a pointer to a loader object; nullptr for unsupported type
*/
static std::unique_ptr<AppLoader> GetFileLoader(Core::System& system, FileSys::VirtualFile file,
- FileType type) {
+ FileType type, std::size_t program_index) {
switch (type) {
// Standard ELF file format.
case FileType::ELF:
@@ -222,7 +223,7 @@ static std::unique_ptr<AppLoader> GetFileLoader(Core::System& system, FileSys::V
// NX XCI (nX Card Image) file format.
case FileType::XCI:
return std::make_unique<AppLoader_XCI>(std::move(file), system.GetFileSystemController(),
- system.GetContentProvider());
+ system.GetContentProvider(), program_index);
// NX NAX (NintendoAesXts) file format.
case FileType::NAX:
@@ -231,7 +232,7 @@ static std::unique_ptr<AppLoader> GetFileLoader(Core::System& system, FileSys::V
// NX NSP (Nintendo Submission Package) file format
case FileType::NSP:
return std::make_unique<AppLoader_NSP>(std::move(file), system.GetFileSystemController(),
- system.GetContentProvider());
+ system.GetContentProvider(), program_index);
// NX KIP (Kernel Internal Process) file format
case FileType::KIP:
@@ -246,7 +247,8 @@ static std::unique_ptr<AppLoader> GetFileLoader(Core::System& system, FileSys::V
}
}
-std::unique_ptr<AppLoader> GetLoader(Core::System& system, FileSys::VirtualFile file) {
+std::unique_ptr<AppLoader> GetLoader(Core::System& system, FileSys::VirtualFile file,
+ std::size_t program_index) {
FileType type = IdentifyFile(file);
const FileType filename_type = GuessFromFilename(file->GetName());
@@ -260,7 +262,7 @@ std::unique_ptr<AppLoader> GetLoader(Core::System& system, FileSys::VirtualFile
LOG_DEBUG(Loader, "Loading file {} as {}...", file->GetName(), GetFileTypeString(type));
- return GetFileLoader(system, std::move(file), type);
+ return GetFileLoader(system, std::move(file), type, program_index);
}
} // namespace Loader