diff options
| author | Scott Mansell <phiren@gmail.com> | 2026-07-12 11:34:44 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-12 11:34:44 +1200 |
| commit | fc9fd6952a62c4fe48acc00333ce360cb47b57c7 (patch) | |
| tree | 98c900e645f4e0252968f2812a77fb5f1ece41a1 /Source/Core/DiscIO/VolumeDisc.cpp | |
| parent | 6de526c684ee6dd8b6fc3447dae858ae480ccbb5 (diff) | |
| parent | f9ef6c2151d48ef9b5dbe9ee1c2278e5d60b5ed9 (diff) | |
Merge pull request #14665 from cristian64/simulated_memory_size
Core: Adjust emulated memory size automatically.
Diffstat (limited to 'Source/Core/DiscIO/VolumeDisc.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeDisc.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/VolumeDisc.cpp b/Source/Core/DiscIO/VolumeDisc.cpp index e842540376..4dd16c4cef 100644 --- a/Source/Core/DiscIO/VolumeDisc.cpp +++ b/Source/Core/DiscIO/VolumeDisc.cpp @@ -179,6 +179,14 @@ std::optional<u8> VolumeDisc::GetDiscNumber(const Partition& partition) const return ReadSwapped<u8>(6, partition); } +u32 VolumeDisc::GetSimulatedMemorySize() const +{ + // Simulated memory size is a 32-bit unsigned integer in the `bi2.bin` file at offset `0x04`. + // Apploader reads this and "simulates" a smaller memory size. Originally useful for simulating + // 24 MiB of memory on devkits with 48 MiB. + return ReadSwapped<u32>(BI2_ADDRESS + 0x04, GetGamePartition()).value_or(0); +} + bool VolumeDisc::IsNKit() const { constexpr u32 NKIT_MAGIC = 0x4E4B4954; // "NKIT" |
