Print NPDM + NACP metadata for title determination

We determined that printing NPDM + NACP metadata is a significantly better way to determine what title is running rather than printing the filename.
This commit is contained in:
PixelyIon 2022-10-23 20:18:12 +05:30
parent 48d2b3bf07
commit 128ea33073
3 changed files with 15 additions and 3 deletions

View File

@ -118,7 +118,7 @@ extern "C" JNIEXPORT void Java_emu_skyline_EmulationActivity_executeApplication(
SettingsWeak = settings;
jvmManager->InitializeControllers();
skyline::Logger::InfoNoPrefix("Launching ROM {}", skyline::JniString(env, romUriJstring));
skyline::Logger::DebugNoPrefix("Launching ROM {}", skyline::JniString(env, romUriJstring));
os->Execute(romFd, static_cast<skyline::loader::RomFormat>(romType));
} catch (std::exception &e) {

View File

@ -52,11 +52,23 @@ namespace skyline::kernel {
auto &process{state.process};
process = std::make_shared<kernel::type::KProcess>(state);
auto entry{state.loader->LoadProcessData(process, state)};
auto &nacp{state.loader->nacp};
if (nacp) {
std::string name{nacp->GetApplicationName(language::ApplicationLanguage::AmericanEnglish)}, publisher{nacp->GetApplicationPublisher(language::ApplicationLanguage::AmericanEnglish)};
if (name.empty())
name = nacp->GetApplicationName(nacp->GetFirstSupportedTitleLanguage());
if (publisher.empty())
publisher = nacp->GetApplicationPublisher(nacp->GetFirstSupportedTitleLanguage());
Logger::InfoNoPrefix(R"(Starting "{}" v{} by "{}")", name, nacp->GetApplicationVersion(), publisher);
}
process->InitializeHeapTls();
auto thread{process->CreateThread(entry)};
if (thread) {
Logger::Debug("Starting main HOS thread");
Logger::Info("Starting main HOS thread");
Logger::EmulationContext.Flush();
thread->Start(true);
process->Kill(true, true, true);
}

View File

@ -77,6 +77,6 @@ namespace skyline::vfs {
if (!threadInfo.coreMask.test(meta.idealCore))
throw exception("NPDM Ideal Core isn't valid: {} ({})", meta.idealCore, threadInfo.coreMask);
Logger::Debug("NPDM Metadata:\nTitle: ID: {:X}, Version: {}\nMain Thread: Priority: {}, Stack Size: 0x{:X}\nScheduler: Ideal Core: {}, Core Mask: {}, Priority: {} - {}\nKernel Version: v{}.{}", aci0.programId, meta.version, meta.mainThreadPriority, meta.mainThreadStackSize, meta.idealCore, threadInfo.coreMask, threadInfo.priority.min, threadInfo.priority.max, kernelVersion.majorVersion, kernelVersion.minorVersion);
Logger::InfoNoPrefix("NPDM Metadata:\nTitle: ID: {:X}, Version: {}\nMain Thread: Priority: {}, Stack Size: 0x{:X}\nScheduler: Ideal Core: {}, Core Mask: {}, Priority: {} - {}\nKernel Version: v{}.{}", aci0.programId, meta.version, meta.mainThreadPriority, meta.mainThreadStackSize, meta.idealCore, threadInfo.coreMask, threadInfo.priority.min, threadInfo.priority.max, kernelVersion.majorVersion, kernelVersion.minorVersion);
}
}