Skip to content

Commit f65f044

Browse files
The-Little-WolfGliniak
authored andcommitted
[XAM/UI] - XamShowMarketplaceUI Improvements
- Replacing magic numbers - Replacing unknown parameters - Adding more xnotification ids
1 parent 1d7973a commit f65f044

File tree

2 files changed

+41
-27
lines changed

2 files changed

+41
-27
lines changed

src/xenia/kernel/xam/xam_ui.cc

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -620,15 +620,19 @@ dword_result_t XamGetDashContext_entry(const ppc_context_t& ctx) {
620620
DECLARE_XAM_EXPORT1(XamGetDashContext, kNone, kImplemented);
621621

622622
// https://gitlab.com/GlitchyScripts/xlivelessness/-/blob/master/xlivelessness/xlive/xdefs.hpp?ref_type=heads#L1235
623-
X_HRESULT xeXShowMarketplaceUIEx(dword_t user_index, dword_t ui_type,
624-
qword_t offer_id, dword_t content_types,
625-
unknown_t unk5, unknown_t unk6, unknown_t unk7,
626-
unknown_t unk8) {
623+
dword_result_t XamShowMarketplaceUIEx_entry(dword_t user_index, dword_t ui_type,
624+
qword_t offer_id,
625+
dword_t offer_type,
626+
dword_t content_category,
627+
unknown_t unk6, unknown_t unk7,
628+
dword_t title_id) {
627629
// ui_type:
628630
// 0 - view all content for the current title
629631
// 1 - view content specified by offer id
630-
// content_types:
631-
// game specific, usually just -1
632+
// offer_types:
633+
// filter for content list, usually just -1
634+
// content_category:
635+
// filter on item types for games (e.g. cars, maps, weapons, etc)
632636
if (user_index >= XUserMaxUserCount) {
633637
return X_ERROR_INVALID_PARAMETER;
634638
}
@@ -750,32 +754,20 @@ X_HRESULT xeXShowMarketplaceUIEx(dword_t user_index, dword_t ui_type,
750754
return xeXamDispatchDialogAsync<MessageBoxDialog>(
751755
new MessageBoxDialog(imgui_drawer, title, desc, buttons, 0), close);
752756
}
757+
DECLARE_XAM_EXPORT1(XamShowMarketplaceUIEx, kUI, kSketchy);
753758

754759
dword_result_t XamShowMarketplaceUI_entry(dword_t user_index, dword_t ui_type,
755-
qword_t offer_id,
756-
dword_t content_types, unknown_t unk5,
757-
unknown_t unk6) {
758-
return xeXShowMarketplaceUIEx(user_index, ui_type, offer_id, content_types,
759-
unk5, 0, 0, unk6);
760+
qword_t offer_id, dword_t offer_type,
761+
dword_t content_category,
762+
dword_t title_id) {
763+
return XamShowMarketplaceUIEx_entry(user_index, ui_type, offer_id, offer_type,
764+
content_category, 0, 0, title_id);
760765
}
761766
DECLARE_XAM_EXPORT1(XamShowMarketplaceUI, kUI, kSketchy);
762767

763-
dword_result_t XamShowMarketplaceUIEx_entry(dword_t user_index, dword_t ui_type,
764-
qword_t offer_id,
765-
dword_t content_types,
766-
unknown_t unk5, unknown_t unk6,
767-
unknown_t unk7, unknown_t unk8) {
768-
return xeXShowMarketplaceUIEx(user_index, ui_type, offer_id, content_types,
769-
unk5, unk6, unk7, unk8);
770-
}
771-
DECLARE_XAM_EXPORT1(XamShowMarketplaceUIEx, kUI, kSketchy);
772-
773768
dword_result_t XamShowMarketplaceDownloadItemsUI_entry(
774769
dword_t user_index, dword_t ui_type, lpqword_t offers, dword_t num_offers,
775770
lpdword_t hresult_ptr, pointer_t<XAM_OVERLAPPED> overlapped) {
776-
// ui_type:
777-
// 1000 - free
778-
// 1001 - paid
779771
if (user_index >= XUserMaxUserCount || !offers || num_offers > 6) {
780772
return X_ERROR_INVALID_PARAMETER;
781773
}
@@ -813,12 +805,12 @@ dword_result_t XamShowMarketplaceDownloadItemsUI_entry(
813805
cxxopts::OptionNames buttons = {"OK"};
814806

815807
switch (ui_type) {
816-
case 1000:
808+
case X_MARKETPLACE_DOWNLOAD_ITEMS_ENTRYPOINTS::FREEITEMS:
817809
desc =
818810
"Game requested to open download page for the following free offer "
819811
"IDs:";
820812
break;
821-
case 1001:
813+
case X_MARKETPLACE_DOWNLOAD_ITEMS_ENTRYPOINTS::PAIDITEMS:
822814
desc =
823815
"Game requested to open download page for the following offer IDs:";
824816
break;
@@ -845,7 +837,7 @@ DECLARE_XAM_EXPORT1(XamShowMarketplaceDownloadItemsUI, kUI, kSketchy);
845837

846838
dword_result_t XamShowForcedNameChangeUI_entry(dword_t user_index) {
847839
// Changes from 6 to 8 past NXE
848-
return xeXShowMarketplaceUIEx(user_index, 6, 0, 0xffffffff, 0, 0, 0, 0);
840+
return XamShowMarketplaceUIEx_entry(user_index, 6, 0, 0xffffffff, 0, 0, 0, 0);
849841
}
850842
DECLARE_XAM_EXPORT1(XamShowForcedNameChangeUI, kUI, kImplemented);
851843

src/xenia/xbox.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,16 @@ enum : XNotificationID {
324324
kXNotificationLiveConnectionChanged = 0x02000001,
325325
kXNotificationLiveInviteAccepted = 0x02000002,
326326
kXNotificationLiveLinkStateChanged = 0x02000003,
327+
kXNotificationLiveInvitedRecieved = 0x02000004,
328+
kXNotificationLiveInvitedAnswerRecieved = 0x02000005,
329+
kXNotificationLiveMessageListChanged = 0x02000006,
327330
kXNotificationLiveContentInstalled = 0x02000007,
328331
kXNotificationLiveMembershipPurchased = 0x02000008,
329332
kXNotificationLiveVoicechatAway = 0x02000009,
330333
kXNotificationLivePresenceChanged = 0x0200000A,
334+
kXNotificationLivePointsBalanceChanged = 0x0200000B,
335+
kXNotificationLivePlayerListChanged = 0x0200000C,
336+
kXNotificationLiveItemPurchased = 0x0200000D,
331337

332338
// XNotification Friends
333339
kXNotificationFriendsPresenceChanged = 0x04000001,
@@ -690,6 +696,17 @@ inline const std::map<XContentType, std::string> XContentTypeMap = {
690696
{XContentType::kCommunityGame, "Community Game"},
691697
};
692698

699+
enum class X_MARKETPLACE_OFFERING_TYPE : uint32_t {
700+
Content = 0x00000002,
701+
GameDemo = 0x00000020,
702+
GameTrailer = 0x00000040,
703+
Theme = 0x00000080,
704+
Tile = 0x00000800,
705+
Arcade = 0x00002000,
706+
Video = 0x00004000,
707+
Consumable = 0x00010000,
708+
};
709+
693710
enum X_MARKETPLACE_ENTRYPOINT : uint32_t {
694711
ContentList = 0,
695712
ContentItem = 1,
@@ -703,6 +720,11 @@ enum X_MARKETPLACE_ENTRYPOINT : uint32_t {
703720
ActiveDownloads = 12
704721
};
705722

723+
enum X_MARKETPLACE_DOWNLOAD_ITEMS_ENTRYPOINTS : uint32_t {
724+
FREEITEMS = 1000,
725+
PAIDITEMS,
726+
};
727+
706728
enum class XDeploymentType : uint32_t {
707729
kOpticalDisc = 0,
708730
kInstalledToHDD = 1, // Like extracted?

0 commit comments

Comments
 (0)