diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index 7ef1fc8b1..33883d08a 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -590,7 +590,7 @@ void EmulatorApp::EmulatorThread() { if (cvars::mount_scratch) { auto scratch_device = std::make_unique( - "\\SCRATCH", "scratch", false); + "\\SCRATCH", emulator_->storage_root() / "scratch", false); if (!scratch_device->Initialize()) { XELOGE("Unable to scan scratch path"); } else { @@ -603,8 +603,8 @@ void EmulatorApp::EmulatorThread() { } if (cvars::mount_cache) { - auto cache0_device = - std::make_unique("\\CACHE0", "cache0", false); + auto cache0_device = std::make_unique( + "\\CACHE0", emulator_->storage_root() / "cache0", false); if (!cache0_device->Initialize()) { XELOGE("Unable to scan cache0 path"); } else { @@ -615,8 +615,8 @@ void EmulatorApp::EmulatorThread() { } } - auto cache1_device = - std::make_unique("\\CACHE1", "cache1", false); + auto cache1_device = std::make_unique( + "\\CACHE1", emulator_->storage_root() / "cache1", false); if (!cache1_device->Initialize()) { XELOGE("Unable to scan cache1 path"); } else { @@ -631,8 +631,8 @@ void EmulatorApp::EmulatorThread() { // NOTE: this must be registered _after_ the cache0/cache1 devices, due to // substring/start_with logic inside VirtualFileSystem::ResolvePath, else // accesses to those devices will go here instead - auto cache_device = - std::make_unique("\\CACHE", "cache", false); + auto cache_device = std::make_unique( + "\\CACHE", emulator_->storage_root() / "cache", false); if (!cache_device->Initialize()) { XELOGE("Unable to scan cache path"); } else { diff --git a/src/xenia/kernel/title_id_utils.h b/src/xenia/kernel/title_id_utils.h index 55930a761..42a080300 100644 --- a/src/xenia/kernel/title_id_utils.h +++ b/src/xenia/kernel/title_id_utils.h @@ -106,6 +106,37 @@ inline constexpr bool IsOriginalXboxTitle(const uint32_t title_id) { static_assert(IsOriginalXboxTitle(0x41430006)); // OG-Xbox 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 xe diff --git a/src/xenia/kernel/xam/user_settings.cc b/src/xenia/kernel/xam/user_settings.cc index 812227cea..e7d2e87de 100644 --- a/src/xenia/kernel/xam/user_settings.cc +++ b/src/xenia/kernel/xam/user_settings.cc @@ -25,7 +25,7 @@ const static std::array default_setting_values = { X_XAMACCOUNTINFO::AccountSubscriptionTier::kSubscriptionTierGold), UserSetting( 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) { setting_id_ = setting.setting_id_; diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index 58426b490..a5ef9cbdc 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -788,6 +788,16 @@ dword_result_t XamParseGamerTileKey_entry(pointer_t key_ptr, string_util::from_string(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; } DECLARE_XAM_EXPORT1(XamParseGamerTileKey, kUserProfiles, kImplemented); diff --git a/xenia-build.py b/xenia-build.py index 704e32ff5..f03a73982 100755 --- a/xenia-build.py +++ b/xenia-build.py @@ -49,28 +49,41 @@ def import_subprocess_environment(args): popen = subprocess.Popen( args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) variables, _ = popen.communicate() - envvars_to_save = ( - "devenvdir", - "include", - "lib", - "libpath", - "path", - "pathext", - "systemroot", - "temp", - "tmp", - "vcinstalldir", - "windowssdkdir", - ) - for line in variables.splitlines(): - for envvar in envvars_to_save: - if f"{envvar}=" in line.lower(): - var, setting = line.split("=", 1) - if envvar == "path": - setting = f"{os.path.dirname(sys.executable)}{os.pathsep}{setting}" - os.environ[var.upper()] = setting - break + envvars_to_save = ( + "DEVENVDIR", + "INCLUDE", + "LIB", + "LIBPATH", + "PATH", + "PATHEXT", + "SYSTEMROOT", + "TEMP", + "TMP", + "VCINSTALLDIR", + "WindowsSdkDir", + "PROGRAMFILES", + "ProgramFiles(x86)", + "VULKAN_SDK" + "CC", + "CXX", + ) + + # Extract and parse environment variables from stdout + for line in variables.splitlines(): + if line.find("=") != -1: + for envvar in envvars_to_save: + var, setting = line.split("=", 1) + + var = var.upper() + envvar = envvar.upper() + + if envvar == var: + if envvar == "PATH": + setting = f"{os.path.dirname(sys.executable)}{os.pathsep}{setting}" + + os.environ[var] = setting + break VSVERSION_MINIMUM = 2022 def import_vs_environment(): @@ -583,7 +596,7 @@ def get_clang_format_binary(): if int(clang_format_out.split("version ")[1].split(".")[0]) == int(clang_format_version_req): print(clang_format_out) return binary - print(f"ERROR: clang-format {clang_format_version_req} is not on PATH") + print(f"{bcolors.FAIL}ERROR: clang-format {clang_format_version_req} is not on PATH{bcolors.ENDC}") sys.exit(1)