From 2954c01b4730b84464ee5c27d9b62950b62ff9dc Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Wed, 14 Feb 2024 19:03:57 -0600 Subject: service: am: Add QLaunch launcher --- src/core/hle/service/am/applet_manager.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core/hle/service/am') diff --git a/src/core/hle/service/am/applet_manager.cpp b/src/core/hle/service/am/applet_manager.cpp index 4c7266f89..2e109181d 100644 --- a/src/core/hle/service/am/applet_manager.cpp +++ b/src/core/hle/service/am/applet_manager.cpp @@ -35,6 +35,21 @@ AppletStorageChannel& InitializeFakeCallerApplet(Core::System& system, return applet->caller_applet_broker->GetInData(); } +void PushInShowQlaunch(Core::System& system, AppletStorageChannel& channel) { + const CommonArguments arguments{ + .arguments_version = CommonArgumentVersion::Version3, + .size = CommonArgumentSize::Version3, + .library_version = 0, + .theme_color = ThemeColor::BasicBlack, + .play_startup_sound = true, + .system_tick = system.CoreTiming().GetClockTicks(), + }; + + std::vector argument_data(sizeof(arguments)); + std::memcpy(argument_data.data(), &arguments, sizeof(arguments)); + channel.Push(std::make_shared(system, std::move(argument_data))); +} + void PushInShowAlbum(Core::System& system, AppletStorageChannel& channel) { const CommonArguments arguments{ .arguments_version = CommonArgumentVersion::Version3, @@ -284,6 +299,9 @@ void AppletManager::CreateAndInsertByFrontendAppletParameters( // Starting from frontend, some applets require input data. switch (applet->applet_id) { + case AppletId::QLaunch: + PushInShowQlaunch(m_system, InitializeFakeCallerApplet(m_system, applet)); + break; case AppletId::Cabinet: PushInShowCabinetData(m_system, InitializeFakeCallerApplet(m_system, applet)); break; -- cgit v1.2.3 From dbcc447f43a3f348a38c6d6656a285cadf903700 Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Wed, 14 Feb 2024 19:13:43 -0600 Subject: service: am: Fix GetMainAppletAvailableUsers for user creation --- src/core/hle/service/am/service/library_applet_self_accessor.cpp | 6 +++--- src/core/hle/service/am/service/library_applet_self_accessor.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/am') 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.cpp index 7a3a86e88..94bd4dae6 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 out_applicat } Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers( - Out out_no_users_available, Out out_users_count, + Out out_can_select_any_user, Out out_users_count, OutArray 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(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.h index a9743569f..3e60393c2 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 error_context); Result GetMainAppletApplicationDesiredLanguage(Out out_desired_language); Result GetCurrentApplicationId(Out out_application_id); - Result GetMainAppletAvailableUsers(Out out_no_users_available, Out out_users_count, + Result GetMainAppletAvailableUsers(Out out_can_select_any_user, Out out_users_count, OutArray out_users); Result ShouldSetGpuTimeSliceManually(Out out_should_set_gpu_time_slice_manually); Result Cmd160(Out out_unknown0); -- cgit v1.2.3