From 3d79874828f02dbe96a3ab0c0ad0c25f9cf69780 Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Sat, 21 Dec 2024 13:30:14 +0000 Subject: [PATCH] [XAM] Fixed profile setting for preferred color Fixes Supreme Commander from crashing. --- src/xenia/kernel/xam/user_profile.cc | 4 ++-- src/xenia/kernel/xam/user_profile.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/xam/user_profile.cc b/src/xenia/kernel/xam/user_profile.cc index dab6e3903..513b35943 100644 --- a/src/xenia/kernel/xam/user_profile.cc +++ b/src/xenia/kernel/xam/user_profile.cc @@ -52,9 +52,9 @@ UserProfile::UserProfile(uint64_t xuid, X_XAMACCOUNTINFO* account_info) // XPROFILE_GAMER_CONTROL_SENSITIVITY AddSetting(std::make_unique(0x10040018, 0)); // Preferred color 1 - AddSetting(std::make_unique(0x1004001D, 0xFFFF0000u)); + AddSetting(std::make_unique(0x1004001D, PREFERRED_COLOR_NONE)); // Preferred color 2 - AddSetting(std::make_unique(0x1004001E, 0xFF00FF00u)); + AddSetting(std::make_unique(0x1004001E, PREFERRED_COLOR_NONE)); // XPROFILE_GAMER_ACTION_AUTO_AIM AddSetting(std::make_unique(0x10040022, 1)); // XPROFILE_GAMER_ACTION_AUTO_CENTER diff --git a/src/xenia/kernel/xam/user_profile.h b/src/xenia/kernel/xam/user_profile.h index fd79e4d4d..69e7afded 100644 --- a/src/xenia/kernel/xam/user_profile.h +++ b/src/xenia/kernel/xam/user_profile.h @@ -35,6 +35,21 @@ enum class X_USER_PROFILE_SETTING_SOURCE : uint32_t { UNKNOWN = 3, }; +enum PREFERRED_COLOR_OPTIONS : uint32_t { + PREFERRED_COLOR_NONE, + PREFERRED_COLOR_BLACK, + PREFERRED_COLOR_WHITE, + PREFERRED_COLOR_YELLOW, + PREFERRED_COLOR_ORANGE, + PREFERRED_COLOR_PINK, + PREFERRED_COLOR_RED, + PREFERRED_COLOR_PURPLE, + PREFERRED_COLOR_BLUE, + PREFERRED_COLOR_GREEN, + PREFERRED_COLOR_BROWN, + PREFERRED_COLOR_SILVER +}; + // Each setting contains 0x18 bytes long header struct X_USER_PROFILE_SETTING_HEADER { xe::be setting_id;