diff options
author | bunnei <bunneidev@gmail.com> | 2022-03-03 02:55:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-03 02:55:51 +0100 |
commit | 3ab82e758285108e12ff5ebcadb419a0d0c4e6e7 (patch) | |
tree | 96931961bb24ecbe660f7709966ccc7fa16c3ed3 /src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp | |
parent | Merge pull request #7959 from merryhime/cmpxchg (diff) | |
parent | hle: kernel: Re-create memory layout at initialization. (diff) | |
download | yuzu-3ab82e758285108e12ff5ebcadb419a0d0c4e6e7.tar yuzu-3ab82e758285108e12ff5ebcadb419a0d0c4e6e7.tar.gz yuzu-3ab82e758285108e12ff5ebcadb419a0d0c4e6e7.tar.bz2 yuzu-3ab82e758285108e12ff5ebcadb419a0d0c4e6e7.tar.lz yuzu-3ab82e758285108e12ff5ebcadb419a0d0c4e6e7.tar.xz yuzu-3ab82e758285108e12ff5ebcadb419a0d0c4e6e7.tar.zst yuzu-3ab82e758285108e12ff5ebcadb419a0d0c4e6e7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp index 702cacffc..8027bec00 100644 --- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp +++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp @@ -39,6 +39,10 @@ Smc::MemoryArrangement GetMemoryArrangeForInit() { } } // namespace +size_t KSystemControl::Init::GetRealMemorySize() { + return GetIntendedMemorySize(); +} + // Initialization. size_t KSystemControl::Init::GetIntendedMemorySize() { switch (GetMemorySizeForInit()) { @@ -53,7 +57,13 @@ size_t KSystemControl::Init::GetIntendedMemorySize() { } PAddr KSystemControl::Init::GetKernelPhysicalBaseAddress(u64 base_address) { - return base_address; + const size_t real_dram_size = KSystemControl::Init::GetRealMemorySize(); + const size_t intended_dram_size = KSystemControl::Init::GetIntendedMemorySize(); + if (intended_dram_size * 2 < real_dram_size) { + return base_address; + } else { + return base_address + ((real_dram_size - intended_dram_size) / 2); + } } bool KSystemControl::Init::ShouldIncreaseThreadResourceLimit() { |