Browse Source

some linux debug

Maufeat 1 week ago
parent
commit
3fb50870ab
  1. 4
      src/core/core.cpp
  2. 13
      src/core/file_sys/patch_manager.cpp

4
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");
}

13
src/core/file_sys/patch_manager.cpp

@ -10,6 +10,7 @@
#include <cstring>
#include <set>
#include <string>
#include <utility>
#include <vector>
#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<u64> 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<u32> 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 {};

Loading…
Cancel
Save