Files
eden/src/core/hle/service/ns/ns.cpp
T
lizzie a41a98028a [hle/service] stub missing homebrew services, fix NPad/caps crashes (#4264)
Signed-off-by: lizzie <lizzie@eden-emu.dev>

- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

this PR adds various missing services (acc:e, acc:e:u1)
to expand homebrew compatibility
notably this also fixes NPad related crashes due to nullref

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4264
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
2026-08-18 18:11:33 +02:00

64 lines
3.2 KiB
C++

// 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/hle/service/ns/develop_interface.h"
#include "core/hle/service/ns/ns.h"
#include "core/hle/service/ns/platform_service_manager.h"
#include "core/hle/service/ns/query_service.h"
#include "core/hle/service/ns/service_getter_interface.h"
#include "core/hle/service/ns/system_update_interface.h"
#include "core/hle/service/ns/vulnerability_manager_interface.h"
#include "core/hle/service/server_manager.h"
namespace Service::NS {
class INotifyService final : public ServiceFramework<INotifyService> {
public:
explicit INotifyService(Core::System& system_) : ServiceFramework{system_, "pdm:ntfy"} {
// clang-format off
static const FunctionInfo functions[] = {
{ 0, nullptr, "NotifyAppletEvent" },
{ 2, nullptr, "NotifyOperationModeChangeEvent" },
{ 3, nullptr, "NotifyPowerStateChangeEvent" },
{ 4, nullptr, "NotifyClearAllEvent" },
{ 5, nullptr, "NotifyEventForDebug" },
{ 6, nullptr, "SuspendUserAccountEventService" },
{ 7, nullptr, "ResumeUserAccountEventService" },
{ 8, nullptr, "NotifyLibraryAppletEvent" },
{ 9, nullptr, "Cmd9" },
{ 20, nullptr, "Cmd20" },
{ 30, nullptr, "Cmd30" },
{ 100, nullptr, "Cmd100" },
{ 101, nullptr, "Cmd101" },
};
// clang-format on
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("ns:am2", std::make_shared<IServiceGetterInterface>(system, "ns:am2"));
server_manager->RegisterNamedService("ns:ec", std::make_shared<IServiceGetterInterface>(system, "ns:ec"));
server_manager->RegisterNamedService("ns:rid", std::make_shared<IServiceGetterInterface>(system, "ns:rid"));
server_manager->RegisterNamedService("ns:rt", std::make_shared<IServiceGetterInterface>(system, "ns:rt"));
server_manager->RegisterNamedService("ns:web", std::make_shared<IServiceGetterInterface>(system, "ns:web"));
server_manager->RegisterNamedService("ns:ro", std::make_shared<IServiceGetterInterface>(system, "ns:ro"));
server_manager->RegisterNamedService("ns:dev", std::make_shared<IDevelopInterface>(system));
server_manager->RegisterNamedService("ns:su", std::make_shared<ISystemUpdateInterface>(system));
server_manager->RegisterNamedService("ns:vm", std::make_shared<IVulnerabilityManagerInterface>(system));
server_manager->RegisterNamedService("pdm:ntfy", std::make_shared<INotifyService>(system));
server_manager->RegisterNamedService("pdm:qry", std::make_shared<IQueryService>(system));
server_manager->RegisterNamedService("pl:s", std::make_shared<IPlatformServiceManager>(system, "pl:s"));
server_manager->RegisterNamedService("pl:u", std::make_shared<IPlatformServiceManager>(system, "pl:u"));
ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::NS