From 3de8e7a8f234ddb23c0f241b72207424bf960c18 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 21 Feb 2021 09:22:51 -0500 Subject: [PATCH] acc: Stub GetNintendoAccountUserResourceCacheForApplication This command returns a Nintendo Account ID and writes 2 output buffers. The first output buffer is a NasUserBaseForApplication and the second output buffer is currently empty. Used by: - Pokken Tournament DX - Super Smash Bros. Ultimate - Super Nintendo Entertainment System - Nintendo Switch Online - Mario Kart 8 Deluxe --- src/core/hle/service/acc/acc.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 3ec0e1ecab..615e20a543 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -508,7 +508,7 @@ public: {1, &IManagerForApplication::GetAccountId, "GetAccountId"}, {2, nullptr, "EnsureIdTokenCacheAsync"}, {3, nullptr, "LoadIdTokenCache"}, - {130, nullptr, "GetNintendoAccountUserResourceCacheForApplication"}, + {130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"}, {150, nullptr, "CreateAuthorizationRequest"}, {160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"}, {170, nullptr, "LoadNetworkServiceLicenseKindAsync"}, @@ -534,6 +534,22 @@ private: rb.PushRaw(user_id.GetNintendoID()); } + void GetNintendoAccountUserResourceCacheForApplication(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + + std::vector nas_user_base_for_application(0x68); + ctx.WriteBuffer(nas_user_base_for_application, 0); + + if (ctx.CanWriteBuffer(1)) { + std::vector unknown_out_buffer(ctx.GetWriteBufferSize(1)); + ctx.WriteBuffer(unknown_out_buffer, 1); + } + + IPC::ResponseBuilder rb{ctx, 4}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw(user_id.GetNintendoID()); + } + void StoreOpenContext(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2};