diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c0e52b71a7..b607c84ed2 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1081,6 +1081,8 @@ add_library(core STATIC hle/service/ssl/ssl.h hle/service/ssl/ssl_backend.h hle/service/ssl/ssl_types.h + hle/service/tma/tma.cpp + hle/service/tma/tma.h hle/service/usb/usb.cpp hle/service/usb/usb.h hle/service/vi/application_display_service.cpp diff --git a/src/core/hle/service/apm/apm_controller.cpp b/src/core/hle/service/apm/apm_controller.cpp index 2149af2c3c..651de2493f 100644 --- a/src/core/hle/service/apm/apm_controller.cpp +++ b/src/core/hle/service/apm/apm_controller.cpp @@ -26,8 +26,7 @@ Controller::Controller(Core::Timing::CoreTiming& core_timing_) Controller::~Controller() = default; -void Controller::SetPerformanceConfiguration(PerformanceMode mode, - PerformanceConfiguration config) { +void Controller::SetPerformanceConfiguration(PerformanceMode mode, PerformanceConfiguration config) { static constexpr std::array, 16> config_to_speed{{ {PerformanceConfiguration::Config1, 1020}, {PerformanceConfiguration::Config2, 1020}, @@ -46,17 +45,14 @@ void Controller::SetPerformanceConfiguration(PerformanceMode mode, {PerformanceConfiguration::Config15, 1020}, {PerformanceConfiguration::Config16, 1020}, }}; - - const auto iter = std::find_if(config_to_speed.cbegin(), config_to_speed.cend(), - [config](const auto& entry) { return entry.first == config; }); - - if (iter == config_to_speed.cend()) { + if (auto const it = std::find_if(config_to_speed.cbegin(), config_to_speed.cend(), [config](const auto& e) { + return e.first == config; + }); it != config_to_speed.cend()) { + SetClockSpeed(it->second); + configs.insert_or_assign(mode, config); + } else { LOG_ERROR(Service_APM, "Invalid performance configuration value provided: {}", config); - return; } - - SetClockSpeed(iter->second); - configs.insert_or_assign(mode, config); } void Controller::SetFromCpuBoostMode(CpuBoostMode mode) { @@ -65,9 +61,11 @@ void Controller::SetFromCpuBoostMode(CpuBoostMode mode) { PerformanceConfiguration::Config13, PerformanceConfiguration::Config15, }}; - - SetPerformanceConfiguration(PerformanceMode::Boost, - BOOST_MODE_TO_CONFIG_MAP.at(static_cast(mode))); + if (u32(mode) < BOOST_MODE_TO_CONFIG_MAP.size()) { + SetPerformanceConfiguration(PerformanceMode::Boost, BOOST_MODE_TO_CONFIG_MAP[u32(mode)]); + } else { + LOG_ERROR(Service_APM, "{} invalid mode", mode); + } } PerformanceMode Controller::GetCurrentPerformanceMode() const { @@ -78,7 +76,6 @@ PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(Performa if (configs.find(mode) == configs.end()) { configs.insert_or_assign(mode, DEFAULT_PERFORMANCE_CONFIGURATION); } - return configs[mode]; } diff --git a/src/core/hle/service/audio/audio.cpp b/src/core/hle/service/audio/audio.cpp index 7637ed5bf5..c433283304 100644 --- a/src/core/hle/service/audio/audio.cpp +++ b/src/core/hle/service/audio/audio.cpp @@ -18,16 +18,192 @@ namespace Service::Audio { +class IAudioOutManagerForApplet final : public ServiceFramework { +public: + explicit IAudioOutManagerForApplet(Core::System& system_) + : ServiceFramework{system_, "audout:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + {2, nullptr, "GetProcessMasterVolume"}, + {3, nullptr, "SetProcessMasterVolume"}, + {4, nullptr, "GetProcessRecordVolume"}, + {5, nullptr, "SetProcessRecordVolume"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioSnoopManager final : public ServiceFramework { +public: + explicit IAudioSnoopManager(Core::System& system_) + : ServiceFramework{system_, "auddev"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetDspStatistics"}, + {1, nullptr, "GetAppletStateSummaries"}, + {2, nullptr, "SetDspStatisticsParameter"}, + {3, nullptr, "GetDspStatisticsParameter"}, + {6, nullptr, "GetDspUsage"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioInManagerForApplet final : public ServiceFramework { +public: + explicit IAudioInManagerForApplet(Core::System& system_) + : ServiceFramework{system_, "audin:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + {2, nullptr, "GetProcessMasterVolume"}, + {3, nullptr, "SetProcessMasterVolume"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioRendererManagerForApplet final : public ServiceFramework { +public: + explicit IAudioRendererManagerForApplet(Core::System& system_) + : ServiceFramework{system_, "audren:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + {2, nullptr, "GetProcessMasterVolume"}, + {3, nullptr, "SetProcessMasterVolume"}, + {4, nullptr, "RegisterAppletResourceUserId"}, + {5, nullptr, "UnregisterAppletResourceUserId"}, + {6, nullptr, "GetProcessRecordVolume"}, + {7, nullptr, "SetProcessRecordVolume"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioOutManagerForDebugger final : public ServiceFramework { +public: + explicit IAudioOutManagerForDebugger(Core::System& system_) + : ServiceFramework{system_, "audout:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioInManagerForDebugger final : public ServiceFramework { +public: + explicit IAudioInManagerForDebugger(Core::System& system_) + : ServiceFramework{system_, "audin:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IFinalOutputRecorderManagerForDebugger final : public ServiceFramework { +public: + explicit IFinalOutputRecorderManagerForDebugger(Core::System& system_) + : ServiceFramework{system_, "audrec:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioRendererManagerForDebugger final : public ServiceFramework { +public: + explicit IAudioRendererManagerForDebugger(Core::System& system_) + : ServiceFramework{system_, "audren:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspend"}, + {1, nullptr, "RequestResume"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioSystemManagerForApplet final : public ServiceFramework { +public: + explicit IAudioSystemManagerForApplet(Core::System& system_) + : ServiceFramework{system_, "aud:a"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RegisterAppletResourceUserId"}, + {1, nullptr, "UnregisterAppletResourceUserId"}, + {2, nullptr, "RequestSuspendAudio"}, + {3, nullptr, "RequestResumeAudio"}, + {4, nullptr, "GetAudioOutputProcessMasterVolume"}, + {5, nullptr, "SetAudioOutputProcessMasterVolume"}, + {6, nullptr, "GetAudioInputProcessMasterVolume"}, + {7, nullptr, "SetAudioInputProcessMasterVolume"}, + {8, nullptr, "GetAudioOutputProcessRecordVolume"}, + {9, nullptr, "SetAudioOutputProcessRecordVolume"}, + {10, nullptr, "GetAppletStateSummaries"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class IAudioSystemManagerForDebugger final : public ServiceFramework { +public: + explicit IAudioSystemManagerForDebugger(Core::System& system_) + : ServiceFramework{system_, "aud:d"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RequestSuspendAudioForDebug"}, + {1, nullptr, "RequestResumeAudioForDebug"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); + server_manager->RegisterNamedService("aud:a", std::make_shared(system)); + server_manager->RegisterNamedService("aud:d", std::make_shared(system)); + + server_manager->RegisterNamedService("audout:d", std::make_shared(system)); + server_manager->RegisterNamedService("audin:d", std::make_shared(system)); + server_manager->RegisterNamedService("audrec:d", std::make_shared(system)); + server_manager->RegisterNamedService("audren:d", std::make_shared(system)); + server_manager->RegisterNamedService("audin:u", std::make_shared(system)); + server_manager->RegisterNamedService("audin:a", std::make_shared(system)); server_manager->RegisterNamedService("audout:u", std::make_shared(system)); + server_manager->RegisterNamedService("audout:a", std::make_shared(system)); + server_manager->RegisterNamedService("auddev", std::make_shared(system)); // Depends on audout:u and audin:u on ctor! server_manager->RegisterNamedService("audctl", std::make_shared(system)); server_manager->RegisterNamedService("audrec:a", std::make_shared(system)); server_manager->RegisterNamedService("audrec:u", std::make_shared(system)); server_manager->RegisterNamedService("audren:u", std::make_shared(system)); + server_manager->RegisterNamedService("audren:a", std::make_shared(system)); server_manager->RegisterNamedService("hwopus", std::make_shared(system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/audio/audio_renderer_manager.cpp b/src/core/hle/service/audio/audio_renderer_manager.cpp index 972e930a89..4756802eeb 100644 --- a/src/core/hle/service/audio/audio_renderer_manager.cpp +++ b/src/core/hle/service/audio/audio_renderer_manager.cpp @@ -11,6 +11,7 @@ #include "core/hle/service/audio/audio_device.h" #include "core/hle/service/audio/audio_renderer.h" #include "core/hle/service/audio/audio_renderer_manager.h" +#include "core/hle/service/audio/errors.h" #include "core/hle/service/cmif_serialization.h" namespace Service::Audio { @@ -54,6 +55,11 @@ Result IAudioRendererManager::OpenAudioRenderer( R_THROW(Audio::ResultOutOfSessions); } + if (!process_handle) { + LOG_ERROR(Service_Audio, "Invalid handles"); + R_THROW(Audio::ResultInvalidHandle); + } + LOG_DEBUG(Service_Audio, "Opened new AudioRenderer session {} sessions open {}", session_id, impl->GetSessionCount()); diff --git a/src/core/hle/service/caps/caps.cpp b/src/core/hle/service/caps/caps.cpp index eaee21eb86..ae39e58a27 100644 --- a/src/core/hle/service/caps/caps.cpp +++ b/src/core/hle/service/caps/caps.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 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 diff --git a/src/core/hle/service/caps/caps_manager.cpp b/src/core/hle/service/caps/caps_manager.cpp index 743c372aae..08725cb565 100644 --- a/src/core/hle/service/caps/caps_manager.cpp +++ b/src/core/hle/service/caps/caps_manager.cpp @@ -243,13 +243,10 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry, return SaveScreenShot(out_entry, attribute, report_option, {}, image_data, aruid); } -Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry, - const ScreenShotAttribute& attribute, - AlbumReportOption report_option, - const ApplicationData& app_data, std::span image_data, - u64 aruid) { - const u64 title_id = system.GetApplicationProcessProgramID(); +Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry, const ScreenShotAttribute& attribute, AlbumReportOption report_option, const ApplicationData& app_data, std::span image_data, u64 aruid) { + R_UNLESS(!image_data.empty(), ResultUnknown); //TODO: ??? + const u64 title_id = system.GetApplicationProcessProgramID(); auto static_service = system.ServiceManager().GetService("time:u", true); @@ -263,18 +260,13 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry, return result; } - // TODO: ??? - R_UNLESS(!image_data.empty(), ResultUnknown); - const auto date = ConvertToAlbumDateTime(posix_time); - return SaveImage(out_entry, image_data, title_id, date); } -Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry, - const ScreenShotAttribute& attribute, - const AlbumFileId& file_id, - std::span image_data) { +Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry, const ScreenShotAttribute& attribute, const AlbumFileId& file_id, std::span image_data) { + R_UNLESS(!image_data.empty(), ResultUnknown); //TODO: ??? + auto static_service = system.ServiceManager().GetService("time:u", true); @@ -289,7 +281,6 @@ Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry, } const auto date = ConvertToAlbumDateTime(posix_time); - return SaveImage(out_entry, image_data, file_id.application_id, date); } diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index 5adf248684..432783f96e 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -9,6 +9,7 @@ #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" +#include "frontend_common/firmware_manager.h" namespace Service::ES { @@ -319,10 +320,98 @@ private: Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); }; +class NDRM_LU final : public ServiceFramework { +public: + explicit NDRM_LU(Core::System& system_) + : ServiceFramework{system_, "ndrm:lu"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "Cmd1"}, + {2, nullptr, "Cmd2"}, + {3, nullptr, "Cmd3"}, + {1000, nullptr, "Cmd1000"}, + {8000, nullptr, "Cmd8000"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class NDRM_LA final : public ServiceFramework { +public: + explicit NDRM_LA(Core::System& system_) + : ServiceFramework{system_, "ndrm:la"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "Cmd1"}, + {2, nullptr, "Cmd2"}, + {3, nullptr, "Cmd3"}, + {4, nullptr, "Cmd4"}, + {5, nullptr, "Cmd5"}, + {6, nullptr, "Cmd6"}, + {7, nullptr, "Cmd7"}, + {8, nullptr, "Cmd8"}, + {9, nullptr, "Cmd9"}, + {10, nullptr, "Cmd10"}, + {11, nullptr, "Cmd11"}, + {12, nullptr, "Cmd12"}, + {13, nullptr, "Cmd13"}, + {14, nullptr, "Cmd14"}, + {15, nullptr, "Cmd15"}, + {16, nullptr, "Cmd16"}, + {17, nullptr, "Cmd17"}, + {18, nullptr, "Cmd18"}, + {19, nullptr, "Cmd19"}, + {20, nullptr, "Cmd20"}, + {21, nullptr, "Cmd21"}, + {22, nullptr, "Cmd22"}, + {23, nullptr, "Cmd23"}, + {24, nullptr, "Cmd24"}, + {25, nullptr, "Cmd25"}, + {26, nullptr, "Cmd26"}, + {27, nullptr, "Cmd27"}, + {28, nullptr, "Cmd28"}, + {29, nullptr, "Cmd29"}, + {30, nullptr, "Cmd30"}, + {31, nullptr, "Cmd31"}, + {32, nullptr, "Cmd32"}, + {33, nullptr, "Cmd33"}, + {34, nullptr, "Cmd34"}, + {35, nullptr, "Cmd35"}, + {36, nullptr, "Cmd36"}, + {37, nullptr, "Cmd37"}, + {38, nullptr, "Cmd38"}, + {39, nullptr, "Cmd39"}, + {40, nullptr, "Cmd40"}, + {42, nullptr, "Cmd42"}, + {43, nullptr, "Cmd43"}, + {44, nullptr, "Cmd44"}, + {45, nullptr, "Cmd45"}, + {46, nullptr, "Cmd46"}, + {47, nullptr, "Cmd47"}, + {48, nullptr, "Cmd48"}, + {49, nullptr, "Cmd49"}, + {50, nullptr, "Cmd50"}, + {51, nullptr, "Cmd51"}, + {8000, nullptr, "Cmd8000"}, + {8001, nullptr, "Cmd8001"}, + {8002, nullptr, "Cmd8002"}, + {8003, nullptr, "Cmd8003"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); server_manager->RegisterNamedService("es", std::make_shared(system)); + // +13.0.0 + if (FirmwareManager::GetFirmwareVersion(system).first.major >= 13) { + server_manager->RegisterNamedService("ndrm:lu", std::make_shared(system)); + server_manager->RegisterNamedService("ndrm:la", std::make_shared(system)); + } ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index de23185591..f8690dbb8b 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp @@ -497,20 +497,79 @@ Module::Interface::Interface(std::shared_ptr module_, Core::System& syst Module::Interface::~Interface() = default; +class IServiceForApplication final : public ServiceFramework { +public: + explicit IServiceForApplication(Core::System& system_) + : ServiceFramework{system_, "nd:app"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetReceivableNeighborInfoCountMax"}, + {10, nullptr, "IsNeighborDetectionEnabled"}, + }; + RegisterHandlers(functions); + } +}; + +class IServiceForSystem final : public ServiceFramework { +public: + explicit IServiceForSystem(Core::System& system_) + : ServiceFramework{system_, "nd:sys"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetReceivableNeighborInfoCountMax"}, + {10, nullptr, "IsNeighborDetectionEnabled"}, + {200, nullptr, "SetSystemData"}, + {201, nullptr, "ClearSystemData"}, + {203, nullptr, "GetReceivableNeighborInfoCountForSystem"}, + {204, nullptr, "ReceiveNeighborInfoForSystem"}, + {205, nullptr, "SetSender"}, + {206, nullptr, "GetSender"}, + {207, nullptr, "CreateScannerForSystem"}, + {208, nullptr, "CreateReceiveEventHolderForSystem"}, + {223, nullptr, "EnableNeighborDetection"}, + {224, nullptr, "DisableNeighborDetection"}, + {226, nullptr, "EnablePowerSave"}, + {227, nullptr, "DisablePowerSave"}, + {228, nullptr, "IsPowerSaveEnabled"}, + {232, nullptr, "ClearBlockedUsers"}, + {233, nullptr, "GetBlockedUserCount"}, + {234, nullptr, "BlockUserByLocalUserId"}, + {235, nullptr, "BlockUserByNetworkUserId"}, + {236, nullptr, "UnblockUserByLocalUserId"}, + {237, nullptr, "UnblockUserByNetworkUserId"}, + {240, nullptr, "DeleteApplication"}, + {250, nullptr, "InitializeApplicationInfo"}, + {260, nullptr, "CreateAccountSystemSaveDataAccessSuppressor"}, + {300, nullptr, "AddReceivedNeighborInfoForSystemForDebug"}, + {301, nullptr, "GetSendDataForDebug"}, + {302, nullptr, "ClearReceiveCounterForDebug"}, + {303, nullptr, "GetNextReceiveCounterForDebug"}, + {304, nullptr, "ListBlockedUsersForDebug"}, + {305, nullptr, "RefreshSendDataIdForDebug"}, + {306, nullptr, "ReloadFwdbgSettingsForDebug"}, + {307, nullptr, "EnableApplicationForDebug"}, + {308, nullptr, "GetNextReceiveCountersForDebug"}, + {309, nullptr, "ListApplicationInfoForDebug"}, + {310, nullptr, "SetApplicationDataForDebug"}, + {400, nullptr, "GetNetworkUserId"}, + {401, nullptr, "DeleteNetworkUserId"}, + }; + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto module = std::make_shared(); - server_manager->RegisterNamedService("friend:a", - std::make_shared(module, system, "friend:a")); - server_manager->RegisterNamedService("friend:m", - std::make_shared(module, system, "friend:m")); - server_manager->RegisterNamedService("friend:s", - std::make_shared(module, system, "friend:s")); - server_manager->RegisterNamedService("friend:u", - std::make_shared(module, system, "friend:u")); - server_manager->RegisterNamedService("friend:v", - std::make_shared(module, system, "friend:v")); + server_manager->RegisterNamedService("nd:app", std::make_shared(system)); + server_manager->RegisterNamedService("nd:sys", std::make_shared(system)); + + server_manager->RegisterNamedService("friend:a", std::make_shared(module, system, "friend:a")); + server_manager->RegisterNamedService("friend:m", std::make_shared(module, system, "friend:m")); + server_manager->RegisterNamedService("friend:s", std::make_shared(module, system, "friend:s")); + server_manager->RegisterNamedService("friend:u", std::make_shared(module, system, "friend:u")); + server_manager->RegisterNamedService("friend:v", std::make_shared(module, system, "friend:v")); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/glue/ectx.h b/src/core/hle/service/glue/ectx.h index 9c40d2d229..ff48075eda 100644 --- a/src/core/hle/service/glue/ectx.h +++ b/src/core/hle/service/glue/ectx.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/glue.cpp b/src/core/hle/service/glue/glue.cpp index 72d15be646..46d078d00b 100644 --- a/src/core/hle/service/glue/glue.cpp +++ b/src/core/hle/service/glue/glue.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/glue/notif.cpp b/src/core/hle/service/glue/notif.cpp index 49811bff4f..716e4da32d 100644 --- a/src/core/hle/service/glue/notif.cpp +++ b/src/core/hle/service/glue/notif.cpp @@ -116,12 +116,10 @@ Result NotificationServiceImpl::Initialize(u64 aruid) { R_SUCCEED(); } -std::vector::iterator NotificationServiceImpl::GetAlarmFromId( - AlarmSettingId alarm_setting_id) { - return std::find_if(alarms.begin(), alarms.end(), - [alarm_setting_id](const AlarmSetting& alarm) { - return alarm.alarm_setting_id == alarm_setting_id; - }); +std::vector::iterator NotificationServiceImpl::GetAlarmFromId(AlarmSettingId alarm_setting_id) { + return std::find_if(alarms.begin(), alarms.end(), [alarm_setting_id](const AlarmSetting& alarm) { + return alarm.alarm_setting_id == alarm_setting_id; + }); } INotificationServicesForApplication::INotificationServicesForApplication(Core::System& system_) diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 9a45f130df..1d9a610b30 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -357,10 +357,26 @@ private: } }; +class LM_GET final : public ServiceFramework { +public: + explicit LM_GET(Core::System& system_) + : ServiceFramework{system_, "lm:get"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "StartLogging"}, + {1, nullptr, "StopLogging"}, + {2, nullptr, "GetLog"}, + {100, nullptr, "CreateDevNotificationReceiver"}, + }; + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); server_manager->RegisterNamedService("lm", std::make_shared(system)); + server_manager->RegisterNamedService("lm:get", std::make_shared(system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index f787da9825..6c754d5567 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp @@ -427,11 +427,26 @@ private: } }; +class NCM_V final : public ServiceFramework { +public: + explicit NCM_V(Core::System& system_) + : ServiceFramework{system_, "ncm:v"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetSystemVersion"}, + }; + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); server_manager->RegisterNamedService("lr", std::make_shared(system)); server_manager->RegisterNamedService("ncm", std::make_shared(system)); + if (1 /* not retail */) { + server_manager->RegisterNamedService("ncm:v", std::make_shared(system)); + } ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index dfea4efa69..661da88b0c 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -519,11 +519,25 @@ private: } }; +class NIM_ECAS final : public ServiceFramework { +public: + explicit NIM_ECAS(Core::System& system_) : ServiceFramework{system_, "nim:ecas"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RegisterSpecialClient"}, + {1, nullptr, "UnregisterSpecialClient"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); server_manager->RegisterNamedService("nim", std::make_shared(system)); server_manager->RegisterNamedService("nim:eca", std::make_shared(system)); + server_manager->RegisterNamedService("nim:ecas", std::make_shared(system)); server_manager->RegisterNamedService("nim:shp", std::make_shared(system)); server_manager->RegisterNamedService("ntc", std::make_shared(system)); ServerManager::RunServer(std::move(server_manager)); diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index 8c618ca258..cc006bd975 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2021 yuzu Emulator Project // SPDX-FileCopyrightText: 2021 Skyline Team and Contributors // SPDX-License-Identifier: GPL-3.0-or-later @@ -25,6 +28,7 @@ #include "core/hle/service/nvdrv/nvmemp.h" #include "core/hle/service/nvnflinger/nvnflinger.h" #include "core/hle/service/server_manager.h" +#include "frontend_common/firmware_manager.h" #include "video_core/gpu.h" namespace Service::Nvidia { @@ -42,26 +46,75 @@ void EventInterface::FreeEvent(Kernel::KEvent* event) { module.service_context.CloseEvent(event); } +class NVGEM_C final : public ServiceFramework { +public: + explicit NVGEM_C(Core::System& system_) + : ServiceFramework{system_, "nvgem:c"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "GetEventHandle"}, + {2, nullptr, "ControlNotification"}, + {3, nullptr, "SetNotificationPerm"}, + {4, nullptr, "SetCoreDumpPerm"}, + {5, nullptr, "GetAruid"}, + {6, nullptr, "Reset"}, + {7, nullptr, "GetAruid2"}, + }; + RegisterHandlers(functions); + } +}; + +class NVGEM_CD final : public ServiceFramework { +public: + explicit NVGEM_CD(Core::System& system_) + : ServiceFramework{system_, "nvgem:cd"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "GetAruid"}, + {2, nullptr, "ReadNextBlock"}, + {3, nullptr, "GetNextBlockSize"}, + {4, nullptr, "ReadNextBlock2"}, + }; + RegisterHandlers(functions); + } +}; + +class NVDBG_D final : public ServiceFramework { +public: + explicit NVDBG_D(Core::System& system_) + : ServiceFramework{system_, "nvdbg:d"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "Open"}, + {1, nullptr, "Ioctl"}, + {2, nullptr, "Close"}, + {4, nullptr, "QueryEvent"}, + {9, nullptr, "DumpStatus"}, + {10, nullptr, "InitializeDevtools"}, + {11, nullptr, "Ioctl2"}, + {12, nullptr, "Ioctl3"}, + {13, nullptr, "SetConfiguration"}, + }; + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto module = std::make_shared(system); - const auto NvdrvInterfaceFactoryForApplication = [&, module] { - return std::make_shared(system, module, "nvdrv"); - }; - const auto NvdrvInterfaceFactoryForApplets = [&, module] { - return std::make_shared(system, module, "nvdrv:a"); - }; - const auto NvdrvInterfaceFactoryForSysmodules = [&, module] { - return std::make_shared(system, module, "nvdrv:s"); - }; - const auto NvdrvInterfaceFactoryForTesting = [&, module] { - return std::make_shared(system, module, "nvdrv:t"); - }; - server_manager->RegisterNamedService("nvdrv", NvdrvInterfaceFactoryForApplication); - server_manager->RegisterNamedService("nvdrv:a", NvdrvInterfaceFactoryForApplets); - server_manager->RegisterNamedService("nvdrv:s", NvdrvInterfaceFactoryForSysmodules); - server_manager->RegisterNamedService("nvdrv:t", NvdrvInterfaceFactoryForTesting); + server_manager->RegisterNamedService("nvdrv", std::make_shared(system, module, "nvdrv")); + server_manager->RegisterNamedService("nvdrv:a", std::make_shared(system, module, "nvdrv:a")); + server_manager->RegisterNamedService("nvdrv:s", std::make_shared(system, module, "nvdrv:s")); + server_manager->RegisterNamedService("nvdrv:t", std::make_shared(system, module, "nvdrv:t")); server_manager->RegisterNamedService("nvmemp", std::make_shared(system)); + server_manager->RegisterNamedService("nvgem:c", std::make_shared(system)); + server_manager->RegisterNamedService("nvgem:cd", std::make_shared(system)); + // +10.0.0 + if (FirmwareManager::GetFirmwareVersion(system).first.major >= 10) { + server_manager->RegisterNamedService("nvdbg:d", std::make_shared(system)); + } ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp index afb8067cd5..d162881ecf 100644 --- a/src/core/hle/service/pcie/pcie.cpp +++ b/src/core/hle/service/pcie/pcie.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -9,6 +9,7 @@ #include "core/hle/service/pcie/pcie.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" +#include "frontend_common/firmware_manager.h" namespace Service::PCIe { @@ -48,9 +49,9 @@ public: } }; -class PCIe final : public ServiceFramework { +class PCIE final : public ServiceFramework { public: - explicit PCIe(Core::System& system_) : ServiceFramework{system_, "pcie"} { + explicit PCIE(Core::System& system_) : ServiceFramework{system_, "pcie"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "RegisterClassDriver"}, @@ -62,10 +63,27 @@ public: } }; +class PCIE_LOG final : public ServiceFramework { +public: + explicit PCIE_LOG(Core::System& system_) : ServiceFramework{system_, "pcie:log"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetLoggedState"}, + {1, nullptr, "GetLoggedStateEvent"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); - server_manager->RegisterNamedService("pcie", std::make_shared(system)); + server_manager->RegisterNamedService("pcie", std::make_shared(system)); + // +6.0.0 + if (FirmwareManager::GetFirmwareVersion(system).first.major >= 6) { + server_manager->RegisterNamedService("pcie:log", std::make_shared(system)); + } ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp index e1762d6943..31fb9f0117 100644 --- a/src/core/hle/service/psc/psc.cpp +++ b/src/core/hle/service/psc/psc.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 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 @@ -14,23 +17,109 @@ namespace Service::PSC { +class PSC_L final : public ServiceFramework { +public: + explicit PSC_L(Core::System& system_) : ServiceFramework{system_, "psc:l"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize_3"}, + {1, nullptr, "Lock"}, + {2, nullptr, "Unlock"}, + {3, nullptr, "IsLocked"}, + {4, nullptr, "GetRelatedState"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class INS_R final : public ServiceFramework { +public: + explicit INS_R(Core::System& system_) : ServiceFramework{system_, "ins:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetInputSourceState"}, + {1, nullptr, "GetTriggerTargetEvent"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class INS_S final : public ServiceFramework { +public: + explicit INS_S(Core::System& system_) : ServiceFramework{system_, "ins:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetNotifyEvent"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class HSHL_SYS final : public ServiceFramework { +public: + explicit HSHL_SYS(Core::System& system_) : ServiceFramework{system_, "hshl:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetBatteryPercentage"}, + {1, nullptr, "GetChargerType"}, + {2, nullptr, "OpenChargeSession"}, + {3, nullptr, "GetRawBatteryPercentage"}, + {4, nullptr, "GetBatteryVoltageLevel"}, + {5, nullptr, "OpenThermalSession"}, + {6, nullptr, "GetAbnormalTemperatureSet"}, + {7, nullptr, "OpenClockSession"}, + {8, nullptr, "GetClockRate"}, + {9, nullptr, "OpenBridgeSession"}, + {10, nullptr, "GetBridgePowerSupply"}, + {11, nullptr, "OpenVsysVoltageSession"}, + {12, nullptr, "GetIsBatteryEnoughForFullAwake"}, + {13, nullptr, "GetIsCharging"}, + {14, nullptr, "Cmd14"}, + {15, nullptr, "Cmd15"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class HSHL_SET final : public ServiceFramework { +public: + explicit HSHL_SET(Core::System& system_) : ServiceFramework{system_, "hshl:set"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenChargeSession_2"}, + {1, nullptr, "OpenThermalSession_2"}, + {2, nullptr, "SetClockRate"}, + {3, nullptr, "SetBridgePowerSupply"}, + {4, nullptr, "Cmd4"}, + {5, nullptr, "Cmd5"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); server_manager->RegisterNamedService("psc:c", std::make_shared(system)); server_manager->RegisterNamedService("psc:m", std::make_shared(system)); + server_manager->RegisterNamedService("psc:l", std::make_shared(system)); + server_manager->RegisterNamedService("ins:r", std::make_shared(system)); + server_manager->RegisterNamedService("ins:s", std::make_shared(system)); + server_manager->RegisterNamedService("hshl:sys", std::make_shared(system)); + server_manager->RegisterNamedService("hshl:set", std::make_shared(system)); server_manager->RegisterNamedService("ovln:rcv", std::make_shared(system)); server_manager->RegisterNamedService("ovln:snd", std::make_shared(system)); auto time = std::make_shared(system); - server_manager->RegisterNamedService( - "time:m", std::make_shared(system, time, server_manager.get())); - server_manager->RegisterNamedService( - "time:su", std::make_shared( - system, Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 1}, time, "time:su")); - server_manager->RegisterNamedService("time:al", - std::make_shared(system, time)); + server_manager->RegisterNamedService("time:m", std::make_shared(system, time, server_manager.get())); + server_manager->RegisterNamedService("time:su", std::make_shared(system, Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 1}, time, "time:su")); + server_manager->RegisterNamedService("time:al", std::make_shared(system, time)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/psc/time/service_manager.cpp b/src/core/hle/service/psc/time/service_manager.cpp index 9ef61117a0..e9f1407e4d 100644 --- a/src/core/hle/service/psc/time/service_manager.cpp +++ b/src/core/hle/service/psc/time/service_manager.cpp @@ -159,6 +159,8 @@ Result ServiceManager::SetupTimeZoneServiceCore(const LocationName& name, name, rule_version, location_count, time_point, time_point.clock_source_id.RawString()); + R_UNLESS(!rule_buffer.empty(), ResultUnknown); //TODO: ??? + if (m_time_zone.ParseBinary(name, rule_buffer) != ResultSuccess) { LOG_ERROR(Service_Time, "Failed to parse time zone binary!"); } diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 6f0cfe04b8..de1d34a688 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -11,10 +14,42 @@ namespace Service::PTM { +class PSM_MANU final : public ServiceFramework { +public: + explicit PSM_MANU(Core::System& system_) + : ServiceFramework{system_, "psm:manu"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "EnableVdd50StateControl"}, + {1, nullptr, "DisableVdd50StateControl"}, + {2, nullptr, "SetVdd50State"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class POWCTL final : public ServiceFramework { +public: + explicit POWCTL(Core::System& system_) + : ServiceFramework{system_, "powctl"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenSession"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); server_manager->RegisterNamedService("psm", std::make_shared(system)); + if (1 /* not retail */) { + server_manager->RegisterNamedService("psm:manu", std::make_shared(system)); + server_manager->RegisterNamedService("powctl", std::make_shared(system)); + } server_manager->RegisterNamedService("ts", std::make_shared(system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/services.cpp b/src/core/hle/service/services.cpp index 01fce2ac00..95d3eeade4 100644 --- a/src/core/hle/service/services.cpp +++ b/src/core/hle/service/services.cpp @@ -64,6 +64,7 @@ #include "core/hle/service/sockets/sockets.h" #include "core/hle/service/spl/spl_module.h" #include "core/hle/service/ssl/ssl.h" +#include "core/hle/service/tma/tma.h" #include "core/hle/service/usb/usb.h" #include "core/hle/service/vi/vi.h" @@ -146,6 +147,7 @@ Services::Services(std::shared_ptr& sm, Core::System& system {"ro", &RO::LoopProcess}, {"spl", &SPL::LoopProcess}, {"ssl", &SSL::LoopProcess}, + {"tma", &TMA::LoopProcess}, {"usb", &USB::LoopProcess}, {"i2c", &I2C::LoopProcess}, {"gpio", &GPIO::LoopProcess}, diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp index 28fcbd3a41..8d9e3c0b8b 100644 --- a/src/core/hle/service/sockets/sockets.cpp +++ b/src/core/hle/service/sockets/sockets.cpp @@ -12,9 +12,48 @@ namespace Service::Sockets { +class ETHC_C final : public ServiceFramework { +public: + explicit ETHC_C(Core::System& system_) + : ServiceFramework{system_, "ethc:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "Cancel"}, + {2, nullptr, "GetResult"}, + {3, nullptr, "GetMediaList"}, + {4, nullptr, "SetMediaType"}, + {5, nullptr, "GetMediaType"}, + {6, nullptr, "GetMacAddress"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + +class ETHC_I final : public ServiceFramework { +public: + explicit ETHC_I(Core::System& system_) + : ServiceFramework{system_, "ethc:i"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetReadableHandle"}, + {1, nullptr, "Cancel"}, + {2, nullptr, "GetResult"}, + {3, nullptr, "GetInterfaceList"}, + {4, nullptr, "GetInterfaceCount"}, + }; + // clang-format on + RegisterHandlers(functions); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); + server_manager->RegisterNamedService("ethc:c", std::make_shared(system)); + server_manager->RegisterNamedService("ethc:i", std::make_shared(system)); + server_manager->RegisterNamedService("bsd:s", std::make_shared(system, "bsd:s", false)); server_manager->RegisterNamedService("bsd:u", std::make_shared(system, "bsd:u", true)); server_manager->RegisterNamedService("bsd:a", std::make_shared(system, "bsd:a", true)); diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp index 377c602610..89403a6d90 100644 --- a/src/core/hle/service/spl/spl.cpp +++ b/src/core/hle/service/spl/spl.cpp @@ -25,6 +25,8 @@ SPL::SPL(Core::System& system_, std::shared_ptr module_) RegisterHandlers(functions); } +SPL::~SPL() = default; + SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:mig") { // clang-format off @@ -51,6 +53,8 @@ SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr module_) RegisterHandlers(functions); } +SPL_MIG::~SPL_MIG() = default; + SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:fs") { // clang-format off @@ -82,6 +86,8 @@ SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr module_) RegisterHandlers(functions); } +SPL_FS::~SPL_FS() = default; + SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:ssl") { // clang-format off @@ -111,6 +117,8 @@ SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr module_) RegisterHandlers(functions); } +SPL_SSL::~SPL_SSL() = default; + SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:es") { // clang-format off @@ -145,6 +153,8 @@ SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr module_) RegisterHandlers(functions); } +SPL_ES::~SPL_ES() = default; + SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr module_) : Interface(system_, std::move(module_), "spl:manu") { // clang-format off @@ -173,16 +183,29 @@ SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr module_) RegisterHandlers(functions); } -SPL::~SPL() = default; - -SPL_MIG::~SPL_MIG() = default; - -SPL_FS::~SPL_FS() = default; - -SPL_SSL::~SPL_SSL() = default; - -SPL_ES::~SPL_ES() = default; - SPL_MANU::~SPL_MANU() = default; +SPL_LDN::SPL_LDN(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "spl:manu") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GenerateRandomBytes"}, + {1, nullptr, "GetConfig"}, + {2, nullptr, "Cmd2"}, + {3, nullptr, "Cmd3"}, + {4, nullptr, "Cmd4"}, + {5, nullptr, "GetConfigWithBuffer"}, + {7000, nullptr, "GenerateNxAdvertiseKey"}, + {7001, nullptr, "GenerateNxSessionKey"}, + {7002, nullptr, "GenerateNxLp2pKeyIndex1"}, + {7003, nullptr, "GenerateNxLp2pKeyIndex2"}, + {7004, nullptr, "GenerateOunceAdvertiseKey"}, + {7005, nullptr, "GenerateOunceSessionKey"}, + }; + // clang-format on + RegisterHandlers(functions); +} + +SPL_LDN::~SPL_LDN() = default; + } // namespace Service::SPL diff --git a/src/core/hle/service/spl/spl.h b/src/core/hle/service/spl/spl.h index 7b63d8b1a9..928530579b 100644 --- a/src/core/hle/service/spl/spl.h +++ b/src/core/hle/service/spl/spl.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 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,4 +50,10 @@ public: ~SPL_MANU() override; }; +class SPL_LDN final : public Module::Interface { +public: + explicit SPL_LDN(Core::System& system_, std::shared_ptr module_); + ~SPL_LDN() override; +}; + } // namespace Service::SPL diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp index d62cecf9a2..0529fd41f0 100644 --- a/src/core/hle/service/spl/spl_module.cpp +++ b/src/core/hle/service/spl/spl_module.cpp @@ -214,6 +214,7 @@ void LoopProcess(Core::System& system) { server_manager->RegisterNamedService("spl:ssl", std::make_shared(system, module)); server_manager->RegisterNamedService("spl:es", std::make_shared(system, module)); server_manager->RegisterNamedService("spl:manu", std::make_shared(system, module)); + server_manager->RegisterNamedService("spl:ldn", std::make_shared(system, module)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/tma/tma.cpp b/src/core/hle/service/tma/tma.cpp new file mode 100644 index 0000000000..c2fb33cd16 --- /dev/null +++ b/src/core/hle/service/tma/tma.cpp @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: Copyright 2026 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 + +#include "core/core.h" +#include "core/hle/result.h" +#include "core/hle/service/tma/tma.h" +#include "core/hle/service/ipc_helpers.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" +#include "core/hle/service/server_manager.h" + +namespace Service::TMA { + +class HTC_TENV final : public ServiceFramework { +public: + explicit HTC_TENV(Core::System& system_) + : ServiceFramework{system_, "htc:tenv"} + { + static const FunctionInfo functions[] = { + {0, nullptr, "GetServiceInterface"}, + }; + RegisterHandlers(functions); + } +}; + +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique(system); + server_manager->RegisterNamedService("htc:tenv", std::make_shared(system)); + ServerManager::RunServer(std::move(server_manager)); +} + +} // namespace Service::TMA diff --git a/src/core/hle/service/tma/tma.h b/src/core/hle/service/tma/tma.h new file mode 100644 index 0000000000..05324eaa1e --- /dev/null +++ b/src/core/hle/service/tma/tma.h @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: Copyright 2026 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 + +#pragma once + +namespace Core { +class System; +} + +namespace Service::TMA { +void LoopProcess(Core::System& system); +} // namespace Service::TMA