From d6ab54c97bd866892d041c8ae2358736fe25e786 Mon Sep 17 00:00:00 2001 From: lizzie Date: Tue, 15 Sep 2026 14:34:21 +0000 Subject: [PATCH] 2026-09-15 14:34:21 Signed-off-by: lizzie --- src/core/hle/service/acc/profile_manager.h | 6 ++++ src/core/hle/service/ngc/ngc.cpp | 35 +++++++++++++--------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h index 1fd0cc700f..81688175c2 100644 --- a/src/core/hle/service/acc/profile_manager.h +++ b/src/core/hle/service/acc/profile_manager.h @@ -23,6 +23,12 @@ constexpr std::size_t profile_username_size{32}; using ProfileUsername = std::array; using UserIDArray = std::array; +// This is nn::account::Uid +struct Uid { + std::array unk0; +}; +static_assert(sizeof(Uid) == 0x10); + /// Contains extra data related to a user. /// TODO: RE this structure struct UserData { diff --git a/src/core/hle/service/ngc/ngc.cpp b/src/core/hle/service/ngc/ngc.cpp index abb9a87c87..e79108a1eb 100644 --- a/src/core/hle/service/ngc/ngc.cpp +++ b/src/core/hle/service/ngc/ngc.cpp @@ -8,6 +8,7 @@ #include "core/core.h" #include "core/hle/kernel/k_client_session.h" #include "core/hle/result.h" +#include "core/hle/service/acc/profile_manager.h" #include "core/hle/service/cmif_types.h" #include "core/hle/service/cmif_serialization.h" #include "core/hle/service/ipc_helpers.h" @@ -171,38 +172,44 @@ public: } }; -struct UndefinedIUserShimScopedObjectParam { - std::array unk0; +struct SaveDataHandle { + u64 unk0; }; -static_assert(sizeof(UndefinedIUserShimScopedObjectParam) == 0x10); +static_assert(sizeof(SaveDataHandle) == 0x08); class IUserShimScopedObject final : public ServiceFramework { public: explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") { // clang-format off static const FunctionInfo functions[] = { - {450, nullptr, "Cmd450"}, - {451, nullptr, "Cmd451"}, - {452, D<&IUserShimScopedObject::Cmd452>, "Cmd451"}, - {453, nullptr, "Cmd453"}, - {454, D<&IUserShimScopedObject::Cmd454>, "Cmd454"}, - {455, nullptr, "Cmd455"}, - {456, nullptr, "Cmd456"}, - {457, nullptr, "Cmd457"}, + {450, nullptr, "InitializeForSaveData"}, + {451, nullptr, "FinalizeForSaveData"}, + {452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"}, + {453, nullptr, "CloseSaveData"}, + {454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"}, + {455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"}, + {456, nullptr, "FlushSaveSlot"}, + {457, nullptr, "CommitSaveData"}, }; // clang-format on RegisterHandlers(functions); } - Result Cmd452(UndefinedIUserShimScopedObjectParam unk0, Out unk1) { + Result OpenSaveData(Account::Uid unk0, Out unk1) { LOG_WARNING(Service_NGC, "stubbed"); R_THROW(IPC::ResultNotSupported); } - Result Cmd454(UndefinedIUserShimScopedObjectParam unk0, Out unk1, OutBuffer unk2) { + Result ReadSaveSlot(s32 offset, SaveDataHandle handle, OutBuffer out_data, Out out_size) { LOG_WARNING(Service_NGC, "stubbed"); R_THROW(IPC::ResultNotSupported); } + + Result WriteSaveSlot(s32 offset, SaveDataHandle handle, InBuffer out_data) { + LOG_WARNING(Service_NGC, "stubbed"); + // to implement + R_SUCCEED(); + } }; class IUserService final : public ServiceFramework { @@ -215,7 +222,7 @@ public: // clang-format on RegisterHandlers(functions); } - Result Cmd0(OutInterface out_interface) { + Result Cmd0(u32 unk0, OutInterface out_interface) { LOG_WARNING(Service_NGC, "stubbed"); *out_interface = std::make_shared(system); R_SUCCEED();