TitleList: Use narrower filter for identifying data titles

Previous code accidentally caught some game updates and dlc titles
This commit is contained in:
Exzap 2023-08-03 17:00:01 +02:00
parent 0f469eb2b9
commit 911573e0dd
2 changed files with 25 additions and 3 deletions

View File

@ -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<uint32>(lhs) == rhs;
}
inline bool operator==(uint32 lhs, APP_TYPE rhs)
{
return lhs == static_cast<uint32>(rhs);
}

View File

@ -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