mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-19 11:10:44 -04:00
feat(acc): implement missing acc:u0 functions per SwitchBrew spec
- Add function 52 (TrySelectUserWithoutInteraction) - Implement stubbed functions with proper async context classes - Fix constructor arguments and type conversion warnings Resolves assertion failure for unimplemented function 52. Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -570,6 +570,44 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AuthenticateApplicationAsyncInterface final : public IAsyncContext {
|
||||||
|
public:
|
||||||
|
explicit AuthenticateApplicationAsyncInterface(Core::System& system_) : IAsyncContext{system_} {
|
||||||
|
MarkComplete();
|
||||||
|
}
|
||||||
|
~AuthenticateApplicationAsyncInterface() = default;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool IsComplete() const override {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Cancel() override {}
|
||||||
|
|
||||||
|
Result GetResult() const override {
|
||||||
|
return ResultSuccess;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CheckNetworkServiceAvailabilityAsyncInterface final : public IAsyncContext {
|
||||||
|
public:
|
||||||
|
explicit CheckNetworkServiceAvailabilityAsyncInterface(Core::System& system_) : IAsyncContext{system_} {
|
||||||
|
MarkComplete();
|
||||||
|
}
|
||||||
|
~CheckNetworkServiceAvailabilityAsyncInterface() = default;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool IsComplete() const override {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Cancel() override {}
|
||||||
|
|
||||||
|
Result GetResult() const override {
|
||||||
|
return ResultSuccess;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
|
class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
|
||||||
public:
|
public:
|
||||||
explicit IManagerForApplication(Core::System& system_,
|
explicit IManagerForApplication(Core::System& system_,
|
||||||
@@ -789,6 +827,20 @@ void Module::Interface::GetProfile(HLERequestContext& ctx) {
|
|||||||
rb.PushIpcInterface<IProfile>(system, user_id, *profile_manager);
|
rb.PushIpcInterface<IProfile>(system, user_id, *profile_manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Module::Interface::GetProfileDigest(HLERequestContext& ctx) {
|
||||||
|
IPC::RequestParser rp{ctx};
|
||||||
|
Common::UUID user_id = rp.PopRaw<Common::UUID>();
|
||||||
|
LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
|
||||||
|
|
||||||
|
// Return a dummy digest for now
|
||||||
|
std::array<u8, 0x20> digest{};
|
||||||
|
std::fill(digest.begin(), digest.end(), static_cast<u8>(0));
|
||||||
|
|
||||||
|
ctx.WriteBuffer(digest);
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
void Module::Interface::IsUserRegistrationRequestPermitted(HLERequestContext& ctx) {
|
void Module::Interface::IsUserRegistrationRequestPermitted(HLERequestContext& ctx) {
|
||||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
@@ -860,6 +912,22 @@ void Module::Interface::GetBaasAccountManagerForApplication(HLERequestContext& c
|
|||||||
rb.PushIpcInterface<IManagerForApplication>(system, profile_manager);
|
rb.PushIpcInterface<IManagerForApplication>(system, profile_manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Module::Interface::AuthenticateApplicationAsync(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
rb.PushIpcInterface<AuthenticateApplicationAsyncInterface>(system);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Module::Interface::CheckNetworkServiceAvailabilityAsync(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
rb.PushIpcInterface<CheckNetworkServiceAvailabilityAsyncInterface>(system);
|
||||||
|
}
|
||||||
|
|
||||||
void Module::Interface::IsUserAccountSwitchLocked(HLERequestContext& ctx) {
|
void Module::Interface::IsUserAccountSwitchLocked(HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_ACC, "called");
|
LOG_DEBUG(Service_ACC, "called");
|
||||||
FileSys::NACP nacp;
|
FileSys::NACP nacp;
|
||||||
@@ -960,6 +1028,42 @@ void Module::Interface::StoreSaveDataThumbnailApplication(HLERequestContext& ctx
|
|||||||
StoreSaveDataThumbnail(ctx, uuid, tid);
|
StoreSaveDataThumbnail(ctx, uuid, tid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Module::Interface::ClearSaveDataThumbnail(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Module::Interface::CreateGuestLoginRequest(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||||
|
|
||||||
|
// Create a dummy UUID for the guest login request
|
||||||
|
const Common::UUID dummy_uuid{};
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
rb.PushIpcInterface<IGuestLoginRequest>(system, dummy_uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Module::Interface::LoadOpenContext(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Module::Interface::DebugActivateOpenContextRetention(HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||||
|
|
||||||
|
// Create a dummy UUID for the session object
|
||||||
|
const Common::UUID dummy_uuid{};
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
|
rb.PushIpcInterface<ISessionObject>(system, dummy_uuid);
|
||||||
|
}
|
||||||
|
|
||||||
void Module::Interface::GetBaasAccountManagerForSystemService(HLERequestContext& ctx) {
|
void Module::Interface::GetBaasAccountManagerForSystemService(HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -26,9 +27,12 @@ public:
|
|||||||
void ListOpenUsers(HLERequestContext& ctx);
|
void ListOpenUsers(HLERequestContext& ctx);
|
||||||
void GetLastOpenedUser(HLERequestContext& ctx);
|
void GetLastOpenedUser(HLERequestContext& ctx);
|
||||||
void GetProfile(HLERequestContext& ctx);
|
void GetProfile(HLERequestContext& ctx);
|
||||||
|
void GetProfileDigest(HLERequestContext& ctx);
|
||||||
void InitializeApplicationInfo(HLERequestContext& ctx);
|
void InitializeApplicationInfo(HLERequestContext& ctx);
|
||||||
void InitializeApplicationInfoRestricted(HLERequestContext& ctx);
|
void InitializeApplicationInfoRestricted(HLERequestContext& ctx);
|
||||||
void GetBaasAccountManagerForApplication(HLERequestContext& ctx);
|
void GetBaasAccountManagerForApplication(HLERequestContext& ctx);
|
||||||
|
void AuthenticateApplicationAsync(HLERequestContext& ctx);
|
||||||
|
void CheckNetworkServiceAvailabilityAsync(HLERequestContext& ctx);
|
||||||
void IsUserRegistrationRequestPermitted(HLERequestContext& ctx);
|
void IsUserRegistrationRequestPermitted(HLERequestContext& ctx);
|
||||||
void TrySelectUserWithoutInteraction(HLERequestContext& ctx);
|
void TrySelectUserWithoutInteraction(HLERequestContext& ctx);
|
||||||
void IsUserAccountSwitchLocked(HLERequestContext& ctx);
|
void IsUserAccountSwitchLocked(HLERequestContext& ctx);
|
||||||
@@ -39,6 +43,10 @@ public:
|
|||||||
void ListQualifiedUsers(HLERequestContext& ctx);
|
void ListQualifiedUsers(HLERequestContext& ctx);
|
||||||
void ListOpenContextStoredUsers(HLERequestContext& ctx);
|
void ListOpenContextStoredUsers(HLERequestContext& ctx);
|
||||||
void StoreSaveDataThumbnailApplication(HLERequestContext& ctx);
|
void StoreSaveDataThumbnailApplication(HLERequestContext& ctx);
|
||||||
|
void ClearSaveDataThumbnail(HLERequestContext& ctx);
|
||||||
|
void CreateGuestLoginRequest(HLERequestContext& ctx);
|
||||||
|
void LoadOpenContext(HLERequestContext& ctx);
|
||||||
|
void DebugActivateOpenContextRetention(HLERequestContext& ctx);
|
||||||
void GetBaasAccountManagerForSystemService(HLERequestContext& ctx);
|
void GetBaasAccountManagerForSystemService(HLERequestContext& ctx);
|
||||||
void StoreSaveDataThumbnailSystem(HLERequestContext& ctx);
|
void StoreSaveDataThumbnailSystem(HLERequestContext& ctx);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/hle/service/acc/acc_u0.h"
|
#include "core/hle/service/acc/acc_u0.h"
|
||||||
@@ -16,19 +17,20 @@ ACC_U0::ACC_U0(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager>
|
|||||||
{3, &ACC_U0::ListOpenUsers, "ListOpenUsers"},
|
{3, &ACC_U0::ListOpenUsers, "ListOpenUsers"},
|
||||||
{4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"},
|
{4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"},
|
||||||
{5, &ACC_U0::GetProfile, "GetProfile"},
|
{5, &ACC_U0::GetProfile, "GetProfile"},
|
||||||
{6, nullptr, "GetProfileDigest"}, // 3.0.0+
|
{6, &ACC_U0::GetProfileDigest, "GetProfileDigest"}, // 3.0.0+
|
||||||
{50, &ACC_U0::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"},
|
{50, &ACC_U0::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"},
|
||||||
{51, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"},
|
{51, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteractionDeprecated"}, // [1.0.0-18.1.0]
|
||||||
|
{52, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // [19.0.0+] DEPRECATED
|
||||||
{60, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 5.0.0 - 5.1.0
|
{60, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 5.0.0 - 5.1.0
|
||||||
{99, nullptr, "DebugActivateOpenContextRetention"}, // 6.0.0+
|
{99, &ACC_U0::DebugActivateOpenContextRetention, "DebugActivateOpenContextRetention"}, // 6.0.0+
|
||||||
{100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"},
|
{100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"},
|
||||||
{101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"},
|
{101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"},
|
||||||
{102, nullptr, "AuthenticateApplicationAsync"},
|
{102, &ACC_U0::AuthenticateApplicationAsync, "AuthenticateApplicationAsync"},
|
||||||
{103, nullptr, "CheckNetworkServiceAvailabilityAsync"}, // 4.0.0+
|
{103, &ACC_U0::CheckNetworkServiceAvailabilityAsync, "CheckNetworkServiceAvailabilityAsync"}, // 4.0.0+
|
||||||
{110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"},
|
{110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"},
|
||||||
{111, nullptr, "ClearSaveDataThumbnail"},
|
{111, &ACC_U0::ClearSaveDataThumbnail, "ClearSaveDataThumbnail"},
|
||||||
{120, nullptr, "CreateGuestLoginRequest"},
|
{120, &ACC_U0::CreateGuestLoginRequest, "CreateGuestLoginRequest"},
|
||||||
{130, nullptr, "LoadOpenContext"}, // 5.0.0+
|
{130, &ACC_U0::LoadOpenContext, "LoadOpenContext"}, // 5.0.0+
|
||||||
{131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 6.0.0+
|
{131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 6.0.0+
|
||||||
{140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"}, // 6.0.0+
|
{140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"}, // 6.0.0+
|
||||||
{141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers"}, // 6.0.0+
|
{141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers"}, // 6.0.0+
|
||||||
|
|||||||
Reference in New Issue
Block a user