diff options
author | Sebastian Valle <subv2112@gmail.com> | 2017-10-06 19:19:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 19:19:20 +0200 |
commit | 74d4050924e63f98c76570cafb5a6ad95d2ea5b1 (patch) | |
tree | aab85b74fdb13cc49a7427996b2d1cca17c3fbc3 /src/core/loader/ncch.cpp | |
parent | Merge pull request #2953 from Subv/applet_launch (diff) | |
parent | file_sys, loader: add support for reading TMDs to determine app paths (diff) | |
download | yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.gz yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.bz2 yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.lz yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.xz yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.zst yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.zip |
Diffstat (limited to 'src/core/loader/ncch.cpp')
-rw-r--r-- | src/core/loader/ncch.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 66bc5823d..52686e364 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -14,6 +14,7 @@ #include "core/core.h" #include "core/file_sys/archive_selfncch.h" #include "core/file_sys/ncch_container.h" +#include "core/file_sys/title_metadata.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/hle/service/cfg/cfg.h" @@ -49,9 +50,19 @@ static std::string GetUpdateNCCHPath(u64_le program_id) { u32 high = static_cast<u32>((program_id | UPDATE_MASK) >> 32); u32 low = static_cast<u32>((program_id | UPDATE_MASK) & 0xFFFFFFFF); - return Common::StringFromFormat("%sNintendo 3DS/%s/%s/title/%08x/%08x/content/00000000.app", - FileUtil::GetUserPath(D_SDMC_IDX).c_str(), SYSTEM_ID, SDCARD_ID, - high, low); + // TODO(shinyquagsire23): Title database should be doing this path lookup + std::string content_path = Common::StringFromFormat( + "%sNintendo 3DS/%s/%s/title/%08x/%08x/content/", FileUtil::GetUserPath(D_SDMC_IDX).c_str(), + SYSTEM_ID, SDCARD_ID, high, low); + std::string tmd_path = content_path + "00000000.tmd"; + + u32 content_id = 0; + FileSys::TitleMetadata tmd(tmd_path); + if (tmd.Load() == ResultStatus::Success) { + content_id = tmd.GetBootContentID(); + } + + return Common::StringFromFormat("%s%08x.app", content_path.c_str(), content_id); } std::pair<boost::optional<u32>, ResultStatus> AppLoader_NCCH::LoadKernelSystemMode() { |