diff --git a/src/citron/configuration/shared_translation.cpp b/src/citron/configuration/shared_translation.cpp index 18fd843c5..bde0b508f 100644 --- a/src/citron/configuration/shared_translation.cpp +++ b/src/citron/configuration/shared_translation.cpp @@ -515,6 +515,8 @@ std::unique_ptr ComboboxEnumeration(QWidget* parent) { PAIR(MemoryLayout, Memory_4Gb, tr("4GB DRAM (Default)")), PAIR(MemoryLayout, Memory_6Gb, tr("6GB DRAM (Unsafe)")), PAIR(MemoryLayout, Memory_8Gb, tr("8GB DRAM (Unsafe)")), + PAIR(MemoryLayout, Memory_10Gb, tr("10GB DRAM (Unsafe)")), + PAIR(MemoryLayout, Memory_12Gb, tr("12GB DRAM (Unsafe)")), }}); translations->insert({Settings::EnumMetadata::Index(), { diff --git a/src/common/settings.h b/src/common/settings.h index c04686d5b..1debb75ec 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -195,7 +195,7 @@ struct Values { SwitchableSetting memory_layout_mode{linkage, MemoryLayout::Memory_4Gb, MemoryLayout::Memory_4Gb, - MemoryLayout::Memory_8Gb, + MemoryLayout::Memory_12Gb, "memory_layout_mode", Category::Core}; SwitchableSetting use_speed_limit{ diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 9c4cdad91..46adba2f9 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h @@ -134,7 +134,7 @@ ENUM(CpuBackend, Dynarmic, Nce); ENUM(CpuAccuracy, Auto, Accurate, Unsafe, Paranoid); -ENUM(MemoryLayout, Memory_4Gb, Memory_6Gb, Memory_8Gb); +ENUM(MemoryLayout, Memory_4Gb, Memory_6Gb, Memory_8Gb, Memory_10Gb, Memory_12Gb); ENUM(ConfirmStop, Ask_Always, Ask_Based_On_Game, Ask_Never); 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 c51d5a3f3..dfd6a9aee 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 @@ -48,6 +48,10 @@ u32 GetMemorySizeForInit() { return Smc::MemorySize_6GB; case Settings::MemoryLayout::Memory_8Gb: return Smc::MemorySize_8GB; + case Settings::MemoryLayout::Memory_10Gb: + return Smc::MemorySize_10GB; + case Settings::MemoryLayout::Memory_12Gb: + return Smc::MemorySize_12GB; } return Smc::MemorySize_4GB; } @@ -60,6 +64,10 @@ Smc::MemoryArrangement GetMemoryArrangeForInit() { return Smc::MemoryArrangement_6GB; case Settings::MemoryLayout::Memory_8Gb: return Smc::MemoryArrangement_8GB; + case Settings::MemoryLayout::Memory_10Gb: + return Smc::MemoryArrangement_10GB; + case Settings::MemoryLayout::Memory_12Gb: + return Smc::MemoryArrangement_12GB; } return Smc::MemoryArrangement_4GB; } @@ -79,6 +87,10 @@ size_t KSystemControl::Init::GetIntendedMemorySize() { return 6_GiB; case Smc::MemorySize_8GB: return 8_GiB; + case Smc::MemorySize_10GB: + return 10_GiB; + case Smc::MemorySize_12GB: + return 12_GiB; } } @@ -112,8 +124,11 @@ std::size_t KSystemControl::Init::GetApplicationPoolSize() { case Smc::MemoryArrangement_6GBForAppletDev: return 3285_MiB; case Smc::MemoryArrangement_8GB: - // Real kernel sets this to 4916_MiB. We are not debugging applets. return 6547_MiB; + case Smc::MemoryArrangement_10GB: + return 8178_MiB; + case Smc::MemoryArrangement_12GB: + return 9809_MiB; } }(); @@ -137,9 +152,13 @@ size_t KSystemControl::Init::GetAppletPoolSize() { case Smc::MemoryArrangement_6GBForAppletDev: return 2193_MiB; case Smc::MemoryArrangement_8GB: - //! Real kernel sets this to 2193_MiB. We are not debugging applets. + return 562_MiB; + case Smc::MemoryArrangement_10GB: + return 562_MiB; + case Smc::MemoryArrangement_12GB: return 562_MiB; } + }(); // Return (possibly) adjusted size. diff --git a/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h b/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h index 289ab5c0f..d825216c8 100644 --- a/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h +++ b/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h @@ -9,6 +9,8 @@ enum MemorySize { MemorySize_4GB = 0, MemorySize_6GB = 1, MemorySize_8GB = 2, + MemorySize_10GB = 3, + MemorySize_12GB = 4, }; enum MemoryArrangement { @@ -18,6 +20,8 @@ enum MemoryArrangement { MemoryArrangement_6GB = 3, MemoryArrangement_6GBForAppletDev = 4, MemoryArrangement_8GB = 5, + MemoryArrangement_10GB = 6, + MemoryArrangement_12GB = 7, }; } // namespace Kernel::Board::Nintendo::Nx::Smc diff --git a/src/core/hle/kernel/k_memory_layout.h b/src/core/hle/kernel/k_memory_layout.h index 1d3b14616..d21a6b7ae 100644 --- a/src/core/hle/kernel/k_memory_layout.h +++ b/src/core/hle/kernel/k_memory_layout.h @@ -25,7 +25,7 @@ constexpr std::size_t GetMaximumOverheadSize(std::size_t size) { } constexpr std::size_t MainMemorySize = 4_GiB; -constexpr std::size_t MainMemorySizeMax = 8_GiB; +constexpr std::size_t MainMemorySizeMax = 12_GiB; constexpr std::size_t ReservedEarlyDramSize = 384_KiB; constexpr std::size_t DramPhysicalAddress = 0x80000000;