forked from suyu/suyu
hid: Pop a struct of parameters instead of popping individual parameters
Some parameters need to be doubleword aligned due to the presence of the applet_resource_user_id. Previously, this value was invalid in many commands where it was not doubleword aligned when popped.
This commit is contained in:
parent
e3c2749986
commit
31de52513e
1 changed files with 237 additions and 103 deletions
|
@ -388,13 +388,18 @@ void Hid::SendKeyboardLockKeyEvent(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) {
|
void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto basic_xpad_id{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 basic_xpad_id{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->ActivateController(HidController::XPad);
|
applet_resource->ActivateController(HidController::XPad);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, basic_xpad_id={}, applet_resource_user_id={}", basic_xpad_id,
|
LOG_DEBUG(Service_HID, "called, basic_xpad_id={}, applet_resource_user_id={}",
|
||||||
applet_resource_user_id);
|
parameters.basic_xpad_id, parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -413,13 +418,20 @@ void Hid::GetXpadIDs(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::ActivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
void Hid::ActivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetSixAxisEnabled(true);
|
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetSixAxisEnabled(true);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, handle={}, applet_resource_user_id={}", handle,
|
LOG_DEBUG(Service_HID,
|
||||||
applet_resource_user_id);
|
"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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -427,13 +439,20 @@ void Hid::ActivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetSixAxisEnabled(false);
|
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetSixAxisEnabled(false);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, handle={}, applet_resource_user_id={}", handle,
|
LOG_DEBUG(Service_HID,
|
||||||
applet_resource_user_id);
|
"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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -441,11 +460,20 @@ void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", handle,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id);
|
|
||||||
|
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetSixAxisEnabled(true);
|
||||||
|
|
||||||
|
LOG_DEBUG(Service_HID,
|
||||||
|
"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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -453,11 +481,20 @@ void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", handle,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id);
|
|
||||||
|
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetSixAxisEnabled(false);
|
||||||
|
|
||||||
|
LOG_DEBUG(Service_HID,
|
||||||
|
"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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -465,12 +502,21 @@ void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
|
void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
[[maybe_unused]] const auto enable{rp.Pop<bool>()};
|
struct Parameters {
|
||||||
const auto handle{rp.Pop<u32>()};
|
bool enable_sixaxis_sensor_fusion{};
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
INSERT_PADDING_BYTES(3);
|
||||||
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", enable,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
handle, applet_resource_user_id);
|
|
||||||
|
LOG_WARNING(Service_HID,
|
||||||
|
"(STUBBED) called, enable_sixaxis_sensor_fusion={}, npad_type={}, npad_id={}, "
|
||||||
|
"device_index={}, applet_resource_user_id={}",
|
||||||
|
parameters.enable_sixaxis_sensor_fusion, parameters.sixaxis_handle.npad_type,
|
||||||
|
parameters.sixaxis_handle.npad_id, parameters.sixaxis_handle.device_index,
|
||||||
|
parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -478,14 +524,17 @@ void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
const auto sixaxis_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()};
|
||||||
const auto drift_mode{rp.Pop<u32>()};
|
const auto drift_mode{rp.PopEnum<Controller_NPad::GyroscopeZeroDriftMode>()};
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SetGyroscopeZeroDriftMode({drift_mode});
|
.SetGyroscopeZeroDriftMode(drift_mode);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, handle={}, drift_mode={}, applet_resource_user_id={}", handle,
|
LOG_DEBUG(Service_HID,
|
||||||
|
"called, npad_type={}, npad_id={}, device_index={}, drift_mode={}, "
|
||||||
|
"applet_resource_user_id={}",
|
||||||
|
sixaxis_handle.npad_type, sixaxis_handle.npad_id, sixaxis_handle.device_index,
|
||||||
drift_mode, applet_resource_user_id);
|
drift_mode, applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
@ -494,11 +543,18 @@ void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, handle={}, applet_resource_user_id={}", handle,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id);
|
|
||||||
|
LOG_DEBUG(Service_HID,
|
||||||
|
"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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -508,14 +564,21 @@ void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SetGyroscopeZeroDriftMode(Controller_NPad::GyroscopeZeroDriftMode::Standard);
|
.SetGyroscopeZeroDriftMode(Controller_NPad::GyroscopeZeroDriftMode::Standard);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, handle={}, applet_resource_user_id={}", handle,
|
LOG_DEBUG(Service_HID,
|
||||||
applet_resource_user_id);
|
"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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -523,11 +586,18 @@ void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
|
void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, handle={}, applet_resource_user_id={}", handle,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id);
|
|
||||||
|
LOG_DEBUG(Service_HID,
|
||||||
|
"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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -537,13 +607,18 @@ void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::ActivateGesture(Kernel::HLERequestContext& ctx) {
|
void Hid::ActivateGesture(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto unknown{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 unknown{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->ActivateController(HidController::Gesture);
|
applet_resource->ActivateController(HidController::Gesture);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, unknown={}, applet_resource_user_id={}", unknown,
|
LOG_DEBUG(Service_HID, "called, unknown={}, applet_resource_user_id={}", parameters.unknown,
|
||||||
applet_resource_user_id);
|
parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -614,28 +689,39 @@ void Hid::DeactivateNpad(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
|
void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto npad_id{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 npad_id{};
|
||||||
const auto unknown{rp.Pop<u64>()};
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
u64 unknown{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}, unknown={}", npad_id,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id, unknown);
|
|
||||||
|
LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}, unknown={}",
|
||||||
|
parameters.npad_id, parameters.applet_resource_user_id, parameters.unknown);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushCopyObjects(applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
rb.PushCopyObjects(applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.GetStyleSetChangedEvent(npad_id));
|
.GetStyleSetChangedEvent(parameters.npad_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hid::DisconnectNpad(Kernel::HLERequestContext& ctx) {
|
void Hid::DisconnectNpad(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto npad_id{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 npad_id{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad).DisconnectNpad(npad_id);
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}", npad_id,
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
applet_resource_user_id);
|
.DisconnectNpad(parameters.npad_id);
|
||||||
|
|
||||||
|
LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}", parameters.npad_id,
|
||||||
|
parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -657,13 +743,18 @@ void Hid::GetPlayerLedPattern(Kernel::HLERequestContext& ctx) {
|
||||||
void Hid::ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) {
|
void Hid::ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) {
|
||||||
// Should have no effect with how our npad sets up the data
|
// Should have no effect with how our npad sets up the data
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto unknown{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 unknown{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->ActivateController(HidController::NPad);
|
applet_resource->ActivateController(HidController::NPad);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, unknown={}, applet_resource_user_id={}", unknown,
|
LOG_DEBUG(Service_HID, "called, unknown={}, applet_resource_user_id={}", parameters.unknown,
|
||||||
applet_resource_user_id);
|
parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -672,9 +763,9 @@ void Hid::ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) {
|
||||||
void Hid::SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
|
void Hid::SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||||
const auto hold_type{rp.Pop<u64>()};
|
const auto hold_type{rp.PopEnum<Controller_NPad::NpadHoldType>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetHoldType({hold_type});
|
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetHoldType(hold_type);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, hold_type={}",
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, hold_type={}",
|
||||||
applet_resource_user_id, hold_type);
|
applet_resource_user_id, hold_type);
|
||||||
|
@ -691,19 +782,24 @@ void Hid::GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 4};
|
IPC::ResponseBuilder rb{ctx, 4};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad).GetHoldType()));
|
rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad).GetHoldType());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hid::SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) {
|
void Hid::SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto npad_id{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 npad_id{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SetNpadMode(npad_id, Controller_NPad::NpadAssignments::Single);
|
.SetNpadMode(parameters.npad_id, Controller_NPad::NpadAssignments::Single);
|
||||||
|
|
||||||
LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}", npad_id,
|
LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}",
|
||||||
applet_resource_user_id);
|
parameters.npad_id, parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -712,16 +808,22 @@ void Hid::SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx
|
||||||
void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) {
|
void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) {
|
||||||
// TODO: Check the differences between this and SetNpadJoyAssignmentModeSingleByDefault
|
// TODO: Check the differences between this and SetNpadJoyAssignmentModeSingleByDefault
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto npad_id{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 npad_id{};
|
||||||
const auto npad_joy_device_type{rp.Pop<u64>()};
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
u64 npad_joy_device_type{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SetNpadMode(npad_id, Controller_NPad::NpadAssignments::Single);
|
.SetNpadMode(parameters.npad_id, Controller_NPad::NpadAssignments::Single);
|
||||||
|
|
||||||
LOG_WARNING(Service_HID,
|
LOG_WARNING(Service_HID,
|
||||||
"(STUBBED) called, npad_id={}, applet_resource_user_id={}, npad_joy_device_type={}",
|
"(STUBBED) called, npad_id={}, applet_resource_user_id={}, npad_joy_device_type={}",
|
||||||
npad_id, applet_resource_user_id, npad_joy_device_type);
|
parameters.npad_id, parameters.applet_resource_user_id,
|
||||||
|
parameters.npad_joy_device_type);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -729,14 +831,19 @@ void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) {
|
void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto npad_id{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 npad_id{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SetNpadMode(npad_id, Controller_NPad::NpadAssignments::Dual);
|
.SetNpadMode(parameters.npad_id, Controller_NPad::NpadAssignments::Dual);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}", npad_id,
|
LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}",
|
||||||
applet_resource_user_id);
|
parameters.npad_id, parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -785,13 +892,13 @@ void Hid::StopLrAssignmentMode(Kernel::HLERequestContext& ctx) {
|
||||||
void Hid::SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
|
void Hid::SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||||
const auto mode{rp.Pop<u64>()};
|
const auto activation_mode{rp.PopEnum<Controller_NPad::NpadHandheldActivationMode>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SetNpadHandheldActivationMode({mode});
|
.SetNpadHandheldActivationMode(activation_mode);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, mode={}", applet_resource_user_id,
|
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, activation_mode={}",
|
||||||
mode);
|
applet_resource_user_id, activation_mode);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -818,8 +925,8 @@ void Hid::SwapNpadAssignment(Kernel::HLERequestContext& ctx) {
|
||||||
const bool res = applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
const bool res = applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SwapNpadAssignment(npad_id_1, npad_id_2);
|
.SwapNpadAssignment(npad_id_1, npad_id_2);
|
||||||
|
|
||||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, npad_id_1={}, npad_id_2={}",
|
LOG_DEBUG(Service_HID, "called, npad_id_1={}, npad_id_2={}, applet_resource_user_id={}",
|
||||||
applet_resource_user_id, npad_id_1, npad_id_2);
|
npad_id_1, npad_id_2, applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
if (res) {
|
if (res) {
|
||||||
|
@ -832,32 +939,43 @@ void Hid::SwapNpadAssignment(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext& ctx) {
|
void Hid::IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto npad_id{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
u32 npad_id{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}", npad_id,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id);
|
|
||||||
|
LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}",
|
||||||
|
parameters.npad_id, parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.IsUnintendedHomeButtonInputProtectionEnabled(npad_id));
|
.IsUnintendedHomeButtonInputProtectionEnabled(parameters.npad_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& ctx) {
|
void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto unintended_home_button_input_protection{rp.Pop<bool>()};
|
struct Parameters {
|
||||||
const auto npad_id{rp.Pop<u32>()};
|
bool unintended_home_button_input_protection{};
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
INSERT_PADDING_BYTES(3);
|
||||||
|
u32 npad_id{};
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
applet_resource->GetController<Controller_NPad>(HidController::NPad)
|
||||||
.SetUnintendedHomeButtonInputProtectionEnabled(unintended_home_button_input_protection,
|
.SetUnintendedHomeButtonInputProtectionEnabled(
|
||||||
npad_id);
|
parameters.unintended_home_button_input_protection, parameters.npad_id);
|
||||||
|
|
||||||
LOG_WARNING(Service_HID,
|
LOG_WARNING(Service_HID,
|
||||||
"(STUBBED) called, unintended_home_button_input_protection={}, npad_id={},"
|
"(STUBBED) called, unintended_home_button_input_protection={}, npad_id={},"
|
||||||
"applet_resource_user_id={}",
|
"applet_resource_user_id={}",
|
||||||
unintended_home_button_input_protection, npad_id, applet_resource_user_id);
|
parameters.unintended_home_button_input_protection, parameters.npad_id,
|
||||||
|
parameters.applet_resource_user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -1007,11 +1125,19 @@ void Hid::ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", handle,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id);
|
|
||||||
|
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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
@ -1019,11 +1145,19 @@ void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
const auto handle{rp.Pop<u32>()};
|
struct Parameters {
|
||||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
Controller_NPad::DeviceHandle sixaxis_handle{};
|
||||||
|
INSERT_PADDING_WORDS(1);
|
||||||
|
u64 applet_resource_user_id{};
|
||||||
|
};
|
||||||
|
|
||||||
LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", handle,
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
applet_resource_user_id);
|
|
||||||
|
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);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
|
Loading…
Reference in a new issue