From 9c37aa039bff93a2dd11f1aeb500cc047bc6d817 Mon Sep 17 00:00:00 2001 From: illusion0001 <37698908+illusion0001@users.noreply.github.com> Date: Thu, 27 Mar 2025 09:50:21 +1300 Subject: [PATCH] Add isDevKit bool (#2685) --- src/common/config.cpp | 8 ++++++++ src/common/config.h | 1 + src/core/memory.cpp | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/common/config.cpp b/src/common/config.cpp index e0a348fbe..16d9e5724 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -32,6 +32,7 @@ std::filesystem::path find_fs_path_or(const basic_value& v, const K& ky, namespace Config { static bool isNeo = false; +static bool isDevKit = false; static bool playBGM = false; static bool isTrophyPopupDisabled = false; static int BGMvolume = 50; @@ -167,6 +168,10 @@ bool isNeoModeConsole() { return isNeo; } +bool isDevKitConsole() { + return isDevKit; +} + bool getIsFullscreen() { return isFullscreen; } @@ -755,6 +760,7 @@ void load(const std::filesystem::path& path) { const toml::value& general = data.at("General"); isNeo = toml::find_or(general, "isPS4Pro", false); + isDevKit = toml::find_or(general, "isDevKit", false); playBGM = toml::find_or(general, "playBGM", false); isTrophyPopupDisabled = toml::find_or(general, "isTrophyPopupDisabled", false); trophyNotificationDuration = @@ -955,6 +961,7 @@ void save(const std::filesystem::path& path) { } data["General"]["isPS4Pro"] = isNeo; + data["General"]["isDevKit"] = isDevKit; data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled; data["General"]["trophyNotificationDuration"] = trophyNotificationDuration; data["General"]["playBGM"] = playBGM; @@ -1101,6 +1108,7 @@ void saveMainWindow(const std::filesystem::path& path) { void setDefaultValues() { isHDRAllowed = false; isNeo = false; + isDevKit = false; isFullscreen = false; isTrophyPopupDisabled = false; playBGM = false; diff --git a/src/common/config.h b/src/common/config.h index 4202da88a..1025e9956 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -28,6 +28,7 @@ void setLoadGameSizeEnabled(bool enable); bool getIsFullscreen(); std::string getFullscreenMode(); bool isNeoModeConsole(); +bool isDevKitConsole(); bool getPlayBGM(); int getBGMvolume(); bool getisTrophyPopupDisabled(); diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 98d587e00..8b108a654 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -38,6 +38,16 @@ void MemoryManager::SetupMemoryRegions(u64 flexible_size, bool use_extended_mem1 bool use_extended_mem2) { const bool is_neo = ::Libraries::Kernel::sceKernelIsNeoMode(); auto total_size = is_neo ? SCE_KERNEL_TOTAL_MEM_PRO : SCE_KERNEL_TOTAL_MEM; + if (Config::isDevKitConsole()) { + const auto old_size = total_size; + // Assuming 2gb is neo for now, will need to link it with sceKernelIsDevKit + total_size += is_neo ? 2_GB : 768_MB; + LOG_WARNING(Kernel_Vmm, + "Config::isDevKitConsole is enabled! Added additional {:s} of direct memory.", + is_neo ? "2 GB" : "768 MB"); + LOG_WARNING(Kernel_Vmm, "Old Direct Size: {:#x} -> New Direct Size: {:#x}", old_size, + total_size); + } if (!use_extended_mem1 && is_neo) { total_size -= 256_MB; }