core: Add support for 10GB and 12GB memory configurations

- Add Memory_10Gb and Memory_12Gb to MemoryLayout enum
- Update memory layout settings to support up to 12GB
- Add SMC enums for 10GB and 12GB memory sizes and arrangements
- Increase MainMemorySizeMax from 8GB to 12GB
- Add memory pool size calculations for 10GB and 12GB configurations
- Update UI translations for new memory options
This commit is contained in:
Zephyron 2025-01-04 17:33:22 +10:00
parent 27d662ad0e
commit e11c6c03ec
No known key found for this signature in database
GPG key ID: 8DA271B6A74353F1
6 changed files with 30 additions and 5 deletions

View file

@ -515,6 +515,8 @@ std::unique_ptr<ComboboxTranslationMap> 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<Settings::ConsoleMode>::Index(),
{

View file

@ -195,7 +195,7 @@ struct Values {
SwitchableSetting<MemoryLayout, true> memory_layout_mode{linkage,
MemoryLayout::Memory_4Gb,
MemoryLayout::Memory_4Gb,
MemoryLayout::Memory_8Gb,
MemoryLayout::Memory_12Gb,
"memory_layout_mode",
Category::Core};
SwitchableSetting<bool> use_speed_limit{

View file

@ -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);

View file

@ -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.

View file

@ -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

View file

@ -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;