summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/service/acc/acc.cpp46
-rw-r--r--src/core/hle/service/acc/acc.h3
-rw-r--r--src/core/hle/service/acc/acc_su.cpp2
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp2
-rw-r--r--src/core/hle/service/acc/acc_u1.cpp2
-rw-r--r--src/core/hle/service/caps/caps_su.cpp11
-rw-r--r--src/core/hle/service/caps/caps_su.h3
7 files changed, 43 insertions, 26 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index cfac8ca9a..9a7992f58 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -319,46 +319,37 @@ void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestCon
319 319
320void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { 320void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) {
321 IPC::RequestParser rp{ctx}; 321 IPC::RequestParser rp{ctx};
322 auto pid = rp.Pop<u64>();
323 322
324 LOG_DEBUG(Service_ACC, "called, process_id={}", pid); 323 LOG_DEBUG(Service_ACC, "called");
325 IPC::ResponseBuilder rb{ctx, 2}; 324 IPC::ResponseBuilder rb{ctx, 2};
326 rb.Push(InitializeApplicationInfoBase(pid)); 325 rb.Push(InitializeApplicationInfoBase());
327} 326}
328 327
329void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx) { 328void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx) {
330 IPC::RequestParser rp{ctx}; 329 IPC::RequestParser rp{ctx};
331 auto pid = rp.Pop<u64>();
332 330
333 LOG_WARNING(Service_ACC, "(Partial implementation) called, process_id={}", pid); 331 LOG_WARNING(Service_ACC, "(Partial implementation) called");
334 332
335 // TODO(ogniK): We require checking if the user actually owns the title and what not. As of 333 // TODO(ogniK): We require checking if the user actually owns the title and what not. As of
336 // currently, we assume the user owns the title. InitializeApplicationInfoBase SHOULD be called 334 // currently, we assume the user owns the title. InitializeApplicationInfoBase SHOULD be called
337 // first then we do extra checks if the game is a digital copy. 335 // first then we do extra checks if the game is a digital copy.
338 336
339 IPC::ResponseBuilder rb{ctx, 2}; 337 IPC::ResponseBuilder rb{ctx, 2};
340 rb.Push(InitializeApplicationInfoBase(pid)); 338 rb.Push(InitializeApplicationInfoBase());
341} 339}
342 340
343ResultCode Module::Interface::InitializeApplicationInfoBase(u64 process_id) { 341ResultCode Module::Interface::InitializeApplicationInfoBase() {
344 if (application_info) { 342 if (application_info) {
345 LOG_ERROR(Service_ACC, "Application already initialized"); 343 LOG_ERROR(Service_ACC, "Application already initialized");
346 return ERR_ACCOUNTINFO_ALREADY_INITIALIZED; 344 return ERR_ACCOUNTINFO_ALREADY_INITIALIZED;
347 } 345 }
348 346
349 const auto& list = system.Kernel().GetProcessList(); 347 // TODO(ogniK): This should be changed to reflect the target process for when we have multiple
350 const auto iter = std::find_if(list.begin(), list.end(), [&process_id](const auto& process) { 348 // processes emulated. As we don't actually have pid support we should assume we're just using
351 return process->GetProcessID() == process_id; 349 // our own process
352 }); 350 const auto& current_process = system.Kernel().CurrentProcess();
353 351 const auto launch_property =
354 if (iter == list.end()) { 352 system.GetARPManager().GetLaunchProperty(current_process->GetTitleID());
355 LOG_ERROR(Service_ACC, "Failed to find process ID");
356 application_info.application_type = ApplicationType::Unknown;
357
358 return ERR_ACCOUNTINFO_BAD_APPLICATION;
359 }
360
361 const auto launch_property = system.GetARPManager().GetLaunchProperty((*iter)->GetTitleID());
362 353
363 if (launch_property.Failed()) { 354 if (launch_property.Failed()) {
364 LOG_ERROR(Service_ACC, "Failed to get launch property"); 355 LOG_ERROR(Service_ACC, "Failed to get launch property");
@@ -372,10 +363,12 @@ ResultCode Module::Interface::InitializeApplicationInfoBase(u64 process_id) {
372 case FileSys::StorageId::Host: 363 case FileSys::StorageId::Host:
373 case FileSys::StorageId::NandUser: 364 case FileSys::StorageId::NandUser:
374 case FileSys::StorageId::SdCard: 365 case FileSys::StorageId::SdCard:
366 case FileSys::StorageId::None: // Yuzu specific, differs from hardware
375 application_info.application_type = ApplicationType::Digital; 367 application_info.application_type = ApplicationType::Digital;
376 break; 368 break;
377 default: 369 default:
378 LOG_ERROR(Service_ACC, "Invalid game storage ID"); 370 LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}",
371 launch_property->base_game_storage_id);
379 return ERR_ACCOUNTINFO_BAD_APPLICATION; 372 return ERR_ACCOUNTINFO_BAD_APPLICATION;
380 } 373 }
381 374
@@ -428,6 +421,17 @@ void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
428 rb.PushIpcInterface<IProfileEditor>(user_id, *profile_manager); 421 rb.PushIpcInterface<IProfileEditor>(user_id, *profile_manager);
429} 422}
430 423
424void Module::Interface::ListQualifiedUsers(Kernel::HLERequestContext& ctx) {
425 LOG_DEBUG(Service_ACC, "called");
426
427 // All users should be qualified. We don't actually have parental control or anything to do with
428 // nintendo online currently. We're just going to assume the user running the game has access to
429 // the game regardless of parental control settings.
430 ctx.WriteBuffer(profile_manager->GetAllUsers());
431 IPC::ResponseBuilder rb{ctx, 2};
432 rb.Push(RESULT_SUCCESS);
433}
434
431void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) { 435void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) {
432 LOG_DEBUG(Service_ACC, "called"); 436 LOG_DEBUG(Service_ACC, "called");
433 // A u8 is passed into this function which we can safely ignore. It's to determine if we have 437 // A u8 is passed into this function which we can safely ignore. It's to determine if we have
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h
index 7a7dc9ec6..74ca39d6e 100644
--- a/src/core/hle/service/acc/acc.h
+++ b/src/core/hle/service/acc/acc.h
@@ -33,9 +33,10 @@ public:
33 void TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx); 33 void TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx);
34 void IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx); 34 void IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx);
35 void GetProfileEditor(Kernel::HLERequestContext& ctx); 35 void GetProfileEditor(Kernel::HLERequestContext& ctx);
36 void ListQualifiedUsers(Kernel::HLERequestContext& ctx);
36 37
37 private: 38 private:
38 ResultCode InitializeApplicationInfoBase(u64 process_id); 39 ResultCode InitializeApplicationInfoBase();
39 40
40 enum class ApplicationType : u32_le { 41 enum class ApplicationType : u32_le {
41 GameCard = 0, 42 GameCard = 0,
diff --git a/src/core/hle/service/acc/acc_su.cpp b/src/core/hle/service/acc/acc_su.cpp
index ae88deda5..2eefc6df5 100644
--- a/src/core/hle/service/acc/acc_su.cpp
+++ b/src/core/hle/service/acc/acc_su.cpp
@@ -35,7 +35,7 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p
35 {113, nullptr, "GetSaveDataThumbnailExistence"}, 35 {113, nullptr, "GetSaveDataThumbnailExistence"},
36 {120, nullptr, "ListOpenUsersInApplication"}, 36 {120, nullptr, "ListOpenUsersInApplication"},
37 {130, nullptr, "ActivateOpenContextRetention"}, 37 {130, nullptr, "ActivateOpenContextRetention"},
38 {140, nullptr, "ListQualifiedUsers"}, 38 {140, &ACC_SU::ListQualifiedUsers, "ListQualifiedUsers"},
39 {150, nullptr, "AuthenticateApplicationAsync"}, 39 {150, nullptr, "AuthenticateApplicationAsync"},
40 {190, nullptr, "GetUserLastOpenedApplication"}, 40 {190, nullptr, "GetUserLastOpenedApplication"},
41 {191, nullptr, "ActivateOpenContextHolder"}, 41 {191, nullptr, "ActivateOpenContextHolder"},
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp
index 0ac19f4ff..fb4e7e772 100644
--- a/src/core/hle/service/acc/acc_u0.cpp
+++ b/src/core/hle/service/acc/acc_u0.cpp
@@ -32,7 +32,7 @@ ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p
32 {130, nullptr, "LoadOpenContext"}, 32 {130, nullptr, "LoadOpenContext"},
33 {131, nullptr, "ListOpenContextStoredUsers"}, 33 {131, nullptr, "ListOpenContextStoredUsers"},
34 {140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"}, 34 {140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"},
35 {141, nullptr, "ListQualifiedUsers"}, 35 {141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers"},
36 {150, &ACC_U0::IsUserAccountSwitchLocked, "IsUserAccountSwitchLocked"}, 36 {150, &ACC_U0::IsUserAccountSwitchLocked, "IsUserAccountSwitchLocked"},
37 }; 37 };
38 // clang-format on 38 // clang-format on
diff --git a/src/core/hle/service/acc/acc_u1.cpp b/src/core/hle/service/acc/acc_u1.cpp
index 2b9c11928..9f29cdc82 100644
--- a/src/core/hle/service/acc/acc_u1.cpp
+++ b/src/core/hle/service/acc/acc_u1.cpp
@@ -34,7 +34,7 @@ ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p
34 {112, nullptr, "LoadSaveDataThumbnail"}, 34 {112, nullptr, "LoadSaveDataThumbnail"},
35 {113, nullptr, "GetSaveDataThumbnailExistence"}, 35 {113, nullptr, "GetSaveDataThumbnailExistence"},
36 {130, nullptr, "ActivateOpenContextRetention"}, 36 {130, nullptr, "ActivateOpenContextRetention"},
37 {140, nullptr, "ListQualifiedUsers"}, 37 {140, &ACC_U1::ListQualifiedUsers, "ListQualifiedUsers"},
38 {150, nullptr, "AuthenticateApplicationAsync"}, 38 {150, nullptr, "AuthenticateApplicationAsync"},
39 {190, nullptr, "GetUserLastOpenedApplication"}, 39 {190, nullptr, "GetUserLastOpenedApplication"},
40 {191, nullptr, "ActivateOpenContextHolder"}, 40 {191, nullptr, "ActivateOpenContextHolder"},
diff --git a/src/core/hle/service/caps/caps_su.cpp b/src/core/hle/service/caps/caps_su.cpp
index b4d9355ef..e8b0698e8 100644
--- a/src/core/hle/service/caps/caps_su.cpp
+++ b/src/core/hle/service/caps/caps_su.cpp
@@ -2,6 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h"
5#include "core/hle/service/caps/caps_su.h" 7#include "core/hle/service/caps/caps_su.h"
6 8
7namespace Service::Capture { 9namespace Service::Capture {
@@ -9,7 +11,7 @@ namespace Service::Capture {
9CAPS_SU::CAPS_SU() : ServiceFramework("caps:su") { 11CAPS_SU::CAPS_SU() : ServiceFramework("caps:su") {
10 // clang-format off 12 // clang-format off
11 static const FunctionInfo functions[] = { 13 static const FunctionInfo functions[] = {
12 {32, nullptr, "SetShimLibraryVersion"}, 14 {32, &CAPS_SU::SetShimLibraryVersion, "SetShimLibraryVersion"},
13 {201, nullptr, "SaveScreenShot"}, 15 {201, nullptr, "SaveScreenShot"},
14 {203, nullptr, "SaveScreenShotEx0"}, 16 {203, nullptr, "SaveScreenShotEx0"},
15 {205, nullptr, "SaveScreenShotEx1"}, 17 {205, nullptr, "SaveScreenShotEx1"},
@@ -22,4 +24,11 @@ CAPS_SU::CAPS_SU() : ServiceFramework("caps:su") {
22 24
23CAPS_SU::~CAPS_SU() = default; 25CAPS_SU::~CAPS_SU() = default;
24 26
27void CAPS_SU::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
28 LOG_WARNING(Service_Capture, "(STUBBED) called");
29
30 IPC::ResponseBuilder rb{ctx, 2};
31 rb.Push(RESULT_SUCCESS);
32}
33
25} // namespace Service::Capture 34} // namespace Service::Capture
diff --git a/src/core/hle/service/caps/caps_su.h b/src/core/hle/service/caps/caps_su.h
index cb11f7c9a..c494d7c84 100644
--- a/src/core/hle/service/caps/caps_su.h
+++ b/src/core/hle/service/caps/caps_su.h
@@ -16,6 +16,9 @@ class CAPS_SU final : public ServiceFramework<CAPS_SU> {
16public: 16public:
17 explicit CAPS_SU(); 17 explicit CAPS_SU();
18 ~CAPS_SU() override; 18 ~CAPS_SU() override;
19
20private:
21 void SetShimLibraryVersion(Kernel::HLERequestContext& ctx);
19}; 22};
20 23
21} // namespace Service::Capture 24} // namespace Service::Capture