From 911573e0ddf368d839fee3f56bcb61a318574da3 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Thu, 3 Aug 2023 17:00:01 +0200 Subject: [PATCH] TitleList: Use narrower filter for identifying data titles Previous code accidentally caught some game updates and dlc titles --- src/Cafe/TitleList/AppType.h | 23 +++++++++++++++++++++++ src/Cafe/TitleList/TitleInfo.h | 5 ++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 src/Cafe/TitleList/AppType.h diff --git a/src/Cafe/TitleList/AppType.h b/src/Cafe/TitleList/AppType.h new file mode 100644 index 00000000..deca7560 --- /dev/null +++ b/src/Cafe/TitleList/AppType.h @@ -0,0 +1,23 @@ +#pragma once + +enum class APP_TYPE : uint32 +{ + GAME = 0x80000000, + GAME_UPDATE = 0x0800001B, + GAME_DLC = 0x0800000E, + // data titles + VERSION_DATA_TITLE = 0x10000015, + DRC_FIRMWARE = 0x10000013, + DRC_TEXTURE_ATLAS = 0x1000001A, +}; + +// allow direct comparison with uint32 +inline bool operator==(APP_TYPE lhs, uint32 rhs) +{ + return static_cast(lhs) == rhs; +} + +inline bool operator==(uint32 lhs, APP_TYPE rhs) +{ + return lhs == static_cast(rhs); +} diff --git a/src/Cafe/TitleList/TitleInfo.h b/src/Cafe/TitleList/TitleInfo.h index b8b781a4..9b8fa722 100644 --- a/src/Cafe/TitleList/TitleInfo.h +++ b/src/Cafe/TitleList/TitleInfo.h @@ -3,6 +3,7 @@ #include "Cafe/Filesystem/fsc.h" #include "config/CemuConfig.h" // for CafeConsoleRegion. Move to NCrypto? #include "TitleId.h" +#include "AppType.h" #include "ParsedMetaXml.h" enum class CafeTitleFileType @@ -122,9 +123,7 @@ public: if(!IsValid()) return false; uint32 appType = GetAppType(); - if(appType == 0) - return false; // not a valid app_type, but handle this in case some users use placeholder .xml data with fields zeroed-out - return ((appType>>24)&0x80) == 0; + return appType == APP_TYPE::DRC_FIRMWARE || appType == APP_TYPE::DRC_TEXTURE_ATLAS || appType == APP_TYPE::VERSION_DATA_TITLE; } // API which requires parsed meta data or cached info