From d2edb53282a83cf448c6075a496886febc4bdc7c Mon Sep 17 00:00:00 2001 From: emoose Date: Sun, 5 Jan 2020 20:23:44 +0000 Subject: [PATCH] [Kernel] Fix XamReadTile not returning profile pic, breaking dash profile... This caused dash not to load profile anymore, since dash passes user_index == kNone... The new method should be closer to how things are actually meant to work. --- src/xenia/kernel/xam/xam_user.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index e6f9c8379..c609c4f66 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -766,11 +766,6 @@ dword_result_t XamReadTile(dword_t tile_type, dword_t game_id, qword_t item_id, size_t data_len = 0; std::unique_ptr mmap; - auto user_profile = kernel_state()->user_profile(user_index); - if (!user_profile) { - return X_ERROR_INVALID_PARAMETER; // TODO: proper error code! - } - if (!output_ptr || !buffer_size_ptr) { return X_ERROR_FILE_NOT_FOUND; } @@ -779,6 +774,11 @@ dword_result_t XamReadTile(dword_t tile_type, dword_t game_id, qword_t item_id, if (kTileFileNames.count(type)) { // image_id = XUID of profile to retrieve from + auto user_profile = kernel_state()->user_profile(image_id); + if (!user_profile) { + return X_ERROR_INVALID_PARAMETER; // TODO: proper error code! + } + auto file_path = user_profile->path(); file_path += kTileFileNames.at(type); @@ -789,6 +789,11 @@ dword_result_t XamReadTile(dword_t tile_type, dword_t game_id, qword_t item_id, data = mmap->data(); data_len = mmap->size(); } else { + auto user_profile = kernel_state()->user_profile(user_index); + if (!user_profile) { + return X_ERROR_INVALID_PARAMETER; // TODO: proper error code! + } + auto gpd = user_profile->GetTitleGpd(game_id.value()); if (!gpd) {