Skip to content

Commit

Permalink
TitleList: Use narrower filter for identifying data titles
Browse files Browse the repository at this point in the history
Previous code accidentally caught some game updates and dlc titles
  • Loading branch information
Exzap committed Aug 3, 2023
1 parent 1baeec1 commit b796925
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
23 changes: 23 additions & 0 deletions src/Cafe/TitleList/AppType.h
Original file line number Diff line number Diff line change
@@ -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);
}
5 changes: 2 additions & 3 deletions src/Cafe/TitleList/TitleInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -122,9 +123,7 @@ class TitleInfo
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
Expand Down

0 comments on commit b796925

Please sign in to comment.