2022-04-23 10:59:50 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2015-01-19 00:07:48 +01:00
|
|
|
|
2023-12-06 01:39:18 +01:00
|
|
|
#include "core/hle/kernel/k_process.h"
|
|
|
|
#include "core/hle/kernel/kernel.h"
|
2016-09-21 08:52:38 +02:00
|
|
|
#include "core/hle/service/hid/hid.h"
|
2023-11-15 04:34:27 +01:00
|
|
|
#include "core/hle/service/hid/hid_debug_server.h"
|
|
|
|
#include "core/hle/service/hid/hid_server.h"
|
|
|
|
#include "core/hle/service/hid/hid_system_server.h"
|
2021-05-03 01:41:03 +02:00
|
|
|
#include "core/hle/service/hid/hidbus.h"
|
2018-07-26 14:39:25 +02:00
|
|
|
#include "core/hle/service/hid/irs.h"
|
2018-07-26 14:50:32 +02:00
|
|
|
#include "core/hle/service/hid/xcd.h"
|
2023-02-18 22:26:48 +01:00
|
|
|
#include "core/hle/service/server_manager.h"
|
2024-01-05 03:37:43 +01:00
|
|
|
#include "hid_core/resource_manager.h"
|
|
|
|
#include "hid_core/resources/hid_firmware_settings.h"
|
2015-03-09 05:14:59 +01:00
|
|
|
|
2023-11-15 04:34:27 +01:00
|
|
|
namespace Service::HID {
|
2018-07-26 14:56:16 +02:00
|
|
|
|
2023-02-18 22:26:48 +01:00
|
|
|
void LoopProcess(Core::System& system) {
|
|
|
|
auto server_manager = std::make_unique<ServerManager>(system);
|
2024-01-08 20:31:48 +01:00
|
|
|
std::shared_ptr<ResourceManager> resource_manager = std::make_shared<ResourceManager>(system);
|
2023-11-17 00:58:05 +01:00
|
|
|
std::shared_ptr<HidFirmwareSettings> firmware_settings =
|
2024-01-15 04:04:02 +01:00
|
|
|
std::make_shared<HidFirmwareSettings>(system);
|
2023-11-15 04:34:27 +01:00
|
|
|
|
2024-01-02 23:12:16 +01:00
|
|
|
// TODO: Remove this hack when am is emulated properly.
|
|
|
|
resource_manager->Initialize();
|
|
|
|
resource_manager->RegisterAppletResourceUserId(system.ApplicationProcess()->GetProcessId(),
|
|
|
|
true);
|
2024-01-11 05:06:54 +01:00
|
|
|
resource_manager->SetAruidValidForVibration(system.ApplicationProcess()->GetProcessId(), true);
|
2023-12-06 01:39:18 +01:00
|
|
|
|
2023-11-17 00:58:05 +01:00
|
|
|
server_manager->RegisterNamedService(
|
2024-01-08 20:31:48 +01:00
|
|
|
"hid", std::make_shared<IHidServer>(system, resource_manager, firmware_settings));
|
2023-11-15 04:34:27 +01:00
|
|
|
server_manager->RegisterNamedService(
|
2024-01-08 20:31:48 +01:00
|
|
|
"hid:dbg", std::make_shared<IHidDebugServer>(system, resource_manager));
|
2023-11-15 04:34:27 +01:00
|
|
|
server_manager->RegisterNamedService(
|
2024-01-23 06:30:34 +01:00
|
|
|
"hid:sys", std::make_shared<IHidSystemServer>(system, resource_manager, firmware_settings));
|
2018-07-26 14:56:16 +02:00
|
|
|
|
2023-02-18 22:26:48 +01:00
|
|
|
server_manager->RegisterNamedService("hidbus", std::make_shared<HidBus>(system));
|
2018-07-26 14:56:16 +02:00
|
|
|
|
2023-11-15 04:34:27 +01:00
|
|
|
server_manager->RegisterNamedService("irs", std::make_shared<IRS::IRS>(system));
|
|
|
|
server_manager->RegisterNamedService("irs:sys", std::make_shared<IRS::IRS_SYS>(system));
|
2023-02-18 22:26:48 +01:00
|
|
|
|
|
|
|
server_manager->RegisterNamedService("xcd:sys", std::make_shared<XCD_SYS>(system));
|
2023-11-15 04:34:27 +01:00
|
|
|
|
2023-02-18 22:26:48 +01:00
|
|
|
system.RunServer(std::move(server_manager));
|
2018-01-15 03:24:50 +01:00
|
|
|
}
|
|
|
|
|
2018-04-20 03:41:44 +02:00
|
|
|
} // namespace Service::HID
|