mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-12 14:48:52 +00:00
Add configurable extra memory (#3513)
* Add configurable extra memory * lowercase getter and setter * Refactor memory setup to configure maximum memory limits at runtime * sir clang offnir, the all-formatting * Correctly update BackingSize on W*ndows too * small format change * remove total_memory_to_use from the header * i have no idea how to name this commit "addressing review comments" is a good name i guess * Do not include extraDmem in the general config
This commit is contained in:
@@ -115,6 +115,7 @@ public:
|
||||
static ConfigEntry<int> volumeSlider(100);
|
||||
static ConfigEntry<bool> isNeo(false);
|
||||
static ConfigEntry<bool> isDevKit(false);
|
||||
static ConfigEntry<int> extraDmemInMbytes(0);
|
||||
static ConfigEntry<bool> isPSNSignedIn(false);
|
||||
static ConfigEntry<bool> isTrophyPopupDisabled(false);
|
||||
static ConfigEntry<double> trophyNotificationDuration(6.0);
|
||||
@@ -286,6 +287,14 @@ bool isDevKitConsole() {
|
||||
return isDevKit.get();
|
||||
}
|
||||
|
||||
int getExtraDmemInMbytes() {
|
||||
return extraDmemInMbytes.get();
|
||||
}
|
||||
|
||||
void setExtraDmemInMbytes(int value) {
|
||||
extraDmemInMbytes.base_value = 0;
|
||||
}
|
||||
|
||||
bool getIsFullscreen() {
|
||||
return isFullscreen.get();
|
||||
}
|
||||
@@ -830,6 +839,9 @@ void load(const std::filesystem::path& path, bool is_game_specific) {
|
||||
volumeSlider.setFromToml(general, "volumeSlider", is_game_specific);
|
||||
isNeo.setFromToml(general, "isPS4Pro", is_game_specific);
|
||||
isDevKit.setFromToml(general, "isDevKit", is_game_specific);
|
||||
if (is_game_specific) { // do not get this value from the base config
|
||||
extraDmemInMbytes.setFromToml(general, "extraDmemInMbytes", is_game_specific);
|
||||
}
|
||||
isPSNSignedIn.setFromToml(general, "isPSNSignedIn", is_game_specific);
|
||||
isTrophyPopupDisabled.setFromToml(general, "isTrophyPopupDisabled", is_game_specific);
|
||||
trophyNotificationDuration.setFromToml(general, "trophyNotificationDuration",
|
||||
@@ -1032,6 +1044,9 @@ void save(const std::filesystem::path& path, bool is_game_specific) {
|
||||
isSideTrophy.setTomlValue(data, "General", "sideTrophy", is_game_specific);
|
||||
isNeo.setTomlValue(data, "General", "isPS4Pro", is_game_specific);
|
||||
isDevKit.setTomlValue(data, "General", "isDevKit", is_game_specific);
|
||||
if (is_game_specific) {
|
||||
extraDmemInMbytes.setTomlValue(data, "General", "extraDmemInMbytes", is_game_specific);
|
||||
}
|
||||
isPSNSignedIn.setTomlValue(data, "General", "isPSNSignedIn", is_game_specific);
|
||||
isConnectedToNetwork.setTomlValue(data, "General", "isConnectedToNetwork", is_game_specific);
|
||||
|
||||
@@ -1155,6 +1170,7 @@ void setDefaultValues(bool is_game_specific) {
|
||||
isPSNSignedIn.set(false, is_game_specific);
|
||||
isConnectedToNetwork.set(false, is_game_specific);
|
||||
directMemoryAccessEnabled.set(false, is_game_specific);
|
||||
extraDmemInMbytes.set(0, is_game_specific);
|
||||
}
|
||||
|
||||
// Entries with game-specific settings that are in both the game-specific and global GUI
|
||||
|
||||
Reference in New Issue
Block a user