[XAM/UI] - XamShowMarketplaceUI Improvements

- Replacing magic numbers
- Replacing unknown parameters
- Adding more xnotification ids
This commit is contained in:
The-Little-Wolf 2025-06-13 11:37:58 -07:00 committed by Radosław Gliński
parent 1d7973aea5
commit f65f044ee5
2 changed files with 41 additions and 27 deletions

View file

@ -620,15 +620,19 @@ dword_result_t XamGetDashContext_entry(const ppc_context_t& ctx) {
DECLARE_XAM_EXPORT1(XamGetDashContext, kNone, kImplemented); DECLARE_XAM_EXPORT1(XamGetDashContext, kNone, kImplemented);
// https://gitlab.com/GlitchyScripts/xlivelessness/-/blob/master/xlivelessness/xlive/xdefs.hpp?ref_type=heads#L1235 // https://gitlab.com/GlitchyScripts/xlivelessness/-/blob/master/xlivelessness/xlive/xdefs.hpp?ref_type=heads#L1235
X_HRESULT xeXShowMarketplaceUIEx(dword_t user_index, dword_t ui_type, dword_result_t XamShowMarketplaceUIEx_entry(dword_t user_index, dword_t ui_type,
qword_t offer_id, dword_t content_types, qword_t offer_id,
unknown_t unk5, unknown_t unk6, unknown_t unk7, dword_t offer_type,
unknown_t unk8) { dword_t content_category,
unknown_t unk6, unknown_t unk7,
dword_t title_id) {
// ui_type: // ui_type:
// 0 - view all content for the current title // 0 - view all content for the current title
// 1 - view content specified by offer id // 1 - view content specified by offer id
// content_types: // offer_types:
// game specific, usually just -1 // filter for content list, usually just -1
// content_category:
// filter on item types for games (e.g. cars, maps, weapons, etc)
if (user_index >= XUserMaxUserCount) { if (user_index >= XUserMaxUserCount) {
return X_ERROR_INVALID_PARAMETER; return X_ERROR_INVALID_PARAMETER;
} }
@ -750,32 +754,20 @@ X_HRESULT xeXShowMarketplaceUIEx(dword_t user_index, dword_t ui_type,
return xeXamDispatchDialogAsync<MessageBoxDialog>( return xeXamDispatchDialogAsync<MessageBoxDialog>(
new MessageBoxDialog(imgui_drawer, title, desc, buttons, 0), close); new MessageBoxDialog(imgui_drawer, title, desc, buttons, 0), close);
} }
DECLARE_XAM_EXPORT1(XamShowMarketplaceUIEx, kUI, kSketchy);
dword_result_t XamShowMarketplaceUI_entry(dword_t user_index, dword_t ui_type, dword_result_t XamShowMarketplaceUI_entry(dword_t user_index, dword_t ui_type,
qword_t offer_id, qword_t offer_id, dword_t offer_type,
dword_t content_types, unknown_t unk5, dword_t content_category,
unknown_t unk6) { dword_t title_id) {
return xeXShowMarketplaceUIEx(user_index, ui_type, offer_id, content_types, return XamShowMarketplaceUIEx_entry(user_index, ui_type, offer_id, offer_type,
unk5, 0, 0, unk6); content_category, 0, 0, title_id);
} }
DECLARE_XAM_EXPORT1(XamShowMarketplaceUI, kUI, kSketchy); DECLARE_XAM_EXPORT1(XamShowMarketplaceUI, kUI, kSketchy);
dword_result_t XamShowMarketplaceUIEx_entry(dword_t user_index, dword_t ui_type,
qword_t offer_id,
dword_t content_types,
unknown_t unk5, unknown_t unk6,
unknown_t unk7, unknown_t unk8) {
return xeXShowMarketplaceUIEx(user_index, ui_type, offer_id, content_types,
unk5, unk6, unk7, unk8);
}
DECLARE_XAM_EXPORT1(XamShowMarketplaceUIEx, kUI, kSketchy);
dword_result_t XamShowMarketplaceDownloadItemsUI_entry( dword_result_t XamShowMarketplaceDownloadItemsUI_entry(
dword_t user_index, dword_t ui_type, lpqword_t offers, dword_t num_offers, dword_t user_index, dword_t ui_type, lpqword_t offers, dword_t num_offers,
lpdword_t hresult_ptr, pointer_t<XAM_OVERLAPPED> overlapped) { lpdword_t hresult_ptr, pointer_t<XAM_OVERLAPPED> overlapped) {
// ui_type:
// 1000 - free
// 1001 - paid
if (user_index >= XUserMaxUserCount || !offers || num_offers > 6) { if (user_index >= XUserMaxUserCount || !offers || num_offers > 6) {
return X_ERROR_INVALID_PARAMETER; return X_ERROR_INVALID_PARAMETER;
} }
@ -813,12 +805,12 @@ dword_result_t XamShowMarketplaceDownloadItemsUI_entry(
cxxopts::OptionNames buttons = {"OK"}; cxxopts::OptionNames buttons = {"OK"};
switch (ui_type) { switch (ui_type) {
case 1000: case X_MARKETPLACE_DOWNLOAD_ITEMS_ENTRYPOINTS::FREEITEMS:
desc = desc =
"Game requested to open download page for the following free offer " "Game requested to open download page for the following free offer "
"IDs:"; "IDs:";
break; break;
case 1001: case X_MARKETPLACE_DOWNLOAD_ITEMS_ENTRYPOINTS::PAIDITEMS:
desc = desc =
"Game requested to open download page for the following offer IDs:"; "Game requested to open download page for the following offer IDs:";
break; break;
@ -845,7 +837,7 @@ DECLARE_XAM_EXPORT1(XamShowMarketplaceDownloadItemsUI, kUI, kSketchy);
dword_result_t XamShowForcedNameChangeUI_entry(dword_t user_index) { dword_result_t XamShowForcedNameChangeUI_entry(dword_t user_index) {
// Changes from 6 to 8 past NXE // Changes from 6 to 8 past NXE
return xeXShowMarketplaceUIEx(user_index, 6, 0, 0xffffffff, 0, 0, 0, 0); return XamShowMarketplaceUIEx_entry(user_index, 6, 0, 0xffffffff, 0, 0, 0, 0);
} }
DECLARE_XAM_EXPORT1(XamShowForcedNameChangeUI, kUI, kImplemented); DECLARE_XAM_EXPORT1(XamShowForcedNameChangeUI, kUI, kImplemented);

View file

@ -324,10 +324,16 @@ enum : XNotificationID {
kXNotificationLiveConnectionChanged = 0x02000001, kXNotificationLiveConnectionChanged = 0x02000001,
kXNotificationLiveInviteAccepted = 0x02000002, kXNotificationLiveInviteAccepted = 0x02000002,
kXNotificationLiveLinkStateChanged = 0x02000003, kXNotificationLiveLinkStateChanged = 0x02000003,
kXNotificationLiveInvitedRecieved = 0x02000004,
kXNotificationLiveInvitedAnswerRecieved = 0x02000005,
kXNotificationLiveMessageListChanged = 0x02000006,
kXNotificationLiveContentInstalled = 0x02000007, kXNotificationLiveContentInstalled = 0x02000007,
kXNotificationLiveMembershipPurchased = 0x02000008, kXNotificationLiveMembershipPurchased = 0x02000008,
kXNotificationLiveVoicechatAway = 0x02000009, kXNotificationLiveVoicechatAway = 0x02000009,
kXNotificationLivePresenceChanged = 0x0200000A, kXNotificationLivePresenceChanged = 0x0200000A,
kXNotificationLivePointsBalanceChanged = 0x0200000B,
kXNotificationLivePlayerListChanged = 0x0200000C,
kXNotificationLiveItemPurchased = 0x0200000D,
// XNotification Friends // XNotification Friends
kXNotificationFriendsPresenceChanged = 0x04000001, kXNotificationFriendsPresenceChanged = 0x04000001,
@ -690,6 +696,17 @@ inline const std::map<XContentType, std::string> XContentTypeMap = {
{XContentType::kCommunityGame, "Community Game"}, {XContentType::kCommunityGame, "Community Game"},
}; };
enum class X_MARKETPLACE_OFFERING_TYPE : uint32_t {
Content = 0x00000002,
GameDemo = 0x00000020,
GameTrailer = 0x00000040,
Theme = 0x00000080,
Tile = 0x00000800,
Arcade = 0x00002000,
Video = 0x00004000,
Consumable = 0x00010000,
};
enum X_MARKETPLACE_ENTRYPOINT : uint32_t { enum X_MARKETPLACE_ENTRYPOINT : uint32_t {
ContentList = 0, ContentList = 0,
ContentItem = 1, ContentItem = 1,
@ -703,6 +720,11 @@ enum X_MARKETPLACE_ENTRYPOINT : uint32_t {
ActiveDownloads = 12 ActiveDownloads = 12
}; };
enum X_MARKETPLACE_DOWNLOAD_ITEMS_ENTRYPOINTS : uint32_t {
FREEITEMS = 1000,
PAIDITEMS,
};
enum class XDeploymentType : uint32_t { enum class XDeploymentType : uint32_t {
kOpticalDisc = 0, kOpticalDisc = 0,
kInstalledToHDD = 1, // Like extracted? kInstalledToHDD = 1, // Like extracted?