summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp3
-rw-r--r--src/core/device_memory.cpp11
-rw-r--r--src/core/device_memory.h2
3 files changed, 11 insertions, 5 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 14d6c8c27..1d557fb43 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -136,7 +136,8 @@ struct System::Impl {
}
void Initialize(System& system) {
- device_memory = std::make_unique<Core::DeviceMemory>();
+ const bool direct_mapped_address = Settings::IsNceEnabled();
+ device_memory = std::make_unique<Core::DeviceMemory>(direct_mapped_address);
is_multicore = Settings::values.use_multi_core.GetValue();
extended_memory_layout =
diff --git a/src/core/device_memory.cpp b/src/core/device_memory.cpp
index de3f8ef8f..0528a8e3b 100644
--- a/src/core/device_memory.cpp
+++ b/src/core/device_memory.cpp
@@ -6,15 +6,20 @@
namespace Core {
-#ifdef ANDROID
+#ifdef ARCHITECTURE_arm64
constexpr size_t VirtualReserveSize = 1ULL << 38;
#else
constexpr size_t VirtualReserveSize = 1ULL << 39;
#endif
-DeviceMemory::DeviceMemory()
+DeviceMemory::DeviceMemory(bool direct_mapped_address)
: buffer{Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize(),
- VirtualReserveSize} {}
+ VirtualReserveSize} {
+ if (direct_mapped_address) {
+ buffer.EnableDirectMappedAddress();
+ }
+}
+
DeviceMemory::~DeviceMemory() = default;
} // namespace Core
diff --git a/src/core/device_memory.h b/src/core/device_memory.h
index 13388b73e..368f19e86 100644
--- a/src/core/device_memory.h
+++ b/src/core/device_memory.h
@@ -18,7 +18,7 @@ enum : u64 {
class DeviceMemory {
public:
- explicit DeviceMemory();
+ explicit DeviceMemory(bool direct_mapped_address);
~DeviceMemory();
DeviceMemory& operator=(const DeviceMemory&) = delete;