summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/settings.h8
-rw-r--r--src/common/settings_enums.h2
-rw-r--r--src/core/core.cpp10
-rw-r--r--src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp20
4 files changed, 31 insertions, 9 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index 928636c72..618c34334 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -153,8 +153,12 @@ struct Values {
// Core
SwitchableSetting<bool> use_multi_core{linkage, true, "use_multi_core", Category::Core};
- SwitchableSetting<bool> use_unsafe_extended_memory_layout{
- linkage, false, "use_unsafe_extended_memory_layout", Category::Core};
+ SwitchableSetting<MemoryLayout, true> memory_layout_mode{linkage,
+ MemoryLayout::Memory_4Gb,
+ MemoryLayout::Memory_4Gb,
+ MemoryLayout::Memory_8Gb,
+ "memory_layout_mode",
+ Category::Core};
SwitchableSetting<bool> use_speed_limit{
linkage, true, "use_speed_limit", Category::Core, Specialization::Paired, false, true};
SwitchableSetting<u16, true> speed_limit{linkage,
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h
index f9bb75840..a1a29ebf6 100644
--- a/src/common/settings_enums.h
+++ b/src/common/settings_enums.h
@@ -131,6 +131,8 @@ ENUM(GpuAccuracy, Normal, High, Extreme);
ENUM(CpuAccuracy, Auto, Accurate, Unsafe, Paranoid);
+ENUM(MemoryLayout, Memory_4Gb, Memory_6Gb, Memory_8Gb);
+
ENUM(FullscreenMode, Borderless, Exclusive);
ENUM(NvdecEmulation, Off, Cpu, Gpu);
diff --git a/src/core/core.cpp b/src/core/core.cpp
index e2902a91f..951942083 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -12,6 +12,7 @@
#include "common/logging/log.h"
#include "common/microprofile.h"
#include "common/settings.h"
+#include "common/settings_enums.h"
#include "common/string_util.h"
#include "core/arm/exclusive_monitor.h"
#include "core/core.h"
@@ -140,7 +141,8 @@ struct System::Impl {
device_memory = std::make_unique<Core::DeviceMemory>();
is_multicore = Settings::values.use_multi_core.GetValue();
- extended_memory_layout = Settings::values.use_unsafe_extended_memory_layout.GetValue();
+ extended_memory_layout =
+ Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb;
core_timing.SetMulticore(is_multicore);
core_timing.Initialize([&system]() { system.RegisterHostThread(); });
@@ -168,7 +170,8 @@ struct System::Impl {
void ReinitializeIfNecessary(System& system) {
const bool must_reinitialize =
is_multicore != Settings::values.use_multi_core.GetValue() ||
- extended_memory_layout != Settings::values.use_unsafe_extended_memory_layout.GetValue();
+ extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() !=
+ Settings::MemoryLayout::Memory_4Gb);
if (!must_reinitialize) {
return;
@@ -177,7 +180,8 @@ struct System::Impl {
LOG_DEBUG(Kernel, "Re-initializing");
is_multicore = Settings::values.use_multi_core.GetValue();
- extended_memory_layout = Settings::values.use_unsafe_extended_memory_layout.GetValue();
+ extended_memory_layout =
+ Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb;
Initialize(system);
}
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 49bdc671e..7320b87b9 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
@@ -35,13 +35,25 @@ namespace {
using namespace Common::Literals;
u32 GetMemorySizeForInit() {
- return Settings::values.use_unsafe_extended_memory_layout ? Smc::MemorySize_8GB
- : Smc::MemorySize_4GB;
+ switch (Settings::values.memory_layout_mode.GetValue()) {
+ case Settings::MemoryLayout::Memory_4Gb:
+ return Smc::MemorySize_4GB;
+ case Settings::MemoryLayout::Memory_6Gb:
+ return Smc::MemorySize_6GB;
+ case Settings::MemoryLayout::Memory_8Gb:
+ return Smc::MemorySize_8GB;
+ }
}
Smc::MemoryArrangement GetMemoryArrangeForInit() {
- return Settings::values.use_unsafe_extended_memory_layout ? Smc::MemoryArrangement_8GB
- : Smc::MemoryArrangement_4GB;
+ switch (Settings::values.memory_layout_mode.GetValue()) {
+ case Settings::MemoryLayout::Memory_4Gb:
+ return Smc::MemoryArrangement_4GB;
+ case Settings::MemoryLayout::Memory_6Gb:
+ return Smc::MemoryArrangement_6GB;
+ case Settings::MemoryLayout::Memory_8Gb:
+ return Smc::MemoryArrangement_8GB;
+ }
}
} // namespace