[XAM] Added util functions to check gamer picture type
This commit is contained in:
@@ -106,6 +106,37 @@ inline constexpr bool IsOriginalXboxTitle(const uint32_t title_id) {
|
|||||||
static_assert(IsOriginalXboxTitle(0x41430006)); // OG-Xbox Game
|
static_assert(IsOriginalXboxTitle(0x41430006)); // OG-Xbox Game
|
||||||
static_assert(!IsOriginalXboxTitle(0x4D5308BC)); // 360 Game
|
static_assert(!IsOriginalXboxTitle(0x4D5308BC)); // 360 Game
|
||||||
|
|
||||||
|
inline constexpr bool IsGamerPictureAvatar(const uint32_t title_id) {
|
||||||
|
if (title_id == 0xFFFE0854 || (title_id & 0xFFFF0000) == 0x20000 ||
|
||||||
|
(title_id & 0xFFFF0000) == 0x10000) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline constexpr bool IsGamerPictureCustom(const uint32_t title_id) {
|
||||||
|
if (title_id == 0xFFFE0700 || (title_id & 0xFFFF0000) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline constexpr bool IsGamerPictureFromDash(const uint32_t title_id) {
|
||||||
|
return title_id == 0xFFFE07D1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline constexpr bool IsGamerPictureKeySet(const uint32_t title_id) {
|
||||||
|
return title_id != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static_assert(IsGamerPictureAvatar(0xFFFE0854)); // Avatar Gamer Picture
|
||||||
|
static_assert(IsGamerPictureCustom(0xFFFE0700)); // Custom Gamer Picture
|
||||||
|
static_assert(
|
||||||
|
IsGamerPictureFromDash(0xFFFE07D1)); // Default or OS Gamer Picture?
|
||||||
|
static_assert(!IsGamerPictureKeySet(0)); // No Gamer Picture Key
|
||||||
|
|
||||||
} // namespace kernel
|
} // namespace kernel
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const static std::array<UserSetting, 3> default_setting_values = {
|
|||||||
X_XAMACCOUNTINFO::AccountSubscriptionTier::kSubscriptionTierGold),
|
X_XAMACCOUNTINFO::AccountSubscriptionTier::kSubscriptionTierGold),
|
||||||
UserSetting(
|
UserSetting(
|
||||||
UserSettingId::XPROFILE_GAMERCARD_PICTURE_KEY,
|
UserSettingId::XPROFILE_GAMERCARD_PICTURE_KEY,
|
||||||
xe::string_util::read_u16string_and_swap(u"gamercard_picture_key"))};
|
xe::string_util::read_u16string_and_swap(u"FFFE07D10002000200010002"))};
|
||||||
|
|
||||||
UserSetting::UserSetting(const UserSetting& setting) : UserData(setting) {
|
UserSetting::UserSetting(const UserSetting& setting) : UserData(setting) {
|
||||||
setting_id_ = setting.setting_id_;
|
setting_id_ = setting.setting_id_;
|
||||||
|
|||||||
@@ -788,6 +788,16 @@ dword_result_t XamParseGamerTileKey_entry(pointer_t<X_USER_DATA> key_ptr,
|
|||||||
string_util::from_string<uint32_t>(small_tile_id, true);
|
string_util::from_string<uint32_t>(small_tile_id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_from_dash = false;
|
||||||
|
bool is_avatar = false;
|
||||||
|
bool is_custom = false;
|
||||||
|
|
||||||
|
if (title_id_ptr) {
|
||||||
|
is_from_dash = IsGamerPictureFromDash(*title_id_ptr);
|
||||||
|
is_avatar = IsGamerPictureAvatar(*title_id_ptr);
|
||||||
|
is_custom = IsGamerPictureCustom(*title_id_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
return X_ERROR_SUCCESS;
|
return X_ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
DECLARE_XAM_EXPORT1(XamParseGamerTileKey, kUserProfiles, kImplemented);
|
DECLARE_XAM_EXPORT1(XamParseGamerTileKey, kUserProfiles, kImplemented);
|
||||||
|
|||||||
Reference in New Issue
Block a user