diff --git a/src/core/core.cpp b/src/core/core.cpp index 453d89614..5e2c5c44e 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -207,10 +207,10 @@ void System::Shutdown() { } static System::Integrity::Status GetArchiveStatus(const std::string& name, const u32 id_high, - const u32 id_low, std::string& settings_version, - const void* custom_data, - const size_t custom_data_length, - const std::string& legacy_path = "") { + const u32 id_low, std::string& settings_version, + const void* custom_data, + const size_t custom_data_length, + const std::string& legacy_path = "") { std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX); std::string shared_font_path = Common::StringFromFormat("%s%s/title/%08x/%08x/content/00000000.app.romfs", @@ -222,40 +222,36 @@ static System::Integrity::Status GetArchiveStatus(const std::string& name, const LOG_INFO(Core, "SystemCheck: %s exists.", name.c_str()); return System::Integrity::Dumped; #ifdef ENABLE_CUSTOM_SYSTEM_ARCHIVES - } else if (settings_version == CUSTOM_ARCHIVES_VERSION) { - LOG_WARNING(Core, "SystemCheck: %s(custom) exists.", name.c_str()); - return System::Integrity::Custom; - } else { + } else if (settings_version != CUSTOM_ARCHIVES_VERSION && custom_data_length) { FileUtil::IOFile file(shared_font_path, "wb"); file.WriteBytes(custom_data, custom_data_length); file.Close(); settings_version = CUSTOM_ARCHIVES_VERSION; LOG_WARNING(Core, "SystemCheck: Updated %s.", name.c_str()); return System::Integrity::CreatedCustom; -#else - } else { - LOG_WARNING(Core, "SystemCheck: %s(custom) exists.", name.c_str()); - return System::Integrity::Custom; -#endif - } - } else { - if (!legacy_path.empty() && FileUtil::Exists(legacy_path)) { - LOG_INFO(Core, "SystemCheck: %s(legacy) exists.", name.c_str()); - return System::Integrity::DumpedLegacy; - } else { - LOG_ERROR(Core, "SystemCheck: %s missing.", name.c_str()); -#ifdef ENABLE_CUSTOM_SYSTEM_ARCHIVES - FileUtil::IOFile file(shared_font_path, "wb"); - file.WriteBytes(custom_data, custom_data_length); - file.Close(); - settings_version = CUSTOM_ARCHIVES_VERSION; - LOG_WARNING(Core, "SystemCheck: Created %s.", name.c_str()); - return System::Integrity::CreatedCustom; -#else - return System::Integrity::Missing; #endif } + LOG_WARNING(Core, "SystemCheck: %s(custom) exists.", name.c_str()); + return System::Integrity::Custom; } + + if (!legacy_path.empty() && FileUtil::Exists(legacy_path)) { + LOG_INFO(Core, "SystemCheck: %s(legacy) exists.", name.c_str()); + return System::Integrity::DumpedLegacy; + } + + LOG_ERROR(Core, "SystemCheck: %s missing.", name.c_str()); +#ifdef ENABLE_CUSTOM_SYSTEM_ARCHIVES + if (custom_data_length) { + FileUtil::IOFile file(shared_font_path, "wb"); + file.WriteBytes(custom_data, custom_data_length); + file.Close(); + settings_version = CUSTOM_ARCHIVES_VERSION; + LOG_WARNING(Core, "SystemCheck: Created %s.", name.c_str()); + return System::Integrity::CreatedCustom; + } +#endif + return System::Integrity::Missing; } void System::SystemIntegrityCheck() {