summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-02-21 21:36:34 +0100
committerbunnei <bunneidev@gmail.com>2022-02-21 22:07:19 +0100
commitc0e45a3c787df9c4c7c99b79a34d31a394bf7b49 (patch)
tree20c12370bcb7417b8fc17d4fb5768b700edca7be
parentsettings: Add a new "use_extended_memory_layout" setting. (diff)
downloadyuzu-c0e45a3c787df9c4c7c99b79a34d31a394bf7b49.tar
yuzu-c0e45a3c787df9c4c7c99b79a34d31a394bf7b49.tar.gz
yuzu-c0e45a3c787df9c4c7c99b79a34d31a394bf7b49.tar.bz2
yuzu-c0e45a3c787df9c4c7c99b79a34d31a394bf7b49.tar.lz
yuzu-c0e45a3c787df9c4c7c99b79a34d31a394bf7b49.tar.xz
yuzu-c0e45a3c787df9c4c7c99b79a34d31a394bf7b49.tar.zst
yuzu-c0e45a3c787df9c4c7c99b79a34d31a394bf7b49.zip
-rw-r--r--src/core/device_memory.cpp5
-rw-r--r--src/core/device_memory.h4
-rw-r--r--src/core/memory.cpp3
3 files changed, 5 insertions, 7 deletions
diff --git a/src/core/device_memory.cpp b/src/core/device_memory.cpp
index f19c0515f..e6bc63086 100644
--- a/src/core/device_memory.cpp
+++ b/src/core/device_memory.cpp
@@ -3,10 +3,13 @@
// Refer to the license.txt file included.
#include "core/device_memory.h"
+#include "hle/kernel/board/nintendo/nx/k_system_control.h"
namespace Core {
-DeviceMemory::DeviceMemory() : buffer{DramMemoryMap::Size, 1ULL << 39} {}
+DeviceMemory::DeviceMemory()
+ : buffer{Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize(),
+ 1ULL << 39} {}
DeviceMemory::~DeviceMemory() = default;
} // namespace Core
diff --git a/src/core/device_memory.h b/src/core/device_memory.h
index c4d17705f..daeb551ea 100644
--- a/src/core/device_memory.h
+++ b/src/core/device_memory.h
@@ -12,12 +12,8 @@ namespace Core {
namespace DramMemoryMap {
enum : u64 {
Base = 0x80000000ULL,
- Size = 0x100000000ULL,
- End = Base + Size,
KernelReserveBase = Base + 0x60000,
SlabHeapBase = KernelReserveBase + 0x85000,
- SlapHeapSize = 0xa21000,
- SlabHeapEnd = SlabHeapBase + SlapHeapSize,
};
}; // namespace DramMemoryMap
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 88d6ec908..28d30eee2 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -39,8 +39,7 @@ struct Memory::Impl {
void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, PAddr target) {
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:016X}", size);
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base);
- ASSERT_MSG(target >= DramMemoryMap::Base && target < DramMemoryMap::End,
- "Out of bounds target: {:016X}", target);
+ ASSERT_MSG(target >= DramMemoryMap::Base, "Out of bounds target: {:016X}", target);
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory);
if (Settings::IsFastmemEnabled()) {