|
|
|
@ -168,7 +168,7 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr<ResourceManager> r
|
|
|
|
|
{307, &IHidServer::FinalizeSevenSixAxisSensor, "FinalizeSevenSixAxisSensor"},
|
|
|
|
|
{308, nullptr, "SetSevenSixAxisSensorFusionStrength"},
|
|
|
|
|
{309, nullptr, "GetSevenSixAxisSensorFusionStrength"},
|
|
|
|
|
{310, nullptr, "ResetSevenSixAxisSensorTimestamp"},
|
|
|
|
|
{310, &IHidServer::ResetSevenSixAxisSensorTimestamp, "ResetSevenSixAxisSensorTimestamp"},
|
|
|
|
|
{400, nullptr, "IsUsbFullKeyControllerEnabled"},
|
|
|
|
|
{401, nullptr, "EnableUsbFullKeyController"},
|
|
|
|
|
{402, nullptr, "IsUsbFullKeyControllerConnected"},
|
|
|
|
@ -330,7 +330,7 @@ void IHidServer::AcquireXpadIdEventHandle(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -342,7 +342,7 @@ void IHidServer::ReleaseXpadIdEventHandle(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -362,7 +362,7 @@ void IHidServer::ActivateXpad(HLERequestContext& ctx) {
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, basic_xpad_id={}, applet_resource_user_id={}",
|
|
|
|
|
parameters.basic_xpad_id, parameters.applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -371,7 +371,7 @@ void IHidServer::ActivateXpad(HLERequestContext& ctx) {
|
|
|
|
|
void IHidServer::GetXpadIds(HLERequestContext& ctx) {
|
|
|
|
|
LOG_DEBUG(Service_HID, "called");
|
|
|
|
|
|
|
|
|
|
// This service has been hardcoded since 10.0.0+
|
|
|
|
|
// This function has been hardcoded since 10.0.0+
|
|
|
|
|
std::array<u32, 4> basic_xpad_id{0, 1, 2, 3};
|
|
|
|
|
ctx.WriteBuffer(basic_xpad_id);
|
|
|
|
|
|
|
|
|
@ -386,7 +386,7 @@ void IHidServer::ActivateJoyXpad(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -398,7 +398,7 @@ void IHidServer::GetJoyXpadLifoHandle(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -407,7 +407,7 @@ void IHidServer::GetJoyXpadLifoHandle(HLERequestContext& ctx) {
|
|
|
|
|
void IHidServer::GetJoyXpadIds(HLERequestContext& ctx) {
|
|
|
|
|
LOG_DEBUG(Service_HID, "called");
|
|
|
|
|
|
|
|
|
|
// This service has been hardcoded since 10.0.0+
|
|
|
|
|
// This function has been hardcoded since 10.0.0+
|
|
|
|
|
std::array<u32, 4> basic_xpad_id{};
|
|
|
|
|
ctx.WriteBuffer(basic_xpad_id);
|
|
|
|
|
|
|
|
|
@ -422,7 +422,7 @@ void IHidServer::ActivateSixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -434,7 +434,7 @@ void IHidServer::DeactivateSixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -446,7 +446,7 @@ void IHidServer::GetSixAxisSensorLifoHandle(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -458,7 +458,7 @@ void IHidServer::ActivateJoySixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -470,7 +470,7 @@ void IHidServer::DeactivateJoySixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -482,7 +482,7 @@ void IHidServer::GetJoySixAxisSensorLifoHandle(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, joy_xpad_id={}", joy_xpad_id);
|
|
|
|
|
|
|
|
|
|
// This service has been stubbed since 10.0.0+
|
|
|
|
|
// This function has been stubbed since 10.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
@ -2115,14 +2115,123 @@ void IHidServer::SendVibrationValueInBool(HLERequestContext& ctx) {
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::ActivateConsoleSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::ActivateConsoleSixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
Result result = ResultSuccess;
|
|
|
|
|
auto sixaxis = GetResourceManager()->GetConsoleSixAxis();
|
|
|
|
|
|
|
|
|
|
if (IsDeviceManaged()) {
|
|
|
|
|
result = sixaxis->Activate(applet_resource_user_id);
|
|
|
|
|
} else {
|
|
|
|
|
result = sixaxis->Activate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(result);
|
|
|
|
|
}
|
|
|
|
|
void IHidServer::StartConsoleSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::StopConsoleSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::ActivateSevenSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::StartSevenSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
|
|
|
|
|
void IHidServer::StopConsoleSixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
struct Parameters {
|
|
|
|
|
SixAxisSensorHandle sixaxis_handle;
|
|
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
|
|
|
|
u64 applet_resource_user_id;
|
|
|
|
|
};
|
|
|
|
|
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
|
|
|
|
|
|
|
|
|
const auto parameters{rp.PopRaw<Parameters>()};
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(
|
|
|
|
|
Service_HID,
|
|
|
|
|
"(STUBBED) called, npad_type={}, npad_id={}, device_index={}, applet_resource_user_id={}",
|
|
|
|
|
parameters.sixaxis_handle.npad_type, parameters.sixaxis_handle.npad_id,
|
|
|
|
|
parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<SixAxisSensorState> state = nullptr;
|
|
|
|
|
const auto sixaxis = GetResourceManager()->GetSevenSixAxis();
|
|
|
|
|
const Result result = sixaxis->GetSensorState(state, parameters.applet_resource_user_id,
|
|
|
|
|
parameters.sixaxis_handle);
|
|
|
|
|
|
|
|
|
|
if (result.IsSuccess()) {
|
|
|
|
|
state->SetRunningState(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(result);
|
|
|
|
|
}
|
|
|
|
|
void IHidServer::ActivateSevenSixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
Result result = ResultSuccess;
|
|
|
|
|
auto sixaxis = GetResourceManager()->GetConsoleSixAxis();
|
|
|
|
|
|
|
|
|
|
if (IsDeviceManaged()) {
|
|
|
|
|
result = sixaxis->Activate(applet_resource_user_id);
|
|
|
|
|
} else {
|
|
|
|
|
result = sixaxis->Activate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::StartSevenSixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}",
|
|
|
|
|
applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<SixAxisSensorState> state = nullptr;
|
|
|
|
|
const auto sixaxis = GetResourceManager()->GetSevenSixAxis();
|
|
|
|
|
Result result = sixaxis->GetSensorState(state, parameters.applet_resource_user_id,
|
|
|
|
|
parameters.sixaxis_handle);
|
|
|
|
|
|
|
|
|
|
if (result.IsSuccess()) {
|
|
|
|
|
result = GetResourceManager()->GetConsoleSixAxis()->ResetSevenSixAxisSensorTimestamp();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result.IsSuccess()) {
|
|
|
|
|
state->SetRunningState(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::StopSevenSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::InitializeSevenSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::FinalizeSevenSixAxisSensor(HLERequestContext& ctx) {}
|
|
|
|
|
|
|
|
|
|
void IHidServer::FinalizeSevenSixAxisSensor(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}",
|
|
|
|
|
applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<SixAxisSensorState> state = nullptr;
|
|
|
|
|
const auto sixaxis = GetResourceManager()->GetSevenSixAxis();
|
|
|
|
|
Result result = sixaxis->GetSensorState(state, parameters.applet_resource_user_id,
|
|
|
|
|
parameters.sixaxis_handle);
|
|
|
|
|
|
|
|
|
|
if (result.IsSuccess()) {
|
|
|
|
|
state->SetRunningState(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = GetResourceManager()->GetConsoleSixAxis()->FinalizeSevenSixAxisSensor();
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::ResetSevenSixAxisSensorTimestamp(HLERequestContext& ctx) {}
|
|
|
|
|
|
|
|
|
|
void IHidServer::IsUsbFullKeyControllerEnabled(HLERequestContext& ctx) {
|
|
|
|
@ -2653,10 +2762,80 @@ void IHidServer::SetDisallowedPalmaConnection(HLERequestContext& ctx) {
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::SetNpadCommunicationMode(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::GetNpadCommunicationMode(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::SetTouchScreenConfiguration(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::IsFirmwareUpdateNeededForNotification(HLERequestContext& ctx) {}
|
|
|
|
|
void IHidServer::SetNpadCommunicationMode(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
|
|
|
|
const auto communication_mode{rp.PopEnum<NpadCommunicationMode>()};
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, communication_mode={}",
|
|
|
|
|
applet_resource_user_id, communication_mode);
|
|
|
|
|
|
|
|
|
|
// This function has been stubbed since 2.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::GetNpadCommunicationMode(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}",
|
|
|
|
|
applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
// This function has been stubbed since 2.0.0+
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 4};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
rb.PushEnum(NpadCommunicationMode::Default);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::SetTouchScreenConfiguration(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
auto touchscreen_mode{rp.PopRaw<TouchScreenConfigurationForNx>()};
|
|
|
|
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_HID, "(STUBBED) called, touchscreen_mode={}, applet_resource_user_id={}",
|
|
|
|
|
touchscreen_mode.mode, applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
switch (touchscreen_mode.mode) {
|
|
|
|
|
case TouchScreenModeForNx::UseSystemSetting:
|
|
|
|
|
case TouchScreenModeForNx::Finger:
|
|
|
|
|
case TouchScreenModeForNx::Heat2:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
touchscreen_mode.mode = TouchScreenModeForNx::UseSystemSetting;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Result result =
|
|
|
|
|
GetResourceManager()->GetTouchScreen()->SetTouchScreenConfiguration(touchscreen_mode);
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IHidServer::IsFirmwareUpdateNeededForNotification(HLERequestContext& ctx) {
|
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
|
struct Parameters {
|
|
|
|
|
s32 unknown;
|
|
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
|
|
|
|
u64 applet_resource_user_id;
|
|
|
|
|
};
|
|
|
|
|
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
|
|
|
|
|
|
|
|
|
const auto parameters{rp.PopRaw<Parameters>()};
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_HID, "(STUBBED) called, unknown={}, applet_resource_user_id={}",
|
|
|
|
|
parameters.unknown, parameters.applet_resource_user_id);
|
|
|
|
|
|
|
|
|
|
const bool needs_update =
|
|
|
|
|
GetResourceManager()->GetNpad()->IsFirmwareUpdateNeededForNotification(
|
|
|
|
|
parameters.applet_resource_user_id, parameters.unknown);
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
rb.Push(needs_update);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IHidServer::IsDeviceManaged() {
|
|
|
|
|
InitializeDebugSettings();
|
|
|
|
|