From 1d869e8495c56ac82e2767b993ce0587197faa01 Mon Sep 17 00:00:00 2001 From: Maufeat Date: Thu, 18 Dec 2025 21:46:00 +0100 Subject: [PATCH] [hle] stubbed extra services from (parental controls and stuff) fw21 (#3175) Adds more Firmware 20+ related service commands. Renames existing service commands according to switchbrew docs, Unstubs new parental service stuff. Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3175 Reviewed-by: Caio Oliveira Reviewed-by: Lizzie Co-authored-by: Maufeat Co-committed-by: Maufeat --- src/core/hle/result.h | 30 ++- .../am/service/application_functions.cpp | 14 +- .../service/am/service/audio_controller.cpp | 2 +- .../hle/service/audio/audio_controller.cpp | 19 +- src/core/hle/service/audio/audio_device.cpp | 14 +- src/core/hle/service/bcat/bcat_service.cpp | 10 +- .../hle/service/bcat/news/news_service.cpp | 23 ++- src/core/hle/service/btm/btm.cpp | 55 +++--- src/core/hle/service/btm/btm_debug.cpp | 17 +- src/core/hle/service/es/es.cpp | 10 + src/core/hle/service/hid/hid_debug_server.cpp | 33 +++- .../hle/service/hid/hid_system_server.cpp | 31 +-- src/core/hle/service/mig/mig.cpp | 48 ++++- src/core/hle/service/nim/nim.cpp | 187 +++++++++++++----- .../ns/application_manager_interface.cpp | 162 ++++++++++++++- .../ns/content_management_interface.cpp | 4 + .../service/ns/dynamic_rights_interface.cpp | 6 +- .../olsc/olsc_service_for_system_service.cpp | 115 +++++------ .../olsc/olsc_service_for_system_service.h | 10 +- .../olsc/transfer_task_list_controller.cpp | 69 ++++--- .../olsc/transfer_task_list_controller.h | 6 +- src/core/hle/service/pcie/pcie.cpp | 11 +- .../service/pctl/parental_control_service.cpp | 31 ++- .../service/pctl/parental_control_service.h | 5 +- src/core/hle/service/pctl/pctl_types.h | 13 +- src/core/hle/service/prepo/prepo.cpp | 6 +- src/core/hle/service/service.cpp | 58 +++--- src/core/hle/service/service.h | 56 +++--- src/core/hle/service/sockets/bsd.cpp | 3 +- src/core/hle/service/sockets/bsd.h | 2 +- 30 files changed, 712 insertions(+), 338 deletions(-) diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 495e6e32c2..3322839e6a 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -12,7 +12,7 @@ #include "common/common_types.h" #include "common/expected.h" -// All the constants in this file come from http://switchbrew.org/index.php?title=Error_codes +// All the constants in this file come from /** * Identifies the module which caused the error. Error codes can be propagated through a call @@ -87,6 +87,7 @@ enum class ErrorModule : u32 { AM = 128, PlayReport = 129, AHID = 130, + APPLET = 131, Qlaunch = 132, PCV = 133, USBPD = 134, @@ -113,8 +114,8 @@ enum class ErrorModule : u32 { NPNSHTTPSTREAM = 155, IDLE = 156, ARP = 157, - SWKBD = 158, - BOOT = 159, + UPDATER = 158, + SWKBD = 159, NetDiag = 160, NFCMifare = 161, UserlandAssert = 162, @@ -125,7 +126,8 @@ enum class ErrorModule : u32 { BGTC = 167, UserlandCrash = 168, SASBUS = 169, - PI = 170, + PL = 170, + CDMSC = 171, AudioCtrl = 172, LBL = 173, JIT = 175, @@ -137,23 +139,30 @@ enum class ErrorModule : u32 { Dauth = 181, STDFU = 182, DBG = 183, + CDACM = 184, + TCAP = 185, DHCPS = 186, SPI = 187, AVM = 188, PWM = 189, + DNSServer = 190, RTC = 191, Regulator = 192, LED = 193, + HTCTool = 194, SIO = 195, PCM = 196, CLKRST = 197, POWCTL = 198, + HIDDriver = 199, + DMA = 200, AudioOld = 201, HID = 202, LDN = 203, CS = 204, Irsensor = 205, Capture = 206, + MM = 207, Manu = 208, ATK = 209, WEB = 210, @@ -166,19 +175,24 @@ enum class ErrorModule : u32 { MigrationLdcServ = 217, HIDBUS = 218, ENS = 219, + ND = 220, + NDD = 221, + ToyCon = 222, WebSocket = 223, + SocketIO = 224, DCDMTP = 227, PGL = 228, Notification = 229, INS = 230, LP2P = 231, RCD = 232, - LCM40607 = 233, + ICM40607 = 233, PRC = 235, - TMAHTC = 237, - ECTX = 238, + BridgeCtrl = 237, + ErrContext = 238, MNPP = 239, HSHL = 240, + RINGCON = 241, CAPMTP = 242, DP2HDMI = 244, Cradle = 245, @@ -186,6 +200,8 @@ enum class ErrorModule : u32 { Icm42607p = 248, NDRM = 250, Fst2 = 251, + TS = 253, + SPLAY = 260, Nex = 306, NPLN = 321, TSPM = 499, diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index 49e4cfcd23..48362743d8 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp @@ -88,13 +88,13 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ {181, nullptr, "UpgradeLaunchRequiredVersion"}, {190, nullptr, "SendServerMaintenanceOverlayNotification"}, {200, nullptr, "GetLastApplicationExitReason"}, - {210, D<&IApplicationFunctions::GetLaunchRequiredVersionUpgrade>, "GetLaunchRequiredVersionUpgrade"}, // [20.0.0+] - {211, nullptr, "GetLaunchRequiredVersionUpgradeStatus"}, // [20.0.0+] - {220, nullptr, "Unknown220"}, // [20.0.0+] - {300, nullptr, "Unknown300"}, // [20.0.0+] - {310, nullptr, "Unknown310"}, // [20.0.0+] - {320, nullptr, "Unknown320"}, // [20.0.0+] - {330, nullptr, "Unknown330"}, // [20.0.0+] + {210, D<&IApplicationFunctions::GetLaunchRequiredVersionUpgrade>, "GetLaunchRequiredVersionUpgrade"}, //20.0.0+ + {211, nullptr, "GetLaunchRequiredVersionUpgradeStatus"}, //20.0.0+ + {220, nullptr, "Unknown220"}, //20.0.0+ + {300, nullptr, "CreateMovieWriter"}, //20.0.0+ + {310, nullptr, "Unknown310"}, //20.0.0+ + {320, nullptr, "Unknown320"}, //20.0.0+ + {330, nullptr, "Unknown330"}, //20.0.0+ {500, nullptr, "StartContinuousRecordingFlushForDebug"}, {1000, nullptr, "CreateMovieMaker"}, {1001, D<&IApplicationFunctions::PrepareForJit>, "PrepareForJit"}, diff --git a/src/core/hle/service/am/service/audio_controller.cpp b/src/core/hle/service/am/service/audio_controller.cpp index 76c1566153..f627b1df0e 100644 --- a/src/core/hle/service/am/service/audio_controller.cpp +++ b/src/core/hle/service/am/service/audio_controller.cpp @@ -18,7 +18,7 @@ IAudioController::IAudioController(Core::System& system_) {2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"}, {3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"}, {4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"}, - {5, nullptr, "Unknown5"}, + {5, nullptr, "Unknown5"}, //20.0.0+ }; // clang-format on diff --git a/src/core/hle/service/audio/audio_controller.cpp b/src/core/hle/service/audio/audio_controller.cpp index 10b60618e5..611e48e8ba 100644 --- a/src/core/hle/service/audio/audio_controller.cpp +++ b/src/core/hle/service/audio/audio_controller.cpp @@ -30,7 +30,7 @@ IAudioController::IAudioController(Core::System& system_) {3, D<&IAudioController::GetTargetVolumeMax>, "GetTargetVolumeMax"}, {4, D<&IAudioController::IsTargetMute>, "IsTargetMute"}, {5, D<&IAudioController::SetTargetMute>, "SetTargetMute"}, - {6, nullptr, "IsTargetConnected"}, + {6, nullptr, "IsTargetConnected"}, //20.0.0+ {7, nullptr, "SetDefaultTarget"}, {8, nullptr, "GetDefaultTarget"}, {9, D<&IAudioController::GetAudioOutputMode>, "GetAudioOutputMode"}, @@ -67,7 +67,8 @@ IAudioController::IAudioController(Core::System& system_) {40, nullptr, "GetSystemInformationForDebug"}, {41, nullptr, "SetVolumeButtonLongPressTime"}, {42, nullptr, "SetNativeVolumeForDebug"}, - {5000, D<&IAudioController::Unknown5000>, "Unknown5000"}, + {43, nullptr, "Unknown43"}, //21.0.0+ + {5000, D<&IAudioController::Unknown5000>, "Unknown5000"}, //19.0.0+ {10000, nullptr, "NotifyAudioOutputTargetForPlayReport"}, {10001, nullptr, "NotifyAudioOutputChannelCountForPlayReport"}, {10002, nullptr, "NotifyUnsupportedUsbOutputDeviceAttachedForPlayReport"}, @@ -76,13 +77,13 @@ IAudioController::IAudioController(Core::System& system_) {10102, nullptr, "BindAudioOutputTargetUpdateEventForPlayReport"}, {10103, nullptr, "GetAudioOutputTargetForPlayReport"}, {10104, nullptr, "GetAudioOutputChannelCountForPlayReport"}, - {10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, - {10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport"}, - {10200, nullptr, "Unknown10200"}, // [20.0.0+] - {50000, nullptr, "SetAnalogInputBoostGainForPrototyping"}, - {50001, nullptr, "OverrideDefaultTargetForDebug"}, - {50003, nullptr, "SetForceOverrideExternalDeviceNameForDebug"}, - {50004, nullptr, "ClearForceOverrideExternalDeviceNameForDebug"} + {10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, //14.0.0-19.0.1 + {10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport"}, //14.0.0-19.0.1 + {10200, nullptr, "Unknown10200"}, //20.0.0+ + {50000, nullptr, "SetAnalogInputBoostGainForPrototyping"}, //15.0.0-18.1.0 + {50001, nullptr, "OverrideDefaultTargetForDebug"}, //19.0.0-19.0.1 + {50003, nullptr, "SetForceOverrideExternalDeviceNameForDebug"}, //19.0.0+ + {50004, nullptr, "ClearForceOverrideExternalDeviceNameForDebug"} //19.0.0+ }; // clang-format on diff --git a/src/core/hle/service/audio/audio_device.cpp b/src/core/hle/service/audio/audio_device.cpp index 1f7c384846..9bf78c4a55 100644 --- a/src/core/hle/service/audio/audio_device.cpp +++ b/src/core/hle/service/audio/audio_device.cpp @@ -32,13 +32,13 @@ IAudioDevice::IAudioDevice(Core::System& system_, u64 applet_resource_user_id, u {12, D<&IAudioDevice::QueryAudioDeviceOutputEvent>, "QueryAudioDeviceOutputEvent"}, {13, D<&IAudioDevice::GetActiveAudioDeviceName>, "GetActiveAudioOutputDeviceName"}, {14, D<&IAudioDevice::ListAudioOutputDeviceName>, "ListAudioOutputDeviceName"}, - {15, nullptr, "AcquireAudioInputDeviceNotification"}, // 17.0.0+ - {16, nullptr, "ReleaseAudioInputDeviceNotification"}, // 17.0.0+ - {17, nullptr, "AcquireAudioOutputDeviceNotification"}, // 17.0.0+ - {18, nullptr, "ReleaseAudioOutputDeviceNotification"}, // 17.0.0+ - {19, nullptr, "SetAudioDeviceOutputVolumeAutoTuneEnabled"}, // 18.0.0+ - {20, nullptr, "IsAudioDeviceOutputVolumeAutoTuneEnabled"}, // 18.0.0+ - {21, nullptr, "IsActiveOutputDeviceEstimatedLowLatency"} // 21.0.0+ + {15, nullptr, "AcquireAudioInputDeviceNotification"}, //17.0.0+ + {16, nullptr, "ReleaseAudioInputDeviceNotification"}, //17.0.0+ + {17, nullptr, "AcquireAudioOutputDeviceNotification"}, //17.0.0+ + {18, nullptr, "ReleaseAudioOutputDeviceNotification"}, //17.0.0+ + {19, nullptr, "SetAudioDeviceOutputVolumeAutoTuneEnabled"}, //18.0.0+ + {20, nullptr, "IsAudioDeviceOutputVolumeAutoTuneEnabled"}, //18.0.0+ + {21, nullptr, "IsActiveOutputDeviceEstimatedLowLatency"} //21.0.0+ }; RegisterHandlers(functions); diff --git a/src/core/hle/service/bcat/bcat_service.cpp b/src/core/hle/service/bcat/bcat_service.cpp index 253eff9d16..849bf8d0d9 100644 --- a/src/core/hle/service/bcat/bcat_service.cpp +++ b/src/core/hle/service/bcat/bcat_service.cpp @@ -43,21 +43,21 @@ IBcatService::IBcatService(Core::System& system_, BcatBackend& backend_) {20401, nullptr, "UnregisterSystemApplicationDeliveryTask"}, {20410, nullptr, "SetSystemApplicationDeliveryTaskTimer"}, {30100, D<&IBcatService::SetPassphrase>, "SetPassphrase"}, - {30101, nullptr, "Unknown30101"}, - {30102, nullptr, "Unknown30102"}, + {30101, nullptr, "Unknown30101"}, //2.0.0-2.3.0 + {30102, nullptr, "Unknown30102"}, //2.0.0-2.3.0 {30200, nullptr, "RegisterBackgroundDeliveryTask"}, {30201, nullptr, "UnregisterBackgroundDeliveryTask"}, {30202, nullptr, "BlockDeliveryTask"}, {30203, nullptr, "UnblockDeliveryTask"}, {30210, nullptr, "SetDeliveryTaskTimer"}, {30300, D<&IBcatService::RegisterSystemApplicationDeliveryTasks>, "RegisterSystemApplicationDeliveryTasks"}, - {90100, nullptr, "EnumerateBackgroundDeliveryTask"}, - {90101, nullptr, "Unknown90101"}, + {90100, nullptr, "GetDeliveryTaskList"}, + {90101, nullptr, "GetDeliveryTaskListForSystem"}, //11.0.0+ {90200, nullptr, "GetDeliveryList"}, {90201, D<&IBcatService::ClearDeliveryCacheStorage>, "ClearDeliveryCacheStorage"}, {90202, nullptr, "ClearDeliveryTaskSubscriptionStatus"}, {90300, nullptr, "GetPushNotificationLog"}, - {90301, nullptr, "Unknown90301"}, + {90301, nullptr, "GetDeliveryCacheStorageUsage"}, //11.0.0+ }; // clang-format on RegisterHandlers(functions); diff --git a/src/core/hle/service/bcat/news/news_service.cpp b/src/core/hle/service/bcat/news/news_service.cpp index 5083184229..09f7e67aff 100644 --- a/src/core/hle/service/bcat/news/news_service.cpp +++ b/src/core/hle/service/bcat/news/news_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -12,19 +15,19 @@ INewsService::INewsService(Core::System& system_) : ServiceFramework{system_, "I {10100, D<&INewsService::PostLocalNews>, "PostLocalNews"}, {20100, nullptr, "SetPassphrase"}, {30100, D<&INewsService::GetSubscriptionStatus>, "GetSubscriptionStatus"}, - {30101, nullptr, "GetTopicList"}, - {30110, nullptr, "Unknown30110"}, + {30101, nullptr, "GetTopicList"}, //3.0.0+ + {30110, nullptr, "Unknown30110"}, //6.0.0+ {30200, D<&INewsService::IsSystemUpdateRequired>, "IsSystemUpdateRequired"}, - {30201, nullptr, "Unknown30201"}, - {30210, nullptr, "Unknown30210"}, + {30201, nullptr, "Unknown30201"}, //8.0.0+ + {30210, nullptr, "Unknown30210"}, //10.0.0+ {30300, nullptr, "RequestImmediateReception"}, - {30400, nullptr, "DecodeArchiveFile"}, - {30500, nullptr, "Unknown30500"}, - {30900, nullptr, "Unknown30900"}, - {30901, nullptr, "Unknown30901"}, - {30902, nullptr, "Unknown30902"}, + {30400, nullptr, "DecodeArchiveFile"}, //3.0.0-18.1.0 + {30500, nullptr, "Unknown30500"}, //8.0.0+ + {30900, nullptr, "Unknown30900"}, //1.0.0 + {30901, nullptr, "Unknown30901"}, //1.0.0 + {30902, nullptr, "Unknown30902"}, //1.0.0 {40100, nullptr, "SetSubscriptionStatus"}, - {40101, D<&INewsService::RequestAutoSubscription>, "RequestAutoSubscription"}, + {40101, D<&INewsService::RequestAutoSubscription>, "RequestAutoSubscription"}, //3.0.0+ {40200, nullptr, "ClearStorage"}, {40201, nullptr, "ClearSubscriptionStatusAll"}, {90100, nullptr, "GetNewsDatabaseDump"}, diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index d120dade84..327c2d2ddb 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -77,31 +80,33 @@ public: {57, nullptr, "RegisterAppletResourceUserId"}, {58, nullptr, "UnregisterAppletResourceUserId"}, {59, nullptr, "SetAppletResourceUserId"}, - {60, nullptr, "Unknown60"}, - {61, nullptr, "Unknown61"}, - {62, nullptr, "Unknown62"}, - {63, nullptr, "Unknown63"}, - {64, nullptr, "Unknown64"}, - {65, nullptr, "Unknown65"}, - {66, nullptr, "Unknown66"}, - {67, nullptr, "Unknown67"}, - {68, nullptr, "Unknown68"}, - {69, nullptr, "Unknown69"}, - {70, nullptr, "Unknown70"}, - {71, nullptr, "Unknown71"}, - {72, nullptr, "Unknown72"}, - {73, nullptr, "Unknown73"}, - {74, nullptr, "Unknown74"}, - {75, nullptr, "Unknown75"}, - {76, nullptr, "Unknown76"}, - {100, nullptr, "Unknown100"}, - {101, nullptr, "Unknown101"}, - {110, nullptr, "Unknown110"}, - {111, nullptr, "Unknown111"}, - {112, nullptr, "Unknown112"}, - {113, nullptr, "Unknown113"}, - {114, nullptr, "Unknown114"}, - {115, nullptr, "Unknown115"}, + {60, nullptr, "AcquireBleConnectionParameterUpdateEvent"}, //8.0.0+ + {61, nullptr, "SetCeLength"}, //8.0.0+ + {62, nullptr, "EnsureSlotExpansion"}, //9.0.0+ + {63, nullptr, "IsSlotExpansionEnsured"}, //9.0.0+ + {64, nullptr, "CancelConnectionTrigger"}, //10.0.0+ + {65, nullptr, "GetConnectionCapacity"}, //13.0.0+ + {66, nullptr, "GetWlanMode"}, //13.0.0+ + {67, nullptr, "IsSlotSavingEnabled"}, //13.0.0+ + {68, nullptr, "IsSlotSavingForPairingEnabled"}, //13.0.0+ + {69, nullptr, "AcquireAudioDeviceConnectionEvent"}, //13.0.0+ + {70, nullptr, "GetConnectedAudioDevices"}, //13.0.0+ + {71, nullptr, "SetAudioSourceVolume"}, //13.0.0+ + {72, nullptr, "GetAudioSourceVolume"}, //13.0.0+ + {73, nullptr, "RequestAudioDeviceConnectionRejection"}, //13.0.0+ + {74, nullptr, "CancelAudioDeviceConnectionRejection"}, //13.0.0+ + {75, nullptr, "GetPairedAudioDevices"}, //13.0.0+ + {76, nullptr, "SetWlanModeWithOption"}, //13.1.0+ + {100, nullptr, "AcquireConnectionDisallowedEvent"}, //13.0.0+ + {101, nullptr, "GetUsecaseViolationFactor"}, //13.0.0+ + {110, nullptr, "GetShortenedDeviceInfo"}, //13.0.0+ + {111, nullptr, "AcquirePairingCountUpdateEvent"},//13.0.0+ + {112, nullptr, "Unknown112"}, //14.0.0-14.1.2 + {113, nullptr, "Unknown113"}, //14.0.0-14.1.2 + {114, nullptr, "IsFirstAudioControlConnection"}, //14.0.0+ + {115, nullptr, "GetShortenedDeviceCondition"}, //14.0.0+ + {116, nullptr, "SetAudioSinkVolume"}, //15.0.0+ + {117, nullptr, "GetAudioSinkVolume"}, //15.0.0+ }; // clang-format on diff --git a/src/core/hle/service/btm/btm_debug.cpp b/src/core/hle/service/btm/btm_debug.cpp index 4d61d2641f..0c9a3a6557 100644 --- a/src/core/hle/service/btm/btm_debug.cpp +++ b/src/core/hle/service/btm/btm_debug.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -17,11 +20,15 @@ IBtmDebug::IBtmDebug(Core::System& system_) : ServiceFramework{system_, "btm:dbg {6, nullptr, "SetTsiMode"}, {7, nullptr, "GeneralTest"}, {8, nullptr, "HidConnect"}, - {9, nullptr, "GeneralGet"}, - {10, nullptr, "GetGattClientDisconnectionReason"}, - {11, nullptr, "GetBleConnectionParameter"}, - {12, nullptr, "GetBleConnectionParameterRequest"}, - {13, nullptr, "Unknown13"}, + {9, nullptr, "GeneralGet"}, //5.0.0+ + {10, nullptr, "GetGattClientDisconnectionReason"}, //5.0.0+ + {11, nullptr, "GetBleConnectionParameter"}, //5.1.0+ + {12, nullptr, "GetBleConnectionParameterRequest"}, //5.1.0+ + {13, nullptr, "GetDiscoveredDevice"}, //12.0.0+ + {14, nullptr, "SleepAwakeLoopTest"}, //15.0.0+ + {15, nullptr, "SleepTest"}, //15.0.0+ + {16, nullptr, "MinimumAwakeTest"}, //15.0.0+ + {17, nullptr, "ForceEnableBtm"}, //15.0.0+ }; // clang-format on diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index 4b7d7dc753..5adf248684 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -60,6 +60,16 @@ public: {38, nullptr, "OwnTicket3"}, {39, nullptr, "DeleteAllInactivePersonalizedTicket"}, {40, nullptr, "DeletePrepurchaseRecordByNintendoAccountId"}, + {101, nullptr, "Unknown101"}, //18.0.0+ + {102, nullptr, "Unknown102"}, //18.0.0+ + {103, nullptr, "Unknown103"}, //18.0.0+ + {104, nullptr, "Unknown104"}, //18.0.0+ + {105, nullptr, "Unknown105"}, //20.0.0+ + {201, nullptr, "Unknown201"}, //18.0.0+ + {202, nullptr, "Unknown202"}, //18.0.0+ + {203, nullptr, "Unknown203"}, //18.0.0+ + {204, nullptr, "Unknown204"}, //18.0.0+ + {205, nullptr, "Unknown205"}, //18.0.0+ {501, nullptr, "Unknown501"}, {502, nullptr, "Unknown502"}, {503, nullptr, "GetTitleKey"}, diff --git a/src/core/hle/service/hid/hid_debug_server.cpp b/src/core/hle/service/hid/hid_debug_server.cpp index 14e48dade3..43fe0f3a19 100644 --- a/src/core/hle/service/hid/hid_debug_server.cpp +++ b/src/core/hle/service/hid/hid_debug_server.cpp @@ -125,13 +125,10 @@ IHidDebugServer::IHidDebugServer(Core::System& system_, std::shared_ptr, "RequestDownloadApplicationControlDataInBackground"}, + {420, nullptr, "CloneApplicationControlDataCacheForDebug"}, + {421, nullptr, "Unknown421"}, //20.0.0+ + {422, nullptr, "Unknown422"}, //20.0.0+ + {423, nullptr, "Unknown423"}, //20.0.0+ + {424, nullptr, "Unknown424"}, //20.0.0+ + {425, nullptr, "Unknown425"}, //20.0.0+ + {426, nullptr, "Unknown426"}, //20.0.0+ + {427, nullptr, "Unknown427"}, //20.0.0+ + {428, nullptr, "Unknown428"}, //21.0.0+ + {429, nullptr, "Unknown429"}, //21.0.0+ + {430, nullptr, "Unknown430"}, //21.0.0+ {502, nullptr, "RequestCheckGameCardRegistration"}, {503, nullptr, "RequestGameCardRegistrationGoldPoint"}, {504, nullptr, "RequestRegisterGameCard"}, @@ -146,6 +165,13 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {510, nullptr, "GetGameCardPlatformRegion"}, {511, D<&IApplicationManagerInterface::GetGameCardWakenReadyEvent>, "GetGameCardWakenReadyEvent"}, {512, D<&IApplicationManagerInterface::IsGameCardApplicationRunning>, "IsGameCardApplicationRunning"}, + {513, nullptr, "Unknown513"}, //20.0.0+ + {514, nullptr, "Unknown514"}, //20.0.0+ + {515, nullptr, "Unknown515"}, //20.0.0+ + {516, nullptr, "Unknown516"}, //21.0.0+ + {517, nullptr, "Unknown517"}, //21.0.0+ + {518, nullptr, "Unknown518"}, //21.0.0+ + {519, nullptr, "Unknown519"}, //21.0.0+ {600, nullptr, "CountApplicationContentMeta"}, {601, nullptr, "ListApplicationContentMetaStatus"}, {602, nullptr, "ListAvailableAddOnContent"}, @@ -183,6 +209,22 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {914, nullptr, "HideApplicationRecord"}, {915, nullptr, "ShowApplicationRecord"}, {916, nullptr, "IsApplicationAutoDeleteDisabled"}, + {916, nullptr, "Unknown916"}, //20.0.0+ + {917, nullptr, "Unknown917"}, //20.0.0+ + {918, nullptr, "Unknown918"}, //20.0.0+ + {919, nullptr, "Unknown919"}, //20.0.0+ + {920, nullptr, "Unknown920"}, //20.0.0+ + {921, nullptr, "Unknown921"}, //20.0.0+ + {922, nullptr, "Unknown922"}, //20.0.0+ + {923, nullptr, "Unknown923"}, //20.0.0+ + {928, nullptr, "Unknown928"}, //20.0.0+ + {929, nullptr, "Unknown929"}, //20.0.0+ + {930, nullptr, "Unknown930"}, //20.0.0+ + {931, nullptr, "Unknown931"}, //20.0.0+ + {933, nullptr, "Unknown933"}, //20.0.0+ + {934, nullptr, "Unknown934"}, //20.0.0+ + {935, nullptr, "Unknown935"}, //20.0.0+ + {936, nullptr, "Unknown936"}, //20.0.0+ {1000, nullptr, "RequestVerifyApplicationDeprecated"}, {1001, nullptr, "CorruptApplicationForDebug"}, {1002, nullptr, "RequestVerifyAddOnContentsRights"}, @@ -211,6 +253,11 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {1504, nullptr, "InsertSdCard"}, {1505, nullptr, "RemoveSdCard"}, {1506, nullptr, "GetSdCardStartupStatus"}, + {1508, nullptr, "Unknown1508"}, //20.0.0+ + {1509, nullptr, "Unknown1509"}, //20.0.0+ + {1510, nullptr, "Unknown1510"}, //20.0.0+ + {1511, nullptr, "Unknown1511"}, //20.0.0+ + {1512, nullptr, "Unknown1512"}, //20.0.0+ {1600, nullptr, "GetSystemSeedForPseudoDeviceId"}, {1601, nullptr, "ResetSystemSeedForPseudoDeviceId"}, {1700, nullptr, "ListApplicationDownloadingContentMeta"}, @@ -247,8 +294,11 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {2016, nullptr, "ListNotCommittedContentMeta"}, {2017, nullptr, "CreateDownloadTask"}, {2018, nullptr, "GetApplicationDeliveryInfoHash"}, + {2019, nullptr, "Unknown2019"}, //20.0.0+ {2050, D<&IApplicationManagerInterface::GetApplicationRightsOnClient>, "GetApplicationRightsOnClient"}, {2051, nullptr, "InvalidateRightsIdCache"}, + {2052, nullptr, "Unknown2052"}, //20.0.0+ + {2053, nullptr, "Unknown2053"}, //20.0.0+ {2100, D<&IApplicationManagerInterface::GetApplicationTerminateResult>, "GetApplicationTerminateResult"}, {2101, nullptr, "GetRawApplicationTerminateResult"}, {2150, nullptr, "CreateRightsEnvironment"}, @@ -265,6 +315,7 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, {2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"}, {2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, + {2183, nullptr, "Unknown2183"}, //20.1.0+ {2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, {2199, nullptr, "GetRightsEnvironmentCountForDebug"}, {2200, nullptr, "GetGameCardApplicationCopyIdentifier"}, @@ -281,6 +332,16 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {2357, nullptr, "EnableMultiCoreDownload"}, {2358, nullptr, "DisableMultiCoreDownload"}, {2359, nullptr, "IsMultiCoreDownloadEnabled"}, + {2360, nullptr, "GetApplicationDownloadTaskCount"}, //19.0.0+ + {2361, nullptr, "GetMaxApplicationDownloadTaskCount"}, //19.0.0+ + {2362, nullptr, "Unknown2362"}, //20.0.0+ + {2363, nullptr, "Unknown2363"}, //20.0.0+ + {2364, nullptr, "Unknown2364"}, //20.0.0+ + {2365, nullptr, "Unknown2365"}, //20.0.0+ + {2366, nullptr, "Unknown2366"}, //20.0.0+ + {2367, nullptr, "Unknown2367"}, //20.0.0+ + {2368, nullptr, "Unknown2368"}, //20.0.0+ + {2369, nullptr, "Unknown2369"}, //21.0.0+ {2400, nullptr, "GetPromotionInfo"}, {2401, nullptr, "CountPromotionInfo"}, {2402, nullptr, "ListPromotionInfo"}, @@ -299,6 +360,9 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {2520, nullptr, "IsQualificationTransitionSupportedByProcessId"}, {2521, nullptr, "GetRightsUserChangedEvent"}, {2522, nullptr, "IsRomRedirectionAvailable"}, + {2523, nullptr, "GetProgramId"}, //17.0.0+ + {2524, nullptr, "Unknown2524"}, //19.0.0+ + {2525, nullptr, "Unknown2525"}, //20.0.0+ {2800, nullptr, "GetApplicationIdOfPreomia"}, {3000, nullptr, "RegisterDeviceLockKey"}, {3001, nullptr, "UnregisterDeviceLockKey"}, @@ -316,11 +380,99 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {3013, nullptr, "IsGameCardEnabled"}, {3014, nullptr, "IsLocalContentShareEnabled"}, {3050, nullptr, "ListAssignELicenseTaskResult"}, - {4022, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4022"}, - {4023, D<&IApplicationManagerInterface::Unknown4023>, "Unknown4023"}, - {4088, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4088"}, - {4053, D<&IApplicationManagerInterface::Unknown4053>, "Unknown4053"}, - {9999, nullptr, "GetApplicationCertificate"}, + {3104, nullptr, "GetApplicationNintendoLogo"}, //18.0.0+ + {3105, nullptr, "GetApplicationStartupMovie"}, //18.0.0+ + {4000, nullptr, "Unknown4000"}, //20.0.0+ + {4004, nullptr, "Unknown4004"}, //20.0.0+ + {4006, nullptr, "Unknown4006"}, //20.0.0+ + {4007, nullptr, "Unknown4007"}, //20.0.0+ + {4008, nullptr, "Unknown4008"}, //20.0.0+ + {4009, nullptr, "Unknown4009"}, //20.0.0+ + {4010, nullptr, "Unknown4010"}, //20.0.0+ + {4011, nullptr, "Unknown4011"}, //20.0.0+ + {4012, nullptr, "Unknown4012"}, //20.0.0+ + {4013, nullptr, "Unknown4013"}, //20.0.0+ + {4015, nullptr, "Unknown4015"}, //20.0.0+ + {4017, nullptr, "Unknown4017"}, //20.0.0+ + {4019, nullptr, "Unknown4019"}, //20.0.0+ + {4020, nullptr, "Unknown4020"}, //20.0.0+ + {4021, nullptr, "Unknown4021"}, //20.0.0+ + {4022, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4022"}, //20.0.0+ + {4023, D<&IApplicationManagerInterface::Unknown4023>, "Unknown4023"}, //20.0.0+ + {4024, nullptr, "Unknown4024"}, //20.0.0+ + {4025, nullptr, "Unknown4025"}, //20.0.0+ + {4026, nullptr, "Unknown4026"}, //20.0.0+ + {4027, nullptr, "Unknown4027"}, //20.0.0+ + {4028, nullptr, "Unknown4028"}, //20.0.0+ + {4029, nullptr, "Unknown4029"}, //20.0.0+ + {4030, nullptr, "Unknown4030"}, //20.0.0+ + {4031, nullptr, "Unknown4031"}, //20.0.0+ + {4032, nullptr, "Unknown4032"}, //20.0.0+ + {4033, nullptr, "Unknown4033"}, //20.0.0+ + {4034, nullptr, "Unknown4034"}, //20.0.0+ + {4035, nullptr, "Unknown4035"}, //20.0.0+ + {4037, nullptr, "Unknown4037"}, //20.0.0+ + {4038, nullptr, "Unknown4038"}, //20.0.0+ + {4039, nullptr, "Unknown4039"}, //20.0.0+ + {4040, nullptr, "Unknown4040"}, //20.0.0+ + {4041, nullptr, "Unknown4041"}, //20.0.0+ + {4042, nullptr, "Unknown4042"}, //20.0.0+ + {4043, nullptr, "Unknown4043"}, //20.0.0+ + {4044, nullptr, "Unknown4044"}, //20.0.0+ + {4045, nullptr, "Unknown4045"}, //20.0.0+ + {4046, nullptr, "Unknown4046"}, //20.0.0+ + {4049, nullptr, "Unknown4049"}, //20.0.0+ + {4050, nullptr, "Unknown4050"}, //20.0.0+ + {4051, nullptr, "Unknown4051"}, //20.0.0+ + {4052, nullptr, "Unknown4052"}, //20.0.0+ + {4053, D<&IApplicationManagerInterface::Unknown4053>, "Unknown4053"}, //20.0.0+ + {4054, nullptr, "Unknown4054"}, //20.0.0+ + {4055, nullptr, "Unknown4055"}, //20.0.0+ + {4056, nullptr, "Unknown4056"}, //20.0.0+ + {4057, nullptr, "Unknown4057"}, //20.0.0+ + {4058, nullptr, "Unknown4058"}, //20.0.0+ + {4059, nullptr, "Unknown4059"}, //20.0.0+ + {4060, nullptr, "Unknown4060"}, //20.0.0+ + {4061, nullptr, "Unknown4061"}, //20.0.0+ + {4062, nullptr, "Unknown4062"}, //20.0.0+ + {4063, nullptr, "Unknown4063"}, //20.0.0+ + {4064, nullptr, "Unknown4064"}, //20.0.0+ + {4065, nullptr, "Unknown4065"}, //20.0.0+ + {4066, nullptr, "Unknown4066"}, //20.0.0+ + {4067, nullptr, "Unknown4067"}, //20.0.0+ + {4068, nullptr, "Unknown4068"}, //20.0.0+ + {4069, nullptr, "Unknown4069"}, //20.0.0+ + {4070, nullptr, "Unknown4070"}, //20.0.0+ + {4071, nullptr, "Unknown4071"}, //20.0.0+ + {4072, nullptr, "Unknown4072"}, //20.0.0+ + {4073, nullptr, "Unknown4073"}, //20.0.0+ + {4074, nullptr, "Unknown4074"}, //20.0.0+ + {4075, nullptr, "Unknown4075"}, //20.0.0+ + {4076, nullptr, "Unknown4076"}, //20.0.0+ + {4077, nullptr, "Unknown4077"}, //20.0.0+ + {4078, nullptr, "Unknown4078"}, //20.0.0+ + {4079, nullptr, "Unknown4079"}, //20.0.0+ + {4080, nullptr, "Unknown4080"}, //20.0.0+ + {4081, nullptr, "Unknown4081"}, //20.0.0+ + {4083, nullptr, "Unknown4083"}, //20.0.0+ + {4084, nullptr, "Unknown4084"}, //20.0.0+ + {4085, nullptr, "Unknown4085"}, //20.0.0+ + {4086, nullptr, "Unknown4086"}, //20.0.0+ + {4087, nullptr, "Unknown4087"}, //20.0.0+ + {4088, D<&IApplicationManagerInterface::Unknown4022>, "Unknown4088"}, //20.0.0+ + {4089, nullptr, "Unknown4089"}, //20.0.0+ + {4090, nullptr, "Unknown4090"}, //20.0.0+ + {4091, nullptr, "Unknown4091"}, //20.0.0+ + {4092, nullptr, "Unknown4092"}, //20.0.0+ + {4093, nullptr, "Unknown4093"}, //20.0.0+ + {4094, nullptr, "Unknown4094"}, //20.0.0+ + {4095, nullptr, "Unknown4095"}, //20.0.0+ + {4096, nullptr, "Unknown4096"}, //20.0.0+ + {4097, nullptr, "Unknown4097"}, //20.0.0+ + {4099, nullptr, "Unknown4099"}, //21.0.0+ + {5000, nullptr, "Unknown5000"}, //18.0.0+ + {5001, nullptr, "Unknown5001"}, //18.0.0+ + {9999, nullptr, "GetApplicationCertificate"}, //10.0.0-10.2.0 }; // clang-format on diff --git a/src/core/hle/service/ns/content_management_interface.cpp b/src/core/hle/service/ns/content_management_interface.cpp index 69bb3f6e4a..09c15a3e0f 100644 --- a/src/core/hle/service/ns/content_management_interface.cpp +++ b/src/core/hle/service/ns/content_management_interface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -22,6 +25,7 @@ IContentManagementInterface::IContentManagementInterface(Core::System& system_) {601, nullptr, "ListApplicationContentMetaStatus"}, {605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, {607, nullptr, "IsAnyApplicationRunning"}, + {608, nullptr, "Unknown608"}, //21.0.0+ }; // clang-format on diff --git a/src/core/hle/service/ns/dynamic_rights_interface.cpp b/src/core/hle/service/ns/dynamic_rights_interface.cpp index b5a507d6e9..22c62293a2 100644 --- a/src/core/hle/service/ns/dynamic_rights_interface.cpp +++ b/src/core/hle/service/ns/dynamic_rights_interface.cpp @@ -37,7 +37,11 @@ IDynamicRightsInterface::IDynamicRightsInterface(Core::System& system_) {23, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, {24, nullptr, "NotifyLimitedApplicationLicenseUpgradableEventForDebug"}, {25, nullptr, "RequestProceedDynamicRightsState"}, - {26, D<&IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications>, "HasAccountRestrictedRightsInRunningApplications"} + {26, D<&IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications>, "HasAccountRestrictedRightsInRunningApplications"}, + {27, nullptr, "Unknown27"}, //20.0.0+ + {28, nullptr, "Unknown28"}, //20.0.0+ + {29, nullptr, "Unknown29"}, //21.0.0+ + {30, nullptr, "Unknown30"}, //21.0.0+ }; // clang-format on diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.cpp b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp index 7972cdfb13..98b4a52118 100644 --- a/src/core/hle/service/olsc/olsc_service_for_system_service.cpp +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp @@ -16,64 +16,67 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ : ServiceFramework{system_, "olsc:s"} { // clang-format off static const FunctionInfo functions[] = { - {0, D<&IOlscServiceForSystemService::OpenTransferTaskListController>, "OpenTransferTaskListController"}, - {1, D<&IOlscServiceForSystemService::OpenRemoteStorageController>, "OpenRemoteStorageController"}, - {2, D<&IOlscServiceForSystemService::OpenDaemonController>, "OpenDaemonController"}, - {10, nullptr, "Unknown10"}, - {11, nullptr, "Unknown11"}, - {12, nullptr, "Unknown12"}, - {13, nullptr, "Unknown13"}, + {0, D<&IOlscServiceForSystemService::GetTransferTaskListController>, "GetTransferTaskListController"}, + {1, D<&IOlscServiceForSystemService::GetRemoteStorageController>, "GetRemoteStorageController"}, + {2, D<&IOlscServiceForSystemService::GetDaemonController>, "GetDaemonController"}, + {10, nullptr, "PrepareDeleteUserProperty"}, + {11, nullptr, "DeleteUserSaveDataProperty"}, + {12, nullptr, "InvalidateMountCache"}, + {13, nullptr, "DeleteDeviceSaveDataProperty"}, {100, nullptr, "ListLastTransferTaskErrorInfo"}, {101, nullptr, "GetLastErrorInfoCount"}, {102, nullptr, "RemoveLastErrorInfoOld"}, {103, nullptr, "GetLastErrorInfo"}, {104, nullptr, "GetLastErrorEventHolder"}, {105, nullptr, "GetLastTransferTaskErrorInfo"}, - {200, D<&IOlscServiceForSystemService::GetDataTransferPolicyInfo>, "GetDataTransferPolicyInfo"}, - {201, nullptr, "RemoveDataTransferPolicyInfo"}, - {202, nullptr, "UpdateDataTransferPolicyOld"}, - {203, nullptr, "UpdateDataTransferPolicy"}, - {204, nullptr, "CleanupDataTransferPolicyInfo"}, - {205, nullptr, "RequestDataTransferPolicy"}, - {300, nullptr, "GetAutoTransferSeriesInfo"}, - {301, nullptr, "UpdateAutoTransferSeriesInfo"}, - {400, nullptr, "CleanupSaveDataArchiveInfoType1"}, - {900, nullptr, "CleanupTransferTask"}, - {902, nullptr, "CleanupSeriesInfoType0"}, - {903, nullptr, "CleanupSaveDataArchiveInfoType0"}, - {904, nullptr, "CleanupApplicationAutoTransferSetting"}, - {905, nullptr, "CleanupErrorHistory"}, - {906, nullptr, "SetLastError"}, - {907, nullptr, "AddSaveDataArchiveInfoType0"}, - {908, nullptr, "RemoveSeriesInfoType0"}, - {909, nullptr, "GetSeriesInfoType0"}, - {910, nullptr, "RemoveLastErrorInfo"}, - {911, nullptr, "CleanupSeriesInfoType1"}, - {912, nullptr, "RemoveSeriesInfoType1"}, - {913, nullptr, "GetSeriesInfoType1"}, + {200, D<&IOlscServiceForSystemService::GetDataTransferPolicy>, "GetDataTransferPolicy"}, + {201, nullptr, "DeleteDataTransferPolicyCache"}, + {202, nullptr, "Unknown202"}, + {203, nullptr, "RequestUpdateDataTransferPolicyCacheAsync"}, + {204, nullptr, "ClearDataTransferPolicyCache"}, + {205, nullptr, "RequestGetDataTransferPolicyAsync"}, + {206, nullptr, "Unknown206"}, //21.0.0+ + {300, nullptr, "GetUserSaveDataProperty"}, + {301, nullptr, "SetUserSaveDataProperty"}, + {302, nullptr, "Unknown302"}, //21.0.0+ + {400, nullptr, "CleanupSaveDataBackupContextForSpecificApplications"}, + {900, nullptr, "DeleteAllTransferTask"}, + {902, nullptr, "DeleteAllSeriesInfo"}, + {903, nullptr, "DeleteAllSdaInfoCache"}, + {904, nullptr, "DeleteAllApplicationSetting"}, + {905, nullptr, "DeleteAllTransferTaskErrorInfo"}, + {906, nullptr, "RegisterTransferTaskErrorInfo"}, + {907, nullptr, "AddSaveDataArchiveInfoCache"}, + {908, nullptr, "DeleteSeriesInfo"}, + {909, nullptr, "GetSeriesInfo"}, + {910, nullptr, "RemoveTransferTaskErrorInfo"}, + {911, nullptr, "DeleteAllSeriesInfoForSaveDataBackup"}, + {912, nullptr, "DeleteSeriesInfoForSaveDataBackup"}, + {913, nullptr, "GetSeriesInfoForSaveDataBackup"}, + {914, nullptr, "Unknown914"}, //20.2.0+ {1000, nullptr, "UpdateIssueOld"}, {1010, nullptr, "Unknown1010"}, - {1011, nullptr, "ListIssueInfoOld"}, - {1012, nullptr, "GetIssueOld"}, - {1013, nullptr, "GetIssue2Old"}, - {1014, nullptr, "GetIssue3Old"}, - {1020, nullptr, "RepairIssueOld"}, - {1021, nullptr, "RepairIssueWithUserIdOld"}, - {1022, nullptr, "RepairIssue2Old"}, - {1023, nullptr, "RepairIssue3Old"}, + {1011, nullptr, "Unknown1011"}, + {1012, nullptr, "Unknown1012"}, + {1013, nullptr, "Unkown1013"}, + {1014, nullptr, "Unknown1014"}, + {1020, nullptr, "Unknown1020"}, + {1021, nullptr, "Unknown1021"}, + {1022, nullptr, "Unknown1022"}, + {1023, nullptr, "Unknown1023"}, {1024, nullptr, "Unknown1024"}, - {1100, nullptr, "UpdateIssue"}, - {1110, nullptr, "Unknown1110"}, - {1111, nullptr, "ListIssueInfo"}, - {1112, nullptr, "GetIssue"}, - {1113, nullptr, "GetIssue2"}, - {1114, nullptr, "GetIssue3"}, - {1120, nullptr, "RepairIssue"}, - {1121, nullptr, "RepairIssueWithUserId"}, - {1122, nullptr, "RepairIssue2"}, - {1123, nullptr, "RepairIssue3"}, - {1124, nullptr, "Unknown1124"}, - {10000, D<&IOlscServiceForSystemService::CloneService>, "CloneService"}, + {1100, nullptr, "RepairUpdateIssueInfoCacheAync"}, + {1110, nullptr, "RepairGetIssueInfo"}, + {1111, nullptr, "RepairListIssueInfo"}, + {1112, nullptr, "RepairListOperationPermissionInfo"}, + {1113, nullptr, "RepairListDataInfoForRepairedSaveDataDownload"}, + {1114, nullptr, "RepairListDataInfoForOriginalSaveDataDownload"}, + {1120, nullptr, "RepairUploadSaveDataAsync"}, + {1121, nullptr, "RepairUploadSaveDataAsync1"}, + {1122, nullptr, "RepairDownloadRepairedSaveDataAsync"}, + {1123, nullptr, "RepairDownloadOriginalSaveDataAsync"}, + {1124, nullptr, "RepairGetOperationProgressInfo"}, + {10000, D<&IOlscServiceForSystemService::GetOlscServiceForSystemService>, "GetOlscServiceForSystemService"}, }; // clang-format on @@ -82,38 +85,38 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ IOlscServiceForSystemService::~IOlscServiceForSystemService() = default; -Result IOlscServiceForSystemService::OpenTransferTaskListController( +Result IOlscServiceForSystemService::GetTransferTaskListController( Out> out_interface) { LOG_INFO(Service_OLSC, "called"); *out_interface = std::make_shared(system); R_SUCCEED(); } -Result IOlscServiceForSystemService::OpenRemoteStorageController( +Result IOlscServiceForSystemService::GetRemoteStorageController( Out> out_interface) { LOG_INFO(Service_OLSC, "called"); *out_interface = std::make_shared(system); R_SUCCEED(); } -Result IOlscServiceForSystemService::OpenDaemonController( +Result IOlscServiceForSystemService::GetDaemonController( Out> out_interface) { LOG_INFO(Service_OLSC, "called"); *out_interface = std::make_shared(system); R_SUCCEED(); } -Result IOlscServiceForSystemService::GetDataTransferPolicyInfo( - Out out_policy_info, u64 application_id) { +Result IOlscServiceForSystemService::GetDataTransferPolicy( + Out out_policy, u64 application_id) { LOG_WARNING(Service_OLSC, "(STUBBED) called"); DataTransferPolicy policy{}; policy.upload_policy = 0; policy.download_policy = 0; - *out_policy_info = policy; + *out_policy = policy; R_SUCCEED(); } -Result IOlscServiceForSystemService::CloneService( +Result IOlscServiceForSystemService::GetOlscServiceForSystemService( Out> out_interface) { LOG_INFO(Service_OLSC, "called"); *out_interface = std::static_pointer_cast(shared_from_this()); diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.h b/src/core/hle/service/olsc/olsc_service_for_system_service.h index d80da068fe..97f791b74a 100644 --- a/src/core/hle/service/olsc/olsc_service_for_system_service.h +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.h @@ -24,12 +24,12 @@ public: ~IOlscServiceForSystemService() override; private: - Result OpenTransferTaskListController( + Result GetTransferTaskListController( Out> out_interface); - Result OpenRemoteStorageController(Out> out_interface); - Result OpenDaemonController(Out> out_interface); - Result GetDataTransferPolicyInfo(Out out_policy_info, u64 application_id); - Result CloneService(Out> out_interface); + Result GetRemoteStorageController(Out> out_interface); + Result GetDaemonController(Out> out_interface); + Result GetDataTransferPolicy(Out out_policy, u64 application_id); + Result GetOlscServiceForSystemService(Out> out_interface); }; } // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.cpp b/src/core/hle/service/olsc/transfer_task_list_controller.cpp index 8ea9a0f1e3..093bf36c0e 100644 --- a/src/core/hle/service/olsc/transfer_task_list_controller.cpp +++ b/src/core/hle/service/olsc/transfer_task_list_controller.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,32 +14,37 @@ ITransferTaskListController::ITransferTaskListController(Core::System& system_) : ServiceFramework{system_, "ITransferTaskListController"} { // clang-format off static const FunctionInfo functions[] = { - {0, nullptr, "Unknown0"}, - {1, nullptr, "Unknown1"}, - {2, nullptr, "Unknown2"}, - {3, nullptr, "Unknown3"}, - {4, nullptr, "Unknown4"}, - {5, D<&ITransferTaskListController::GetNativeHandleHolder>, "GetNativeHandleHolder"}, - {6, nullptr, "Unknown6"}, - {7, nullptr, "Unknown7"}, - {8, nullptr, "GetRemoteStorageController"}, - {9, D<&ITransferTaskListController::GetNativeHandleHolder>, "GetNativeHandleHolder2"}, - {10, nullptr, "Unknown10"}, - {11, nullptr, "Unknown11"}, - {12, nullptr, "Unknown12"}, - {13, nullptr, "Unknown13"}, - {14, nullptr, "Unknown14"}, - {15, nullptr, "Unknown15"}, - {16, nullptr, "Unknown16"}, - {17, nullptr, "Unknown17"}, - {18, nullptr, "Unknown18"}, - {19, nullptr, "Unknown19"}, - {20, nullptr, "Unknown20"}, - {21, nullptr, "Unknown21"}, - {22, nullptr, "Unknown22"}, - {23, nullptr, "Unknown23"}, - {24, nullptr, "Unknown24"}, - {25, nullptr, "Unknown25"}, + {0, nullptr, "GetTransferTaskCountForOcean"}, + {1, nullptr, "GetTransferTaskInfoForOcean"}, + {2, nullptr, "ListTransferTaskInfoForOcean"}, + {3, nullptr, "DeleteTransferTaskForOcean"}, + {4, nullptr, "RaiseTransferTaskPriorityForOcean"}, + {5, D<&ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder>, "GetTransferTaskEndEventNativeHandleHolder"}, + {6, nullptr, "GetTransferTaskProgressForOcean"}, + {7, nullptr, "GetTransferTaskLastResultForOcean"}, + {8, nullptr, "StopNextTransferTaskExecution"}, + {9, D<&ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder>, "GetTransferTaskStartEventNativeHandleHolder"}, + {10, nullptr, "SuspendTransferTaskForOcean"}, + {11, nullptr, "GetCurrentTransferTaskInfoForOcean"}, + {12, nullptr, "FindTransferTaskInfoForOcean"}, + {13, nullptr, "CancelCurrentRepairTransferTask"}, + {14, nullptr, "GetRepairTransferTaskProgress"}, + {15, nullptr, "EnsureExecutableForRepairTransferTask"}, + {16, nullptr, "GetTransferTaskCount"}, + {17, nullptr, "GetTransferTaskInfo"}, + {18, nullptr, "ListTransferTaskInfo"}, + {19, nullptr, "DeleteTransferTask"}, + {20, nullptr, "RaiseTransferTaskPriority"}, + {21, nullptr, "GetTransferTaskProgress"}, + {22, nullptr, "GetTransferTaskLastResult"}, + {23, nullptr, "SuspendTransferTask"}, + {24, nullptr, "GetCurrentTransferTaskInfo"}, + {25, nullptr, "Unknown25"}, //20.1.0+ + {26, nullptr, "Unknown26"}, //20.1.0+ + {27, nullptr, "Unknown27"}, //20.1.0+ + {28, nullptr, "Unknown28"}, //20.1.0+ + {29, nullptr, "Unknown29"}, //20.1.0+ + {30, nullptr, "Unknown30"}, //20.1.0+ }; // clang-format on @@ -45,7 +53,14 @@ ITransferTaskListController::ITransferTaskListController(Core::System& system_) ITransferTaskListController::~ITransferTaskListController() = default; -Result ITransferTaskListController::GetNativeHandleHolder( +Result ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder( + Out> out_holder) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + *out_holder = std::make_shared(system); + R_SUCCEED(); +} + +Result ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder( Out> out_holder) { LOG_WARNING(Service_OLSC, "(STUBBED) called"); *out_holder = std::make_shared(system); diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.h b/src/core/hle/service/olsc/transfer_task_list_controller.h index f10a713751..e6864e5d6f 100644 --- a/src/core/hle/service/olsc/transfer_task_list_controller.h +++ b/src/core/hle/service/olsc/transfer_task_list_controller.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -14,7 +17,8 @@ public: ~ITransferTaskListController() override; private: - Result GetNativeHandleHolder(Out> out_holder); + Result GetTransferTaskEndEventNativeHandleHolder(Out> out_holder); + Result GetTransferTaskStartEventNativeHandleHolder(Out> out_holder); }; } // namespace Service::OLSC diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp index c6da6eb517..afb8067cd5 100644 --- a/src/core/hle/service/pcie/pcie.cpp +++ b/src/core/hle/service/pcie/pcie.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -34,10 +37,10 @@ public: {17, nullptr, "AcquireIrq"}, {18, nullptr, "ReleaseIrq"}, {19, nullptr, "SetIrqEnable"}, - {20, nullptr, "SetAspmEnable"}, - {21, nullptr, "SetResetUponResumeEnable"}, - {22, nullptr, "ResetFunction"}, - {23, nullptr, "Unknown23"}, + {20, nullptr, "GetIrqEvent"}, + {21, nullptr, "SetAspmEnable"}, + {22, nullptr, "SetResetUponResumeEnable"}, + {23, nullptr, "ResetFunction"}, }; // clang-format on diff --git a/src/core/hle/service/pctl/parental_control_service.cpp b/src/core/hle/service/pctl/parental_control_service.cpp index 1310be64b1..a712353cb1 100644 --- a/src/core/hle/service/pctl/parental_control_service.cpp +++ b/src/core/hle/service/pctl/parental_control_service.cpp @@ -39,6 +39,9 @@ IParentalControlService::IParentalControlService(Core::System& system_, Capabili {1017, D<&IParentalControlService::EndFreeCommunication>, "EndFreeCommunication"}, {1018, D<&IParentalControlService::IsFreeCommunicationAvailable>, "IsFreeCommunicationAvailable"}, {1019, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"}, + {1020, nullptr, "ConfirmLaunchSharedApplicationPermission"}, //20.0.0+ + {1021, nullptr, "TryBeginFreeCommunicationForStreamPlay"}, //21.0.0+ + {1022, nullptr, "EndFreeCommunicationForStreamPlay"}, //21.0.0+ {1031, D<&IParentalControlService::IsRestrictionEnabled>, "IsRestrictionEnabled"}, {1032, D<&IParentalControlService::GetSafetyLevel>, "GetSafetyLevel"}, {1033, nullptr, "SetSafetyLevel"}, @@ -56,6 +59,8 @@ IParentalControlService::IParentalControlService(Core::System& system_, Capabili {1047, nullptr, "NotifyApplicationDownloadStarted"}, {1048, nullptr, "NotifyNetworkProfileCreated"}, {1049, nullptr, "ResetFreeCommunicationApplicationList"}, + {1050, nullptr, "AddToFreeCommunicationApplicationList"}, //20.0.0+ + {1051, nullptr, "NotifyApplicationDownloadStarted"}, //20.0.0+ {1061, D<&IParentalControlService::ConfirmStereoVisionRestrictionConfigurable>, "ConfirmStereoVisionRestrictionConfigurable"}, {1062, D<&IParentalControlService::GetStereoVisionRestriction>, "GetStereoVisionRestriction"}, {1063, D<&IParentalControlService::SetStereoVisionRestriction>, "SetStereoVisionRestriction"}, @@ -126,8 +131,17 @@ IParentalControlService::IParentalControlService(Core::System& system_, Capabili {2013, nullptr, "SynchronizeParentalControlSettingsAsync"}, {2014, nullptr, "FinishSynchronizeParentalControlSettings"}, {2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"}, - {2016, nullptr, "RequestUpdateExemptionListAsync"}, - {145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings"} // 18.0.0+ + {2016, nullptr, "RequestUpdateExemptionListAsync"}, //5.0.0+ + {145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings"}, // 18.0.0+ + {2017, nullptr, "AuthorizePairingAsync"}, //19.0.0+ + {2019, nullptr, "RequestUpdateDeviceUsersBackground"}, //19.0.0+ + {2021, nullptr, "RequestCopyPairingAsync"}, //20.0.0+ + {2022, nullptr, "FinishRequestCopyPairing"}, //20.0.0+ + {2023, nullptr, "IsFromPairingActiveDevice"}, //20.0.0+ + {2024, nullptr, "RollbackCopyPairing"}, //21.0.0+ + {3001, nullptr, "GetErrorContextChangedEvent"}, //20.0.0+ + {145601, D<&IParentalControlService::GetPlayTimerSettings>, "GetPlayTimerSettings"}, // 18.0.0+ + {195101, D<&IParentalControlService::SetPlayTimerSettings>, "SetPlayTimerSettingsForDebug"}, //18.0.0+ }; // clang-format on RegisterHandlers(functions); @@ -393,16 +407,21 @@ Result IParentalControlService::IsRestrictedByPlayTimer(Out out_is_restric } Result IParentalControlService::GetPlayTimerSettingsOld( - Out out_play_timer_settings) { + Out out_play_timer_settings) { LOG_WARNING(Service_PCTL, "(STUBBED) called"); *out_play_timer_settings = {}; R_SUCCEED(); } -Result IParentalControlService::GetPlayTimerSettings( - Out out_play_timer_settings) { +Result IParentalControlService::GetPlayTimerSettings(Out out_play_timer_settings) { LOG_WARNING(Service_PCTL, "(STUBBED) called"); - *out_play_timer_settings = {}; + *out_play_timer_settings = raw_play_timer_settings; + R_SUCCEED(); +} + +Result IParentalControlService::SetPlayTimerSettings(PlayTimerSettings play_timer_settings) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + raw_play_timer_settings = play_timer_settings; R_SUCCEED(); } diff --git a/src/core/hle/service/pctl/parental_control_service.h b/src/core/hle/service/pctl/parental_control_service.h index 9d143fe2e2..1c96360561 100644 --- a/src/core/hle/service/pctl/parental_control_service.h +++ b/src/core/hle/service/pctl/parental_control_service.h @@ -51,7 +51,7 @@ private: Result IsPlayTimerEnabled(Out out_is_play_timer_enabled); Result GetPlayTimerRemainingTime(Out out_remaining_time); Result IsRestrictedByPlayTimer(Out out_is_restricted_by_play_timer); - Result GetPlayTimerSettingsOld(Out out_play_timer_settings); + Result GetPlayTimerSettingsOld(Out out_play_timer_settings); Result GetPlayTimerEventToRequestSuspension(OutCopyHandle out_event); Result IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled); Result GetPlayTimerRemainingTimeDisplayInfo(); @@ -60,6 +60,7 @@ private: Result SetStereoVisionRestriction(bool stereo_vision_restriction); Result ResetConfirmedStereoVisionPermission(); Result GetPlayTimerSettings(Out out_play_timer_settings); + Result SetPlayTimerSettings(PlayTimerSettings out_play_timer_settings); struct States { u64 current_tid{}; @@ -83,6 +84,8 @@ private: RestrictionSettings restriction_settings{}; std::array pin_code{}; Capability capability{}; + // TODO: this is RAW as fuck + PlayTimerSettings raw_play_timer_settings{}; KernelHelpers::ServiceContext service_context; Event synchronization_event; diff --git a/src/core/hle/service/pctl/pctl_types.h b/src/core/hle/service/pctl/pctl_types.h index daaecdf48f..a559c5d35f 100644 --- a/src/core/hle/service/pctl/pctl_types.h +++ b/src/core/hle/service/pctl/pctl_types.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -34,10 +37,16 @@ struct RestrictionSettings { }; static_assert(sizeof(RestrictionSettings) == 0x3, "RestrictionSettings has incorrect size."); +// This is nn::pctl::PlayTimerSettingsOld +struct PlayTimerSettingsOld { + std::array settings; +}; +static_assert(sizeof(PlayTimerSettingsOld) == 0x34, "PlayTimerSettingsOld has incorrect size."); + // This is nn::pctl::PlayTimerSettings struct PlayTimerSettings { - std::array settings; + std::array settings; //21.0.0+ now takes 0x44 }; -static_assert(sizeof(PlayTimerSettings) == 0x34, "PlayTimerSettings has incorrect size."); +static_assert(sizeof(PlayTimerSettings) == 0x44, "PlayTimerSettings has incorrect size."); } // namespace Service::PCTL diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 9f03373499..4fc59d0e10 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -34,9 +34,9 @@ public: {10300, &PlayReport::GetTransmissionStatus, "GetTransmissionStatus"}, {10400, &PlayReport::GetSystemSessionId, "GetSystemSessionId"}, {20100, &PlayReport::SaveSystemReportOld, "SaveSystemReport"}, -{20101, &PlayReport::SaveSystemReportWithUserOld, "SaveSystemReportWithUser"}, -{20102, &PlayReport::SaveSystemReport, "SaveSystemReport"}, -{20103, &PlayReport::SaveSystemReportWithUser, "SaveSystemReportWithUser"}, + {20101, &PlayReport::SaveSystemReportWithUserOld, "SaveSystemReportWithUser"}, + {20102, &PlayReport::SaveSystemReport, "SaveSystemReport"}, + {20103, &PlayReport::SaveSystemReportWithUser, "SaveSystemReportWithUser"}, {20200, nullptr, "SetOperationMode"}, {30100, nullptr, "ClearStorage"}, {30200, nullptr, "ClearStatistics"}, diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index d70dc2978f..43f8e150d4 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -18,49 +18,43 @@ namespace Service { -/** - * Creates a function string for logging, complete with the name (or header code, depending - * on what's passed in) the port name, and all the cmd_buff arguments. - */ -[[maybe_unused]] static std::string MakeFunctionString(std::string_view name, - std::string_view port_name, - const u32* cmd_buff) { +/// @brief Creates a function string for logging, complete with the name (or header code, depending +/// on what's passed in) the port name, and all the cmd_buff arguments. +[[maybe_unused]] static std::string MakeFunctionString(std::string_view name, std::string_view port_name, const u32* cmd_buff) { // Number of params == bits 0-5 + bits 6-11 int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F); std::string function_string = fmt::format("function '{}': port={}", name, port_name); - for (int i = 1; i <= num_params; ++i) { + + for (int i = 1; i <= num_params; ++i) function_string += fmt::format(", cmd_buff[{}]={:#X}", i, cmd_buff[i]); - } + return function_string; } ServiceFrameworkBase::ServiceFrameworkBase(Core::System& system_, const char* service_name_, u32 max_sessions_, InvokerFn* handler_invoker_) : SessionRequestHandler(system_.Kernel(), service_name_), system{system_}, - service_name{service_name_}, max_sessions{max_sessions_}, handler_invoker{handler_invoker_} {} + service_name{service_name_}, handler_invoker{handler_invoker_}, max_sessions{max_sessions_} {} ServiceFrameworkBase::~ServiceFrameworkBase() { // Wait for other threads to release access before destroying - const auto guard = LockService(); + const auto guard = ServiceFrameworkBase::LockService(); } void ServiceFrameworkBase::RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) { + // Usually this array is sorted by id already, so hint to insert at the end handlers.reserve(handlers.size() + n); - for (std::size_t i = 0; i < n; ++i) { - // Usually this array is sorted by id already, so hint to insert at the end + for (std::size_t i = 0; i < n; ++i) handlers.emplace_hint(handlers.cend(), functions[i].expected_header, functions[i]); - } } -void ServiceFrameworkBase::RegisterHandlersBaseTipc(const FunctionInfoBase* functions, - std::size_t n) { +void ServiceFrameworkBase::RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n) { + // Usually this array is sorted by id already, so hint to insert at the end handlers_tipc.reserve(handlers_tipc.size() + n); - for (std::size_t i = 0; i < n; ++i) { - // Usually this array is sorted by id already, so hint to insert at the end + for (std::size_t i = 0; i < n; ++i) handlers_tipc.emplace_hint(handlers_tipc.cend(), functions[i].expected_header, functions[i]); - } } void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, @@ -69,15 +63,12 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, std::string function_name = info == nullptr ? "" : info->name; fmt::memory_buffer buf; - fmt::format_to(std::back_inserter(buf), "function '{}({})': port='{}' cmd_buf={{[0]={:#X}", - ctx.GetCommand(), function_name, service_name, cmd_buf[0]); - for (int i = 1; i <= 8; ++i) { + fmt::format_to(std::back_inserter(buf), "function '{}({})': port='{}' cmd_buf={{[0]={:#X}", ctx.GetCommand(), function_name, service_name, cmd_buf[0]); + for (int i = 1; i <= 8; ++i) fmt::format_to(std::back_inserter(buf), ", [{}]={:#X}", i, cmd_buf[i]); - } buf.push_back('}'); - system.GetReporter().SaveUnimplementedFunctionReport(ctx, ctx.GetCommand(), function_name, - service_name); + system.GetReporter().SaveUnimplementedFunctionReport(ctx, ctx.GetCommand(), function_name, service_name); UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf)); if (Settings::values.use_auto_stub) { LOG_WARNING(Service, "Using auto stub fallback!"); @@ -87,25 +78,20 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, } void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { - auto itr = handlers.find(ctx.GetCommand()); - const FunctionInfoBase* info = itr == handlers.end() ? nullptr : &itr->second; - if (info == nullptr || info->handler_callback == nullptr) { + auto it = handlers.find(ctx.GetCommand()); + FunctionInfoBase const* info = it == handlers.end() ? nullptr : &it->second; + if (info == nullptr || info->handler_callback == nullptr) return ReportUnimplementedFunction(ctx, info); - } LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); } void ServiceFrameworkBase::InvokeRequestTipc(HLERequestContext& ctx) { - boost::container::flat_map::iterator itr; - - itr = handlers_tipc.find(ctx.GetCommand()); - - const FunctionInfoBase* info = itr == handlers_tipc.end() ? nullptr : &itr->second; - if (info == nullptr || info->handler_callback == nullptr) { + auto it = handlers_tipc.find(ctx.GetCommand()); + FunctionInfoBase const* info = it == handlers_tipc.end() ? nullptr : &it->second; + if (info == nullptr || info->handler_callback == nullptr) return ReportUnimplementedFunction(ctx, info); - } LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 36aae1c79d..dbc870a662 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -47,25 +50,23 @@ static_assert(ServerSessionCountMax == 0x40, class ServiceFrameworkBase : public SessionRequestHandler { public: /// Returns the string identifier used to connect to the service. - std::string GetServiceName() const { + [[nodiscard]] std::string_view GetServiceName() const noexcept { return service_name; } - /** - * Returns the maximum number of sessions that can be connected to this service at the same - * time. - */ - u32 GetMaxSessions() const { + /// @brief Returns the maximum number of sessions that can be connected to this service at the same + /// time. + u32 GetMaxSessions() const noexcept { return max_sessions; } - /// Invokes a service request routine using the HIPC protocol. + /// @brief Invokes a service request routine using the HIPC protocol. void InvokeRequest(HLERequestContext& ctx); - /// Invokes a service request routine using the HIPC protocol. + /// @brief Invokes a service request routine using the HIPC protocol. void InvokeRequestTipc(HLERequestContext& ctx); - /// Handles a synchronization request for the service. + /// @brief Handles a synchronization request for the service. Result HandleSyncRequest(Kernel::KServerSession& session, HLERequestContext& context) override; protected: @@ -74,7 +75,7 @@ protected: using HandlerFnP = void (Self::*)(HLERequestContext&); /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. - [[nodiscard]] virtual std::unique_lock LockService() { + [[nodiscard]] virtual std::unique_lock LockService() noexcept { return std::unique_lock{lock_service}; } @@ -105,20 +106,19 @@ private: void RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n); void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info); + boost::container::flat_map handlers; + boost::container::flat_map handlers_tipc; + /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. + std::mutex lock_service; + /// Function used to safely up-cast pointers to the derived class before invoking a handler. + InvokerFn* handler_invoker; + /// Maximum number of concurrent sessions that this service can handle. u32 max_sessions; /// Flag to store if a port was already create/installed to detect multiple install attempts, /// which is not supported. bool service_registered = false; - - /// Function used to safely up-cast pointers to the derived class before invoking a handler. - InvokerFn* handler_invoker; - boost::container::flat_map handlers; - boost::container::flat_map handlers_tipc; - - /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. - std::mutex lock_service; }; /** @@ -142,20 +142,12 @@ protected: // TODO(yuriks): This function could be constexpr, but clang is the only compiler that // doesn't emit an ICE or a wrong diagnostic because of the static_cast. - /** - * Constructs a FunctionInfo for a function. - * - * @param expected_header_ request header in the command buffer which will trigger dispatch - * to this handler - * @param handler_callback_ member function in this service which will be called to handle - * the request - * @param name_ human-friendly name for the request. Used mostly for logging purposes. - */ - FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_) - : FunctionInfoBase{ - expected_header_, - // Type-erase member function pointer by casting it down to the base class. - static_cast>(handler_callback_), name_} {} + /// @brief Constructs a FunctionInfo for a function. + /// @param expected_header_ request header in the command buffer which will trigger dispatch to this handler + /// @param handler_callback_ member function in this service which will be called to handle the request + /// @param name_ human-friendly name for the request. Used mostly for logging purposes. + constexpr FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_) + : FunctionInfoBase{expected_header_, HandlerFnP(handler_callback_), name_} {} }; using FunctionInfo = FunctionInfoTyped; diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 55b428e353..f58b0760aa 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -1082,8 +1082,7 @@ BSD::~BSD() { } } -std::unique_lock BSD::LockService() { - // Do not lock socket IClient instances. +std::unique_lock BSD::LockService() noexcept { return {}; } diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index 77d17377ca..32b5bdc3cf 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h @@ -188,7 +188,7 @@ private: Network::RoomMember::CallbackHandle proxy_packet_received; protected: - virtual std::unique_lock LockService() override; + std::unique_lock LockService() noexcept override; }; class BSDCFG final : public ServiceFramework {