summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-09-04 01:00:51 +0200
committerZach Hilman <zachhilman@gmail.com>2018-09-04 22:25:30 +0200
commit7d5d781b20b47aa7e5d538404bbb665759646f95 (patch)
tree45f8d3e606591f73ff4428a4b9250072b45139c3
parentpatch_manager: Centralize Control-type NCA parsing (diff)
downloadyuzu-7d5d781b20b47aa7e5d538404bbb665759646f95.tar
yuzu-7d5d781b20b47aa7e5d538404bbb665759646f95.tar.gz
yuzu-7d5d781b20b47aa7e5d538404bbb665759646f95.tar.bz2
yuzu-7d5d781b20b47aa7e5d538404bbb665759646f95.tar.lz
yuzu-7d5d781b20b47aa7e5d538404bbb665759646f95.tar.xz
yuzu-7d5d781b20b47aa7e5d538404bbb665759646f95.tar.zst
yuzu-7d5d781b20b47aa7e5d538404bbb665759646f95.zip
-rw-r--r--src/core/loader/deconstructed_rom_directory.cpp9
-rw-r--r--src/core/telemetry_session.cpp24
2 files changed, 29 insertions, 4 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp
index 223570431..2b8f78136 100644
--- a/src/core/loader/deconstructed_rom_directory.cpp
+++ b/src/core/loader/deconstructed_rom_directory.cpp
@@ -27,6 +27,14 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys
: AppLoader(std::move(file_)), override_update(override_update) {
const auto dir = file->GetContainingDirectory();
+ // Title ID
+ const auto npdm = dir->GetFile("main.npdm");
+ if (npdm != nullptr) {
+ const auto res = metadata.Load(npdm);
+ if (res == ResultStatus::Success)
+ title_id = metadata.GetTitleID();
+ }
+
// Icon
FileSys::VirtualFile icon_file = nullptr;
for (const auto& language : FileSys::LANGUAGE_NAMES) {
@@ -138,7 +146,6 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load(
}
auto& kernel = Core::System::GetInstance().Kernel();
- title_id = metadata.GetTitleID();
process->program_id = metadata.GetTitleID();
process->svc_access_mask.set();
process->resource_limit =
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index 65571b948..3730e85b8 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -7,6 +7,8 @@
#include "common/file_util.h"
#include "core/core.h"
+#include "core/file_sys/control_metadata.h"
+#include "core/file_sys/patch_manager.h"
#include "core/loader/loader.h"
#include "core/settings.h"
#include "core/telemetry_session.h"
@@ -88,12 +90,28 @@ TelemetrySession::TelemetrySession() {
std::chrono::system_clock::now().time_since_epoch())
.count()};
AddField(Telemetry::FieldType::Session, "Init_Time", init_time);
- std::string program_name;
- const Loader::ResultStatus res{System::GetInstance().GetAppLoader().ReadTitle(program_name)};
+
+ u64 program_id{};
+ const Loader::ResultStatus res{System::GetInstance().GetAppLoader().ReadProgramId(program_id)};
if (res == Loader::ResultStatus::Success) {
- AddField(Telemetry::FieldType::Session, "ProgramName", program_name);
+ AddField(Telemetry::FieldType::Session, "ProgramId", program_id);
+
+ std::string name;
+ System::GetInstance().GetAppLoader().ReadTitle(name);
+
+ if (name.empty()) {
+ auto [nacp, icon_file] = FileSys::PatchManager(program_id).GetControlMetadata();
+ if (nacp != nullptr)
+ name = nacp->GetApplicationName();
+ }
+
+ if (!name.empty())
+ AddField(Telemetry::FieldType::Session, "ProgramName", name);
}
+ AddField(Telemetry::FieldType::Session, "ProgramFormat",
+ static_cast<u8>(System::GetInstance().GetAppLoader().GetFileType()));
+
// Log application information
Telemetry::AppendBuildInfo(field_collection);