Add 12gb DRAM option (#90)

This adds the option to allow the emulator to use 12gb of RAM for something like really big texture packs.

Co-authored-by: smiRaphi <neogt404@gmail.com>
Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/90
Co-authored-by: Zuckerwatte1 <zuckerwatte1@noreply.localhost>
Co-committed-by: Zuckerwatte1 <zuckerwatte1@noreply.localhost>
This commit is contained in:
Zuckerwatte1
2024-12-15 15:14:54 +00:00
committed by spectranator
parent a04ba7cd1e
commit 86f6184375
6 changed files with 16 additions and 3 deletions

View File

@@ -48,6 +48,8 @@ u32 GetMemorySizeForInit() {
return Smc::MemorySize_6GB;
case Settings::MemoryLayout::Memory_8Gb:
return Smc::MemorySize_8GB;
case Settings::MemoryLayout::Memory_12Gb:
return Smc::MemorySize_12GB;
}
return Smc::MemorySize_4GB;
}
@@ -60,6 +62,8 @@ Smc::MemoryArrangement GetMemoryArrangeForInit() {
return Smc::MemoryArrangement_6GB;
case Settings::MemoryLayout::Memory_8Gb:
return Smc::MemoryArrangement_8GB;
case Settings::MemoryLayout::Memory_12Gb:
return Smc::MemoryArrangement_12GB;
}
return Smc::MemoryArrangement_4GB;
}
@@ -79,6 +83,8 @@ size_t KSystemControl::Init::GetIntendedMemorySize() {
return 6_GiB;
case Smc::MemorySize_8GB:
return 8_GiB;
case Smc::MemorySize_12GB:
return 12_GiB;
}
}
@@ -114,6 +120,8 @@ std::size_t KSystemControl::Init::GetApplicationPoolSize() {
case Smc::MemoryArrangement_8GB:
// Real kernel sets this to 4916_MiB. We are not debugging applets.
return 6547_MiB;
case Smc::MemoryArrangement_12GB:
return 9809_MiB;
}
}();
@@ -139,6 +147,8 @@ size_t KSystemControl::Init::GetAppletPoolSize() {
case Smc::MemoryArrangement_8GB:
//! Real kernel sets this to 2193_MiB. We are not debugging applets.
return 562_MiB;
case Smc::MemoryArrangement_12GB:
return 562_MiB;
}
}();

View File

@@ -9,6 +9,7 @@ enum MemorySize {
MemorySize_4GB = 0,
MemorySize_6GB = 1,
MemorySize_8GB = 2,
MemorySize_12GB = 3,
};
enum MemoryArrangement {
@@ -18,6 +19,7 @@ enum MemoryArrangement {
MemoryArrangement_6GB = 3,
MemoryArrangement_6GBForAppletDev = 4,
MemoryArrangement_8GB = 5,
MemoryArrangement_12GB = 6,
};
} // 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;