1
0
Fork 0
forked from suyu/suyu

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.
This commit is contained in:
bunnei 2022-02-21 12:37:59 -08:00
parent c0e45a3c78
commit 71f62a346d

View file

@ -5,6 +5,7 @@
#include <random>
#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/secure_monitor.h"
@ -28,30 +29,13 @@ namespace {
using namespace Common::Literals;
u32 GetMemoryModeForInit() {
return 0x01;
}
u32 GetMemorySizeForInit() {
return 0;
return Settings::values.use_extended_memory_layout ? Smc::MemorySize_6GB : Smc::MemorySize_4GB;
}
Smc::MemoryArrangement GetMemoryArrangeForInit() {
switch (GetMemoryModeForInit() & 0x3F) {
case 0x01:
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;
}
return Settings::values.use_extended_memory_layout ? Smc::MemoryArrangement_6GB
: Smc::MemoryArrangement_4GB;
}
} // namespace