mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-22 02:39:05 +02:00
sceReg: Let a key read a bool setting, use it for VSH UMD autoboot
KeyValue gets an optional pointer to a g_Config bool, which the key reads as 0/1. The setting wins over guest writes: since category_version is kept low, the VSH upgrades the registry at every boot and rewrites every key with its default. /CONFIG/SYSTEM/umd_autoboot reads the new SystemParam VshUmdAutoboot (default true, as before). Turned off, --vsh --mount stays in the XMB with the disc in the Game column instead of starting it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3a5c5a51c5
commit
2d116a5b76
3 files changed
+14
-1
No files matched your search
@@ -1121,6 +1121,7 @@ static const ConfigSetting systemParamSettings[] = {
|
||||
ConfigSetting("BypassOSKWithKeyboard", SETTING(g_Config, bBypassOSKWithKeyboard), false, CfgFlag::PER_GAME),
|
||||
ConfigSetting("WlanPowerSave", SETTING(g_Config, bWlanPowerSave), (bool) PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF, CfgFlag::PER_GAME),
|
||||
ConfigSetting("EncryptSave", SETTING(g_Config, bEncryptSave), true, CfgFlag::PER_GAME | CfgFlag::REPORT),
|
||||
ConfigSetting("VshUmdAutoboot", SETTING(g_Config, bVshUmdAutoboot), true, CfgFlag::DEFAULT),
|
||||
ConfigSetting("MemStickSize", SETTING(g_Config, iMemStickSizeGB), 16, CfgFlag::DEFAULT),
|
||||
ConfigSetting("FuseID", SETTING(g_Config, sFuseID), "", CfgFlag::DEFAULT),
|
||||
};
|
||||
|
||||
@@ -594,6 +594,8 @@ public:
|
||||
int iButtonPreference;
|
||||
int iLockParentalLevel;
|
||||
bool bEncryptSave;
|
||||
// /CONFIG/SYSTEM/umd_autoboot: whether the VSH starts an inserted disc by itself.
|
||||
bool bVshUmdAutoboot;
|
||||
|
||||
// Networking
|
||||
bool bEnableAdhocServer;
|
||||
|
||||
+11
-1
@@ -8,6 +8,7 @@
|
||||
#include "Common/Serialize/Serializer.h"
|
||||
#include "Common/Serialize/SerializeMap.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Core/Config.h"
|
||||
|
||||
#define SYSTEM_REGISTRY "/system"
|
||||
#define REG_KEYNAME_SIZE 27
|
||||
@@ -58,6 +59,9 @@ struct KeyValue {
|
||||
const char *strValue; // also can be used for bin. Note: can't be std::string/string_view, will cut off the length.
|
||||
int intValue;
|
||||
const KeyValue *dirContents; // intValue is the count.
|
||||
// If set, an INT key reads this setting (as 0 or 1), even after the guest writes it: the VSH
|
||||
// rewrites every key with its default at each boot, since category_version is below its schema.
|
||||
const bool *boolSetting = nullptr;
|
||||
};
|
||||
|
||||
// Guest-written registry values (sceRegCreateKey / sceRegSetKeyValue), keyed by category path
|
||||
@@ -764,7 +768,7 @@ static const KeyValue tree_CONFIG_SYSTEM_CHARACTER_SET[] = {
|
||||
static const KeyValue tree_CONFIG_SYSTEM[] = {
|
||||
{ "owner_name", ValueType::STR, "P939", 5 },
|
||||
{ "backlight_brightness", ValueType::INT, "", (int)0x3 }, // decimal: 3
|
||||
{ "umd_autoboot", ValueType::INT, "", (int)0x1 }, // decimal: 1
|
||||
{ "umd_autoboot", ValueType::INT, "", (int)0x1, nullptr, &g_Config.bVshUmdAutoboot }, // decimal: 1
|
||||
{ "usb_charge", ValueType::INT, "", (int)0x1 }, // decimal: 1
|
||||
{ "umd_cache", ValueType::INT, "", (int)0x1 }, // decimal: 1
|
||||
{ "usb_auto_connect", ValueType::INT, "", (int)0x1 }, // decimal: 1
|
||||
@@ -1090,6 +1094,12 @@ static const MergedCategory &GetMergedCategory(const std::string &path) {
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &kv : merged.keyvals) {
|
||||
if (kv.boolSetting) {
|
||||
kv.intValue = *kv.boolSetting ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return merged;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user