VERY experimental Nintendo Switch 2 emulator
C++
service: am: Fix GetMainAppletAvailableUsers for user creation
Narr the Regae802f224503
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cppindex 29a10ad13b..ee9795532d 100644--- a/src/core/hle/service/acc/profile_manager.cpp+++ b/src/core/hle/service/acc/profile_manager.cpp@@ -329,9 +329,8 @@ bool ProfileManager::GetProfileBaseAndData(const ProfileInfo& user, ProfileBase&/// Returns if the system is allowing user registrations or notbool ProfileManager::CanSystemRegisterUser() const {- return false; // TODO(ogniK): Games shouldn't have- // access to user registration, when we- // emulate qlaunch. Update this to dynamically change.+ // TODO: Both games and applets can register users. Determine when this condition is not meet.+ return true;}bool ProfileManager::RemoveUser(UUID uuid) {diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.cpp b/src/core/hle/service/am/service/library_applet_self_accessor.cppindex 7a3a86e88b..94bd4dae6a 100644--- a/src/core/hle/service/am/service/library_applet_self_accessor.cpp+++ b/src/core/hle/service/am/service/library_applet_self_accessor.cpp@@ -284,17 +284,17 @@ Result ILibraryAppletSelfAccessor::GetCurrentApplicationId(Out<u64> out_applicat}Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(- Out<bool> out_no_users_available, Out<s32> out_users_count,+ Out<bool> out_can_select_any_user, Out<s32> out_users_count,OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users) {const Service::Account::ProfileManager manager{};- *out_no_users_available = true;+ *out_can_select_any_user = false;*out_users_count = -1;LOG_INFO(Service_AM, "called");if (manager.GetUserCount() > 0) {- *out_no_users_available = false;+ *out_can_select_any_user = true;*out_users_count = static_cast<s32>(manager.GetUserCount());const auto users = manager.GetAllUsers();diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.h b/src/core/hle/service/am/service/library_applet_self_accessor.hindex a9743569fb..3e60393c27 100644--- a/src/core/hle/service/am/service/library_applet_self_accessor.h+++ b/src/core/hle/service/am/service/library_applet_self_accessor.h@@ -71,7 +71,7 @@ private:ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context);Result GetMainAppletApplicationDesiredLanguage(Out<u64> out_desired_language);Result GetCurrentApplicationId(Out<u64> out_application_id);- Result GetMainAppletAvailableUsers(Out<bool> out_no_users_available, Out<s32> out_users_count,+ Result GetMainAppletAvailableUsers(Out<bool> out_can_select_any_user, Out<s32> out_users_count,OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users);Result ShouldSetGpuTimeSliceManually(Out<bool> out_should_set_gpu_time_slice_manually);Result Cmd160(Out<u64> out_unknown0);