summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar liamwhite2024-02-18 10:37:52 -0500
committerGravatar GitHub2024-02-18 10:37:52 -0500
commit1fc86b1e3a7690abfa668bb45b45ac0d5e4cc4f6 (patch)
tree61fd5e387c45642135fbcbb88ab326236f4f7789
parentMerge pull request #13064 from t895/auto-map-fail (diff)
parentservice: erpt: Implement SubmitContext (diff)
downloadyuzu-1fc86b1e3a7690abfa668bb45b45ac0d5e4cc4f6.tar.gz
yuzu-1fc86b1e3a7690abfa668bb45b45ac0d5e4cc4f6.tar.xz
yuzu-1fc86b1e3a7690abfa668bb45b45ac0d5e4cc4f6.zip
Merge pull request #13032 from german77/qlauncher
service: Implement functions needed by Qlaunch
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp5
-rw-r--r--src/core/hle/service/am/applet_manager.cpp18
-rw-r--r--src/core/hle/service/am/service/library_applet_self_accessor.cpp6
-rw-r--r--src/core/hle/service/am/service/library_applet_self_accessor.h2
-rw-r--r--src/core/hle/service/caps/caps_a.cpp11
-rw-r--r--src/core/hle/service/caps/caps_a.h3
-rw-r--r--src/core/hle/service/erpt/erpt.cpp12
7 files changed, 48 insertions, 9 deletions
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 29a10ad13..ee9795532 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&
329 329
330/// Returns if the system is allowing user registrations or not 330/// Returns if the system is allowing user registrations or not
331bool ProfileManager::CanSystemRegisterUser() const { 331bool ProfileManager::CanSystemRegisterUser() const {
332 return false; // TODO(ogniK): Games shouldn't have 332 // TODO: Both games and applets can register users. Determine when this condition is not meet.
333 // access to user registration, when we 333 return true;
334 // emulate qlaunch. Update this to dynamically change.
335} 334}
336 335
337bool ProfileManager::RemoveUser(UUID uuid) { 336bool ProfileManager::RemoveUser(UUID uuid) {
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,
35 return applet->caller_applet_broker->GetInData(); 35 return applet->caller_applet_broker->GetInData();
36} 36}
37 37
38void PushInShowQlaunch(Core::System& system, AppletStorageChannel& channel) {
39 const CommonArguments arguments{
40 .arguments_version = CommonArgumentVersion::Version3,
41 .size = CommonArgumentSize::Version3,
42 .library_version = 0,
43 .theme_color = ThemeColor::BasicBlack,
44 .play_startup_sound = true,
45 .system_tick = system.CoreTiming().GetClockTicks(),
46 };
47
48 std::vector<u8> argument_data(sizeof(arguments));
49 std::memcpy(argument_data.data(), &arguments, sizeof(arguments));
50 channel.Push(std::make_shared<IStorage>(system, std::move(argument_data)));
51}
52
38void PushInShowAlbum(Core::System& system, AppletStorageChannel& channel) { 53void PushInShowAlbum(Core::System& system, AppletStorageChannel& channel) {
39 const CommonArguments arguments{ 54 const CommonArguments arguments{
40 .arguments_version = CommonArgumentVersion::Version3, 55 .arguments_version = CommonArgumentVersion::Version3,
@@ -284,6 +299,9 @@ void AppletManager::CreateAndInsertByFrontendAppletParameters(
284 299
285 // Starting from frontend, some applets require input data. 300 // Starting from frontend, some applets require input data.
286 switch (applet->applet_id) { 301 switch (applet->applet_id) {
302 case AppletId::QLaunch:
303 PushInShowQlaunch(m_system, InitializeFakeCallerApplet(m_system, applet));
304 break;
287 case AppletId::Cabinet: 305 case AppletId::Cabinet:
288 PushInShowCabinetData(m_system, InitializeFakeCallerApplet(m_system, applet)); 306 PushInShowCabinetData(m_system, InitializeFakeCallerApplet(m_system, applet));
289 break; 307 break;
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<u64> out_applicat
284} 284}
285 285
286Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers( 286Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(
287 Out<bool> out_no_users_available, Out<s32> out_users_count, 287 Out<bool> out_can_select_any_user, Out<s32> out_users_count,
288 OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users) { 288 OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users) {
289 const Service::Account::ProfileManager manager{}; 289 const Service::Account::ProfileManager manager{};
290 290
291 *out_no_users_available = true; 291 *out_can_select_any_user = false;
292 *out_users_count = -1; 292 *out_users_count = -1;
293 293
294 LOG_INFO(Service_AM, "called"); 294 LOG_INFO(Service_AM, "called");
295 295
296 if (manager.GetUserCount() > 0) { 296 if (manager.GetUserCount() > 0) {
297 *out_no_users_available = false; 297 *out_can_select_any_user = true;
298 *out_users_count = static_cast<s32>(manager.GetUserCount()); 298 *out_users_count = static_cast<s32>(manager.GetUserCount());
299 299
300 const auto users = manager.GetAllUsers(); 300 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:
71 ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context); 71 ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context);
72 Result GetMainAppletApplicationDesiredLanguage(Out<u64> out_desired_language); 72 Result GetMainAppletApplicationDesiredLanguage(Out<u64> out_desired_language);
73 Result GetCurrentApplicationId(Out<u64> out_application_id); 73 Result GetCurrentApplicationId(Out<u64> out_application_id);
74 Result GetMainAppletAvailableUsers(Out<bool> out_no_users_available, Out<s32> out_users_count, 74 Result GetMainAppletAvailableUsers(Out<bool> out_can_select_any_user, Out<s32> out_users_count,
75 OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users); 75 OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users);
76 Result ShouldSetGpuTimeSliceManually(Out<bool> out_should_set_gpu_time_slice_manually); 76 Result ShouldSetGpuTimeSliceManually(Out<bool> out_should_set_gpu_time_slice_manually);
77 Result Cmd160(Out<u64> out_unknown0); 77 Result Cmd160(Out<u64> out_unknown0);
diff --git a/src/core/hle/service/caps/caps_a.cpp b/src/core/hle/service/caps/caps_a.cpp
index 47ff072c5..52228b830 100644
--- a/src/core/hle/service/caps/caps_a.cpp
+++ b/src/core/hle/service/caps/caps_a.cpp
@@ -16,7 +16,7 @@ IAlbumAccessorService::IAlbumAccessorService(Core::System& system_,
16 // clang-format off 16 // clang-format off
17 static const FunctionInfo functions[] = { 17 static const FunctionInfo functions[] = {
18 {0, nullptr, "GetAlbumFileCount"}, 18 {0, nullptr, "GetAlbumFileCount"},
19 {1, nullptr, "GetAlbumFileList"}, 19 {1, C<&IAlbumAccessorService::GetAlbumFileList>, "GetAlbumFileList"},
20 {2, nullptr, "LoadAlbumFile"}, 20 {2, nullptr, "LoadAlbumFile"},
21 {3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"}, 21 {3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"},
22 {4, nullptr, "StorageCopyAlbumFile"}, 22 {4, nullptr, "StorageCopyAlbumFile"},
@@ -62,6 +62,15 @@ IAlbumAccessorService::IAlbumAccessorService(Core::System& system_,
62 62
63IAlbumAccessorService::~IAlbumAccessorService() = default; 63IAlbumAccessorService::~IAlbumAccessorService() = default;
64 64
65Result IAlbumAccessorService::GetAlbumFileList(
66 Out<u64> out_count, AlbumStorage storage,
67 OutArray<AlbumEntry, BufferAttr_HipcMapAlias> out_entries) {
68 LOG_INFO(Service_Capture, "called, storage={}", storage);
69
70 const Result result = manager->GetAlbumFileList(out_entries, *out_count, storage, 0);
71 R_RETURN(TranslateResult(result));
72}
73
65Result IAlbumAccessorService::DeleteAlbumFile(AlbumFileId file_id) { 74Result IAlbumAccessorService::DeleteAlbumFile(AlbumFileId file_id) {
66 LOG_INFO(Service_Capture, "called, application_id=0x{:0x}, storage={}, type={}", 75 LOG_INFO(Service_Capture, "called, application_id=0x{:0x}, storage={}, type={}",
67 file_id.application_id, file_id.storage, file_id.type); 76 file_id.application_id, file_id.storage, file_id.type);
diff --git a/src/core/hle/service/caps/caps_a.h b/src/core/hle/service/caps/caps_a.h
index 2cb9b4547..c7a5208e3 100644
--- a/src/core/hle/service/caps/caps_a.h
+++ b/src/core/hle/service/caps/caps_a.h
@@ -21,6 +21,9 @@ public:
21 ~IAlbumAccessorService() override; 21 ~IAlbumAccessorService() override;
22 22
23private: 23private:
24 Result GetAlbumFileList(Out<u64> out_count, AlbumStorage storage,
25 OutArray<AlbumEntry, BufferAttr_HipcMapAlias> out_entries);
26
24 Result DeleteAlbumFile(AlbumFileId file_id); 27 Result DeleteAlbumFile(AlbumFileId file_id);
25 28
26 Result IsAlbumMounted(Out<bool> out_is_mounted, AlbumStorage storage); 29 Result IsAlbumMounted(Out<bool> out_is_mounted, AlbumStorage storage);
diff --git a/src/core/hle/service/erpt/erpt.cpp b/src/core/hle/service/erpt/erpt.cpp
index 3ea862fad..39ae3a723 100644
--- a/src/core/hle/service/erpt/erpt.cpp
+++ b/src/core/hle/service/erpt/erpt.cpp
@@ -3,6 +3,8 @@
3 3
4#include <memory> 4#include <memory>
5 5
6#include "common/logging/log.h"
7#include "core/hle/service/cmif_serialization.h"
6#include "core/hle/service/erpt/erpt.h" 8#include "core/hle/service/erpt/erpt.h"
7#include "core/hle/service/server_manager.h" 9#include "core/hle/service/server_manager.h"
8#include "core/hle/service/service.h" 10#include "core/hle/service/service.h"
@@ -15,7 +17,7 @@ public:
15 explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} { 17 explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} {
16 // clang-format off 18 // clang-format off
17 static const FunctionInfo functions[] = { 19 static const FunctionInfo functions[] = {
18 {0, nullptr, "SubmitContext"}, 20 {0, C<&ErrorReportContext::SubmitContext>, "SubmitContext"},
19 {1, nullptr, "CreateReportV0"}, 21 {1, nullptr, "CreateReportV0"},
20 {2, nullptr, "SetInitialLaunchSettingsCompletionTime"}, 22 {2, nullptr, "SetInitialLaunchSettingsCompletionTime"},
21 {3, nullptr, "ClearInitialLaunchSettingsCompletionTime"}, 23 {3, nullptr, "ClearInitialLaunchSettingsCompletionTime"},
@@ -36,6 +38,14 @@ public:
36 38
37 RegisterHandlers(functions); 39 RegisterHandlers(functions);
38 } 40 }
41
42private:
43 Result SubmitContext(InBuffer<BufferAttr_HipcMapAlias> buffer_a,
44 InBuffer<BufferAttr_HipcMapAlias> buffer_b) {
45 LOG_WARNING(Service_SET, "(STUBBED) called, buffer_a_size={}, buffer_b_size={}",
46 buffer_a.size(), buffer_b.size());
47 R_SUCCEED();
48 }
39}; 49};
40 50
41class ErrorReportSession final : public ServiceFramework<ErrorReportSession> { 51class ErrorReportSession final : public ServiceFramework<ErrorReportSession> {