qt: Allow toggling whether to enter system setup on home menu boot. (#6574)

This commit is contained in:
Steveice10 2023-05-31 01:56:35 -07:00 committed by GitHub
parent 691e09473e
commit 4ddb2116bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 163 additions and 120 deletions

View file

@ -898,6 +898,17 @@ void Module::SetEULAVersion(const EULAVersion& version) {
SetConfigInfoBlock(EULAVersionBlockID, sizeof(data), 0xE, &data);
}
void Module::SetSystemSetupNeeded(bool setup_needed) {
u32 block = setup_needed ? 0 : 1;
SetConfigInfoBlock(SystemSetupRequiredBlockID, sizeof(block), 0xC, &block);
}
bool Module::IsSystemSetupNeeded() {
u32 block;
GetConfigInfoBlock(SystemSetupRequiredBlockID, sizeof(block), 0xC, &block);
return (block & 0xFFFF) == 0;
}
std::shared_ptr<Module> GetModule(Core::System& system) {
auto cfg = system.ServiceManager().GetService<Service::CFG::Module::Interface>("cfg:u");
if (!cfg)

View file

@ -460,6 +460,18 @@ public:
*/
EULAVersion GetEULAVersion();
/**
* Sets whether system initial setup is needed in config savegame.
* @param setup_needed Whether system initial setup is needed.
*/
void SetSystemSetupNeeded(bool setup_needed);
/**
* Gets whether system initial setup is needed from config savegame.
* @returns Whether system initial setup is needed.
*/
bool IsSystemSetupNeeded();
/**
* Writes the config savegame memory buffer to the config savegame file in the filesystem
* @returns ResultCode indicating the result of the operation, 0 on success