From 3fb50870ab4623a9a310d394fd3523ff3379fe8b Mon Sep 17 00:00:00 2001 From: Maufeat Date: Wed, 7 Jan 2026 18:32:07 +0100 Subject: [PATCH] some linux debug --- src/core/core.cpp | 4 ++++ src/core/file_sys/patch_manager.cpp | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index bf97184f8f..1a5333cdf7 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -366,14 +366,18 @@ struct System::Impl { GetAndResetPerfStats(); perf_stats->BeginSystemFrame(); + LOG_ERROR(Core, "Creating Patch Manager Instance"); std::string title_version; const FileSys::PatchManager pm(params.program_id, system.GetFileSystemController(), system.GetContentProvider()); + LOG_ERROR(Core, "GetControlMetadata"); const auto metadata = pm.GetControlMetadata(); if (metadata.first != nullptr) { + LOG_ERROR(Core, "GetVersionString"); title_version = metadata.first->GetVersionString(); } + LOG_ERROR(Core, "ReadProgramId"); if (app_loader->ReadProgramId(program_id) != Loader::ResultStatus::Success) { LOG_ERROR(Core, "Failed to find program id for ROM"); } diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 42e098c738..32682badde 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "common/hex_util.h" @@ -554,13 +555,16 @@ VirtualFile PatchManager::PatchRomFS(const NCA* base_nca, VirtualFile base_romfs LOG_DEBUG(Loader, "{}", log_string); } - auto romfs = base_romfs; + auto romfs = std::move(base_romfs); // Game Updates + LOG_DEBUG(Loader, "ChooseUpdateVariant"); std::optional selected_update_tid = ChooseUpdateVariant(content_provider, title_id, type, fs_controller); if (!selected_update_tid.has_value()) { + LOG_DEBUG(Loader, "GetUpdateTitleID"); selected_update_tid = GetUpdateTitleID(title_id); } + LOG_DEBUG(Loader, "GetEntryRaw"); const auto update_raw = content_provider.GetEntryRaw(*selected_update_tid, type); const auto& disabled = Settings::values.disabled_addons[title_id]; @@ -576,6 +580,7 @@ VirtualFile PatchManager::PatchRomFS(const NCA* base_nca, VirtualFile base_romfs romfs = new_nca->GetRomFS(); } } else if (!update_disabled && base_nca != nullptr) { + LOG_DEBUG(Loader, "Got update blabla, applying"); ContentRecordType alt_type = type; if (type == ContentRecordType::Program) { @@ -585,6 +590,7 @@ VirtualFile PatchManager::PatchRomFS(const NCA* base_nca, VirtualFile base_romfs } if (alt_type != type) { + LOG_DEBUG(Loader, "GetEntryRaw"); const auto alt_update_raw = content_provider.GetEntryRaw(*selected_update_tid, alt_type); if (alt_update_raw != nullptr) { @@ -610,6 +616,7 @@ VirtualFile PatchManager::PatchRomFS(const NCA* base_nca, VirtualFile base_romfs // LayeredFS if (apply_layeredfs) { + LOG_DEBUG(Loader, "ApplyLayeredFS"); ApplyLayeredFS(romfs, title_id, type, fs_controller); } @@ -825,20 +832,24 @@ std::optional PatchManager::GetGameVersion() const { } PatchManager::Metadata PatchManager::GetControlMetadata() const { + LOG_ERROR(Core, "GetEntry"); const auto base_control_nca = content_provider.GetEntry(title_id, ContentRecordType::Control); if (base_control_nca == nullptr) { return {}; } + LOG_ERROR(Core, "ParseControlNCA"); return ParseControlNCA(*base_control_nca); } PatchManager::Metadata PatchManager::ParseControlNCA(const NCA& nca) const { + LOG_ERROR(Core, "GetRomFS"); const auto base_romfs = nca.GetRomFS(); if (base_romfs == nullptr) { return {}; } + LOG_ERROR(Core, "PatchRomFS"); const auto romfs = PatchRomFS(&nca, base_romfs, ContentRecordType::Control); if (romfs == nullptr) { return {};