diff options
| author | 2023-07-17 19:59:22 -0400 | |
|---|---|---|
| committer | 2023-07-21 10:56:55 -0400 | |
| commit | 127b3da0f13ea0850c10115d45488dfe32a0a3f4 (patch) | |
| tree | 23d118473491a902f9f441da5c97fb4cd313cfcc /src | |
| parent | settings: Require time zone setting value for stirng (diff) | |
| download | yuzu-127b3da0f13ea0850c10115d45488dfe32a0a3f4.tar.gz yuzu-127b3da0f13ea0850c10115d45488dfe32a0a3f4.tar.xz yuzu-127b3da0f13ea0850c10115d45488dfe32a0a3f4.zip | |
core,common: Give memory layout setting an enum
Allows for 6GB and 8GB layouts to be selected.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.h | 8 | ||||
| -rw-r--r-- | src/common/settings_enums.h | 2 | ||||
| -rw-r--r-- | src/core/core.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp | 20 |
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 { | |||
| 153 | 153 | ||
| 154 | // Core | 154 | // Core |
| 155 | SwitchableSetting<bool> use_multi_core{linkage, true, "use_multi_core", Category::Core}; | 155 | SwitchableSetting<bool> use_multi_core{linkage, true, "use_multi_core", Category::Core}; |
| 156 | SwitchableSetting<bool> use_unsafe_extended_memory_layout{ | 156 | SwitchableSetting<MemoryLayout, true> memory_layout_mode{linkage, |
| 157 | linkage, false, "use_unsafe_extended_memory_layout", Category::Core}; | 157 | MemoryLayout::Memory_4Gb, |
| 158 | MemoryLayout::Memory_4Gb, | ||
| 159 | MemoryLayout::Memory_8Gb, | ||
| 160 | "memory_layout_mode", | ||
| 161 | Category::Core}; | ||
| 158 | SwitchableSetting<bool> use_speed_limit{ | 162 | SwitchableSetting<bool> use_speed_limit{ |
| 159 | linkage, true, "use_speed_limit", Category::Core, Specialization::Paired, false, true}; | 163 | linkage, true, "use_speed_limit", Category::Core, Specialization::Paired, false, true}; |
| 160 | SwitchableSetting<u16, true> speed_limit{linkage, | 164 | 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); | |||
| 131 | 131 | ||
| 132 | ENUM(CpuAccuracy, Auto, Accurate, Unsafe, Paranoid); | 132 | ENUM(CpuAccuracy, Auto, Accurate, Unsafe, Paranoid); |
| 133 | 133 | ||
| 134 | ENUM(MemoryLayout, Memory_4Gb, Memory_6Gb, Memory_8Gb); | ||
| 135 | |||
| 134 | ENUM(FullscreenMode, Borderless, Exclusive); | 136 | ENUM(FullscreenMode, Borderless, Exclusive); |
| 135 | 137 | ||
| 136 | ENUM(NvdecEmulation, Off, Cpu, Gpu); | 138 | 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 @@ | |||
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/microprofile.h" | 13 | #include "common/microprofile.h" |
| 14 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 15 | #include "common/settings_enums.h" | ||
| 15 | #include "common/string_util.h" | 16 | #include "common/string_util.h" |
| 16 | #include "core/arm/exclusive_monitor.h" | 17 | #include "core/arm/exclusive_monitor.h" |
| 17 | #include "core/core.h" | 18 | #include "core/core.h" |
| @@ -140,7 +141,8 @@ struct System::Impl { | |||
| 140 | device_memory = std::make_unique<Core::DeviceMemory>(); | 141 | device_memory = std::make_unique<Core::DeviceMemory>(); |
| 141 | 142 | ||
| 142 | is_multicore = Settings::values.use_multi_core.GetValue(); | 143 | is_multicore = Settings::values.use_multi_core.GetValue(); |
| 143 | extended_memory_layout = Settings::values.use_unsafe_extended_memory_layout.GetValue(); | 144 | extended_memory_layout = |
| 145 | Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb; | ||
| 144 | 146 | ||
| 145 | core_timing.SetMulticore(is_multicore); | 147 | core_timing.SetMulticore(is_multicore); |
| 146 | core_timing.Initialize([&system]() { system.RegisterHostThread(); }); | 148 | core_timing.Initialize([&system]() { system.RegisterHostThread(); }); |
| @@ -168,7 +170,8 @@ struct System::Impl { | |||
| 168 | void ReinitializeIfNecessary(System& system) { | 170 | void ReinitializeIfNecessary(System& system) { |
| 169 | const bool must_reinitialize = | 171 | const bool must_reinitialize = |
| 170 | is_multicore != Settings::values.use_multi_core.GetValue() || | 172 | is_multicore != Settings::values.use_multi_core.GetValue() || |
| 171 | extended_memory_layout != Settings::values.use_unsafe_extended_memory_layout.GetValue(); | 173 | extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() != |
| 174 | Settings::MemoryLayout::Memory_4Gb); | ||
| 172 | 175 | ||
| 173 | if (!must_reinitialize) { | 176 | if (!must_reinitialize) { |
| 174 | return; | 177 | return; |
| @@ -177,7 +180,8 @@ struct System::Impl { | |||
| 177 | LOG_DEBUG(Kernel, "Re-initializing"); | 180 | LOG_DEBUG(Kernel, "Re-initializing"); |
| 178 | 181 | ||
| 179 | is_multicore = Settings::values.use_multi_core.GetValue(); | 182 | is_multicore = Settings::values.use_multi_core.GetValue(); |
| 180 | extended_memory_layout = Settings::values.use_unsafe_extended_memory_layout.GetValue(); | 183 | extended_memory_layout = |
| 184 | Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb; | ||
| 181 | 185 | ||
| 182 | Initialize(system); | 186 | Initialize(system); |
| 183 | } | 187 | } |
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 { | |||
| 35 | using namespace Common::Literals; | 35 | using namespace Common::Literals; |
| 36 | 36 | ||
| 37 | u32 GetMemorySizeForInit() { | 37 | u32 GetMemorySizeForInit() { |
| 38 | return Settings::values.use_unsafe_extended_memory_layout ? Smc::MemorySize_8GB | 38 | switch (Settings::values.memory_layout_mode.GetValue()) { |
| 39 | : Smc::MemorySize_4GB; | 39 | case Settings::MemoryLayout::Memory_4Gb: |
| 40 | return Smc::MemorySize_4GB; | ||
| 41 | case Settings::MemoryLayout::Memory_6Gb: | ||
| 42 | return Smc::MemorySize_6GB; | ||
| 43 | case Settings::MemoryLayout::Memory_8Gb: | ||
| 44 | return Smc::MemorySize_8GB; | ||
| 45 | } | ||
| 40 | } | 46 | } |
| 41 | 47 | ||
| 42 | Smc::MemoryArrangement GetMemoryArrangeForInit() { | 48 | Smc::MemoryArrangement GetMemoryArrangeForInit() { |
| 43 | return Settings::values.use_unsafe_extended_memory_layout ? Smc::MemoryArrangement_8GB | 49 | switch (Settings::values.memory_layout_mode.GetValue()) { |
| 44 | : Smc::MemoryArrangement_4GB; | 50 | case Settings::MemoryLayout::Memory_4Gb: |
| 51 | return Smc::MemoryArrangement_4GB; | ||
| 52 | case Settings::MemoryLayout::Memory_6Gb: | ||
| 53 | return Smc::MemoryArrangement_6GB; | ||
| 54 | case Settings::MemoryLayout::Memory_8Gb: | ||
| 55 | return Smc::MemoryArrangement_8GB; | ||
| 56 | } | ||
| 45 | } | 57 | } |
| 46 | } // namespace | 58 | } // namespace |
| 47 | 59 | ||