diff options
| author | 2017-08-03 18:37:03 -0600 | |
|---|---|---|
| committer | 2017-08-03 18:37:03 -0600 | |
| commit | 0dc285dcfd1085c7725b7db474266371226de672 (patch) | |
| tree | 1246eca78bc61a5122c12804f3bc70b93245118d /src/core/loader/ncch.cpp | |
| parent | Merge pull request #2850 from j-selby/fix_invalid_paths (diff) | |
| parent | telemetry: Add field for OsPlatform. (diff) | |
| download | yuzu-0dc285dcfd1085c7725b7db474266371226de672.tar.gz yuzu-0dc285dcfd1085c7725b7db474266371226de672.tar.xz yuzu-0dc285dcfd1085c7725b7db474266371226de672.zip | |
Merge pull request #2855 from bunnei/telemetry-additional-fields
Telemetry: Add several more useful fields
Diffstat (limited to 'src/core/loader/ncch.cpp')
| -rw-r--r-- | src/core/loader/ncch.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index fc4d14a59..c007069a9 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp | |||
| @@ -4,7 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <cinttypes> | 6 | #include <cinttypes> |
| 7 | #include <codecvt> | ||
| 7 | #include <cstring> | 8 | #include <cstring> |
| 9 | #include <locale> | ||
| 8 | #include <memory> | 10 | #include <memory> |
| 9 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 10 | #include "common/string_util.h" | 12 | #include "common/string_util.h" |
| @@ -420,4 +422,22 @@ ResultStatus AppLoader_NCCH::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_ | |||
| 420 | return ResultStatus::ErrorNotUsed; | 422 | return ResultStatus::ErrorNotUsed; |
| 421 | } | 423 | } |
| 422 | 424 | ||
| 425 | ResultStatus AppLoader_NCCH::ReadTitle(std::string& title) { | ||
| 426 | std::vector<u8> data; | ||
| 427 | Loader::SMDH smdh; | ||
| 428 | ReadIcon(data); | ||
| 429 | |||
| 430 | if (!Loader::IsValidSMDH(data)) { | ||
| 431 | return ResultStatus::ErrorInvalidFormat; | ||
| 432 | } | ||
| 433 | |||
| 434 | memcpy(&smdh, data.data(), sizeof(Loader::SMDH)); | ||
| 435 | |||
| 436 | const auto& short_title = smdh.GetShortTitle(SMDH::TitleLanguage::English); | ||
| 437 | auto title_end = std::find(short_title.begin(), short_title.end(), u'\0'); | ||
| 438 | title = Common::UTF16ToUTF8(std::u16string{short_title.begin(), title_end}); | ||
| 439 | |||
| 440 | return ResultStatus::Success; | ||
| 441 | } | ||
| 442 | |||
| 423 | } // namespace Loader | 443 | } // namespace Loader |