Update freind, nifm and nim stubs

Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
This commit is contained in:
JPikachu 2025-03-26 22:34:43 +00:00 committed by Briar
parent 0071e980b8
commit 7c4fdaf528
4 changed files with 89 additions and 8 deletions

View file

@ -22,7 +22,7 @@ public:
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"}, {0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"},
{1, nullptr, "Cancel"}, {1, &IFriendService::Cancel, "Cancel"},
{10100, nullptr, "GetFriendListIds"}, {10100, nullptr, "GetFriendListIds"},
{10101, &IFriendService::GetFriendList, "GetFriendList"}, {10101, &IFriendService::GetFriendList, "GetFriendList"},
{10102, nullptr, "UpdateFriendInfo"}, {10102, nullptr, "UpdateFriendInfo"},
@ -49,7 +49,7 @@ public:
{20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"}, {20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"},
{20102, nullptr, "GetFriendDetailedInfo"}, {20102, nullptr, "GetFriendDetailedInfo"},
{20103, nullptr, "SyncFriendList"}, {20103, nullptr, "SyncFriendList"},
{20104, nullptr, "RequestSyncFriendList"}, {20104, &IFriendService::RequestSyncFriendList, "RequestSyncFriendList"},
{20110, nullptr, "LoadFriendSetting"}, {20110, nullptr, "LoadFriendSetting"},
{20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"}, {20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"},
{20201, nullptr, "GetFriendRequestList"}, {20201, nullptr, "GetFriendRequestList"},
@ -153,9 +153,20 @@ private:
void GetCompletionEvent(HLERequestContext& ctx) { void GetCompletionEvent(HLERequestContext& ctx) {
LOG_DEBUG(Service_Friend, "called"); LOG_DEBUG(Service_Friend, "called");
auto& readable_event = completion_event->GetReadableEvent();
IPC::ResponseBuilder rb{ctx, 2, 1}; IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(readable_event.Signal());
rb.PushCopyObjects(readable_event);
}
void Cancel(HLERequestContext& ctx) {
LOG_DEBUG(Service_Friend, "(STUBBED) called.");
// TODO (jarrodnorwell)
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
rb.PushCopyObjects(completion_event->GetReadableEvent());
} }
void GetFriendList(HLERequestContext& ctx) { void GetFriendList(HLERequestContext& ctx) {
@ -247,6 +258,15 @@ private:
rb.Push(0); rb.Push(0);
} }
void RequestSyncFriendList(HLERequestContext& ctx) {
LOG_DEBUG(Service_Friend, "(STUBBED) called.");
// TODO (jarrodnorwell)
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void GetReceivedFriendRequestCount(HLERequestContext& ctx) { void GetReceivedFriendRequestCount(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
[[maybe_unused]] const auto uuid = rp.PopRaw<Common::UUID>(); [[maybe_unused]] const auto uuid = rp.PopRaw<Common::UUID>();
@ -268,6 +288,18 @@ private:
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
void GetUserPresenceView(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto uuid = rp.PopRaw<Common::UUID>();
LOG_DEBUG(Service_Friend, "(STUBBED) called, uuid={}.", uuid.RawString());
// TODO (jarrodnorwell)
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void GetPlayHistoryStatistics(HLERequestContext& ctx) { void GetPlayHistoryStatistics(HLERequestContext& ctx) {
LOG_ERROR(Service_Friend, "(STUBBED) called, check in out"); LOG_ERROR(Service_Friend, "(STUBBED) called, check in out");

View file

@ -419,6 +419,24 @@ void IGeneralService::GetCurrentNetworkProfile(HLERequestContext& ctx) {
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
void IGeneralService::EnumerateNetworkInterfaces(HLERequestContext& ctx) {
LOG_DEBUG(Service_NIFM, "(STUBBED) called.");
// TODO (jarrodnorwell)
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void IGeneralService::EnumerateNetworkProfiles(HLERequestContext& ctx) {
LOG_DEBUG(Service_NIFM, "(STUBBED) called.");
// TODO (jarrodnorwell)
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void IGeneralService::RemoveNetworkProfile(HLERequestContext& ctx) { void IGeneralService::RemoveNetworkProfile(HLERequestContext& ctx) {
LOG_WARNING(Service_NIFM, "(STUBBED) called"); LOG_WARNING(Service_NIFM, "(STUBBED) called");
@ -565,6 +583,24 @@ void IGeneralService::IsAnyForegroundRequestAccepted(HLERequestContext& ctx) {
rb.Push<u8>(is_accepted); rb.Push<u8>(is_accepted);
} }
void IGeneralService::ConfirmSystemAvailability(HLERequestContext& ctx) {
LOG_DEBUG(Service_NIFM, "(STUBBED) called.");
// TODO (jarrodnorwell)
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void IGeneralService::SetBackgroundRequestEnabled(HLERequestContext& ctx) {
LOG_WARNING(Service_NIFM, "(STUBBED) called.");
// TODO (jarrodnorwell)
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
IGeneralService::IGeneralService(Core::System& system_) IGeneralService::IGeneralService(Core::System& system_)
: ServiceFramework{system_, "IGeneralService"}, network{system_.GetRoomNetwork()} { : ServiceFramework{system_, "IGeneralService"}, network{system_.GetRoomNetwork()} {
// clang-format off // clang-format off
@ -573,8 +609,8 @@ IGeneralService::IGeneralService(Core::System& system_)
{2, &IGeneralService::CreateScanRequest, "CreateScanRequest"}, {2, &IGeneralService::CreateScanRequest, "CreateScanRequest"},
{4, &IGeneralService::CreateRequest, "CreateRequest"}, {4, &IGeneralService::CreateRequest, "CreateRequest"},
{5, &IGeneralService::GetCurrentNetworkProfile, "GetCurrentNetworkProfile"}, {5, &IGeneralService::GetCurrentNetworkProfile, "GetCurrentNetworkProfile"},
{6, nullptr, "EnumerateNetworkInterfaces"}, {6, &IGeneralService::EnumerateNetworkInterfaces, "EnumerateNetworkInterfaces"},
{7, nullptr, "EnumerateNetworkProfiles"}, {7, &IGeneralService::EnumerateNetworkProfiles, "EnumerateNetworkProfiles"},
{8, nullptr, "GetNetworkProfile"}, {8, nullptr, "GetNetworkProfile"},
{9, nullptr, "SetNetworkProfile"}, {9, nullptr, "SetNetworkProfile"},
{10, &IGeneralService::RemoveNetworkProfile, "RemoveNetworkProfile"}, {10, &IGeneralService::RemoveNetworkProfile, "RemoveNetworkProfile"},
@ -600,8 +636,8 @@ IGeneralService::IGeneralService(Core::System& system_)
{30, nullptr, "SetEthernetCommunicationEnabledForTest"}, {30, nullptr, "SetEthernetCommunicationEnabledForTest"},
{31, nullptr, "GetTelemetorySystemEventReadableHandle"}, {31, nullptr, "GetTelemetorySystemEventReadableHandle"},
{32, nullptr, "GetTelemetryInfo"}, {32, nullptr, "GetTelemetryInfo"},
{33, nullptr, "ConfirmSystemAvailability"}, {33, &IGeneralService::ConfirmSystemAvailability, "ConfirmSystemAvailability"}, // 2.0.0+
{34, nullptr, "SetBackgroundRequestEnabled"}, {34, &IGeneralService::SetBackgroundRequestEnabled, "SetBackgroundRequestEnabled"}, // 4.0.0+
{35, nullptr, "GetScanData"}, {35, nullptr, "GetScanData"},
{36, nullptr, "GetCurrentAccessPoint"}, {36, nullptr, "GetCurrentAccessPoint"},
{37, nullptr, "Shutdown"}, {37, nullptr, "Shutdown"},

View file

@ -27,6 +27,8 @@ private:
void CreateScanRequest(HLERequestContext& ctx); void CreateScanRequest(HLERequestContext& ctx);
void CreateRequest(HLERequestContext& ctx); void CreateRequest(HLERequestContext& ctx);
void GetCurrentNetworkProfile(HLERequestContext& ctx); void GetCurrentNetworkProfile(HLERequestContext& ctx);
void EnumerateNetworkInterfaces(HLERequestContext& ctx);
void EnumerateNetworkProfiles(HLERequestContext& ctx);
void RemoveNetworkProfile(HLERequestContext& ctx); void RemoveNetworkProfile(HLERequestContext& ctx);
void GetCurrentIpAddress(HLERequestContext& ctx); void GetCurrentIpAddress(HLERequestContext& ctx);
void CreateTemporaryNetworkProfile(HLERequestContext& ctx); void CreateTemporaryNetworkProfile(HLERequestContext& ctx);
@ -36,6 +38,8 @@ private:
void IsEthernetCommunicationEnabled(HLERequestContext& ctx); void IsEthernetCommunicationEnabled(HLERequestContext& ctx);
void IsAnyInternetRequestAccepted(HLERequestContext& ctx); void IsAnyInternetRequestAccepted(HLERequestContext& ctx);
void IsAnyForegroundRequestAccepted(HLERequestContext& ctx); void IsAnyForegroundRequestAccepted(HLERequestContext& ctx);
void ConfirmSystemAvailability(HLERequestContext& ctx);
void SetBackgroundRequestEnabled(HLERequestContext& ctx);
Network::RoomNetwork& network; Network::RoomNetwork& network;
}; };

View file

@ -232,6 +232,7 @@ public:
{2, nullptr, "ClearDebugResponse"}, {2, nullptr, "ClearDebugResponse"},
{3, nullptr, "RegisterDebugResponse"}, {3, nullptr, "RegisterDebugResponse"},
{4, &NIM_ECA::IsLargeResourceAvailable, "IsLargeResourceAvailable"}, {4, &NIM_ECA::IsLargeResourceAvailable, "IsLargeResourceAvailable"},
{5, &NIM_ECA::CreateServerInterface2, "CreateServerInterface2"} // 17.0.0+
}; };
// clang-format on // clang-format on
@ -240,7 +241,7 @@ public:
private: private:
void CreateServerInterface(HLERequestContext& ctx) { void CreateServerInterface(HLERequestContext& ctx) {
LOG_WARNING(Service_NIM, "(STUBBED) called"); LOG_DEBUG(Service_NIM, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
rb.PushIpcInterface<IShopServiceAccessServer>(system); rb.PushIpcInterface<IShopServiceAccessServer>(system);
@ -257,6 +258,14 @@ private:
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
rb.Push(false); rb.Push(false);
} }
void CreateServerInterface2(HLERequestContext& ctx) {
LOG_DEBUG(Service_NIM, "(STUBBED) called.");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IShopServiceAccessServer>(system);
}
}; };
class NIM_SHP final : public ServiceFramework<NIM_SHP> { class NIM_SHP final : public ServiceFramework<NIM_SHP> {