hle: kernel: KSystemControl: Use 6GB memory layout when "use_extended_memory_layout" setting is enabled.

- This uses a larger 6GB DRAM memory layout, which is useful for some mods that require more memory.
master
bunnei 2022-02-21 12:37:59 +07:00
parent c0e45a3c78
commit 71f62a346d
1 changed files with 4 additions and 20 deletions

@ -5,6 +5,7 @@
#include <random> #include <random>
#include "common/literals.h" #include "common/literals.h"
#include "common/settings.h"
#include "core/hle/kernel/board/nintendo/nx/k_system_control.h" #include "core/hle/kernel/board/nintendo/nx/k_system_control.h"
#include "core/hle/kernel/board/nintendo/nx/secure_monitor.h" #include "core/hle/kernel/board/nintendo/nx/secure_monitor.h"
@ -28,30 +29,13 @@ namespace {
using namespace Common::Literals; using namespace Common::Literals;
u32 GetMemoryModeForInit() {
return 0x01;
}
u32 GetMemorySizeForInit() { u32 GetMemorySizeForInit() {
return 0; return Settings::values.use_extended_memory_layout ? Smc::MemorySize_6GB : Smc::MemorySize_4GB;
} }
Smc::MemoryArrangement GetMemoryArrangeForInit() { Smc::MemoryArrangement GetMemoryArrangeForInit() {
switch (GetMemoryModeForInit() & 0x3F) { return Settings::values.use_extended_memory_layout ? Smc::MemoryArrangement_6GB
case 0x01: : Smc::MemoryArrangement_4GB;
default:
return Smc::MemoryArrangement_4GB;
case 0x02:
return Smc::MemoryArrangement_4GBForAppletDev;
case 0x03:
return Smc::MemoryArrangement_4GBForSystemDev;
case 0x11:
return Smc::MemoryArrangement_6GB;
case 0x12:
return Smc::MemoryArrangement_6GBForAppletDev;
case 0x21:
return Smc::MemoryArrangement_8GB;
}
} }
} // namespace } // namespace