diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/arm/cpu_interrupt_handler.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/am/am.cpp | 20 | ||||
-rw-r--r-- | src/core/memory.cpp | 7 |
3 files changed, 21 insertions, 8 deletions
diff --git a/src/core/arm/cpu_interrupt_handler.cpp b/src/core/arm/cpu_interrupt_handler.cpp index 2f1a1a269..df0350881 100644 --- a/src/core/arm/cpu_interrupt_handler.cpp +++ b/src/core/arm/cpu_interrupt_handler.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#pragma once - #include "common/thread.h" #include "core/arm/cpu_interrupt_handler.h" diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 1bb544dd8..24cfb370b 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -10,6 +10,7 @@ #include "core/core.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" +#include "core/file_sys/registered_cache.h" #include "core/file_sys/savedata_factory.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/kernel.h" @@ -1353,14 +1354,25 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { std::array<u8, 0x10> version_string{}; - FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()}; - const auto res = pm.GetControlMetadata(); + const auto res = [this] { + const auto title_id = system.CurrentProcess()->GetTitleID(); + + FileSys::PatchManager pm{title_id}; + auto res = pm.GetControlMetadata(); + if (res.first != nullptr) { + return res; + } + + FileSys::PatchManager pm_update{FileSys::GetUpdateTitleID(title_id)}; + return pm_update.GetControlMetadata(); + }(); + if (res.first != nullptr) { const auto& version = res.first->GetVersionString(); std::copy(version.begin(), version.end(), version_string.begin()); } else { - constexpr u128 default_version = {1, 0}; - std::memcpy(version_string.data(), default_version.data(), sizeof(u128)); + constexpr char default_version[]{"1.0.0"}; + std::memcpy(version_string.data(), default_version, sizeof(default_version)); } IPC::ResponseBuilder rb{ctx, 6}; diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 7def00768..2c5588933 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -548,9 +548,9 @@ struct Memory::Impl { // longer exist, and we should just leave the pagetable entry blank. page_type = Common::PageType::Unmapped; } else { - page_type = Common::PageType::Memory; current_page_table->pointers[vaddr >> PAGE_BITS] = pointer - (vaddr & ~PAGE_MASK); + page_type = Common::PageType::Memory; } break; } @@ -591,9 +591,12 @@ struct Memory::Impl { base + page_table.pointers.size()); if (!target) { + ASSERT_MSG(type != Common::PageType::Memory, + "Mapping memory page without a pointer @ {:016x}", base * PAGE_SIZE); + while (base != end) { - page_table.pointers[base] = nullptr; page_table.attributes[base] = type; + page_table.pointers[base] = nullptr; page_table.backing_addr[base] = 0; base += 1; |