summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/acc/acc.cpp35
-rw-r--r--src/core/hle/service/acc/acc.h2
2 files changed, 15 insertions, 22 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index cfac8ca9a..d7cc19361 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
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h
index 7a7dc9ec6..c79aea16a 100644
--- a/src/core/hle/service/acc/acc.h
+++ b/src/core/hle/service/acc/acc.h
@@ -35,7 +35,7 @@ public:
35 void GetProfileEditor(Kernel::HLERequestContext& ctx); 35 void GetProfileEditor(Kernel::HLERequestContext& ctx);
36 36
37 private: 37 private:
38 ResultCode InitializeApplicationInfoBase(u64 process_id); 38 ResultCode InitializeApplicationInfoBase();
39 39
40 enum class ApplicationType : u32_le { 40 enum class ApplicationType : u32_le {
41 GameCard = 0, 41 GameCard = 0,