qt: Hide system titles with invisible or invalid SMDH data. (#6381)

This commit is contained in:
Steveice10
2023-04-01 20:27:22 -07:00
committed by GitHub
parent 387cf15719
commit a74d7a0e6b
2 changed files with 14 additions and 1 deletions

View File

@@ -81,7 +81,16 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
loader->ReadIcon(smdh);
}
if (!Loader::IsValidSMDH(smdh) && UISettings::values.game_list_hide_no_icon) {
const auto system_title = ((program_id >> 32) & 0xFFFFFFFF) == 0x00040010;
if (Loader::IsValidSMDH(smdh)) {
if (system_title) {
auto smdh_struct = reinterpret_cast<Loader::SMDH*>(smdh.data());
if (!(smdh_struct->flags & Loader::SMDH::Flags::Visible)) {
// Skip system titles without the visible flag.
return true;
}
}
} else if (UISettings::values.game_list_hide_no_icon || system_title) {
// Skip this invalid entry
return true;
}