[Input] Add last used controller tracker

This commit is contained in:
NicknineTheEagle
2024-10-07 21:58:59 +03:00
committed by Radosław Gliński
parent 0a0cd2a882
commit 842161ca9b
3 changed files with 12 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
#include "third_party/fmt/include/fmt/format.h"
#include "xenia/base/logging.h"
#include "xenia/emulator.h"
#include "xenia/hid/input_system.h"
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/util/crypto_utils.h"
#include "xenia/vfs/devices/host_path_device.h"
@@ -149,6 +150,10 @@ UserProfile* ProfileManager::GetProfile(const uint64_t xuid) const {
}
UserProfile* ProfileManager::GetProfile(uint8_t user_index) const {
if (user_index == XUserIndexLatest) {
user_index = kernel_state_->emulator()->input_system()->GetLastUsedSlot();
}
if (user_index == XUserIndexNone) {
return nullptr;
}