diff options
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 207 |
1 files changed, 163 insertions, 44 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 2ec38c726..268409257 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -306,7 +306,10 @@ private: | |||
| 306 | std::shared_ptr<IAppletResource> applet_resource; | 306 | std::shared_ptr<IAppletResource> applet_resource; |
| 307 | 307 | ||
| 308 | void CreateAppletResource(Kernel::HLERequestContext& ctx) { | 308 | void CreateAppletResource(Kernel::HLERequestContext& ctx) { |
| 309 | LOG_DEBUG(Service_HID, "called"); | 309 | IPC::RequestParser rp{ctx}; |
| 310 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 311 | |||
| 312 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 310 | 313 | ||
| 311 | if (applet_resource == nullptr) { | 314 | if (applet_resource == nullptr) { |
| 312 | applet_resource = std::make_shared<IAppletResource>(); | 315 | applet_resource = std::make_shared<IAppletResource>(); |
| @@ -318,7 +321,12 @@ private: | |||
| 318 | } | 321 | } |
| 319 | 322 | ||
| 320 | void ActivateXpad(Kernel::HLERequestContext& ctx) { | 323 | void ActivateXpad(Kernel::HLERequestContext& ctx) { |
| 321 | LOG_DEBUG(Service_HID, "called"); | 324 | IPC::RequestParser rp{ctx}; |
| 325 | const auto basic_xpad_id{rp.Pop<u32>()}; | ||
| 326 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 327 | |||
| 328 | LOG_DEBUG(Service_HID, "called, basic_xpad_id={}, applet_resource_user_id={}", | ||
| 329 | basic_xpad_id, applet_resource_user_id); | ||
| 322 | 330 | ||
| 323 | applet_resource->ActivateController(HidController::XPad); | 331 | applet_resource->ActivateController(HidController::XPad); |
| 324 | IPC::ResponseBuilder rb{ctx, 2}; | 332 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -326,7 +334,10 @@ private: | |||
| 326 | } | 334 | } |
| 327 | 335 | ||
| 328 | void ActivateDebugPad(Kernel::HLERequestContext& ctx) { | 336 | void ActivateDebugPad(Kernel::HLERequestContext& ctx) { |
| 329 | LOG_DEBUG(Service_HID, "called"); | 337 | IPC::RequestParser rp{ctx}; |
| 338 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 339 | |||
| 340 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 330 | 341 | ||
| 331 | applet_resource->ActivateController(HidController::DebugPad); | 342 | applet_resource->ActivateController(HidController::DebugPad); |
| 332 | IPC::ResponseBuilder rb{ctx, 2}; | 343 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -334,7 +345,10 @@ private: | |||
| 334 | } | 345 | } |
| 335 | 346 | ||
| 336 | void ActivateTouchScreen(Kernel::HLERequestContext& ctx) { | 347 | void ActivateTouchScreen(Kernel::HLERequestContext& ctx) { |
| 337 | LOG_DEBUG(Service_HID, "called"); | 348 | IPC::RequestParser rp{ctx}; |
| 349 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 350 | |||
| 351 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 338 | 352 | ||
| 339 | applet_resource->ActivateController(HidController::Touchscreen); | 353 | applet_resource->ActivateController(HidController::Touchscreen); |
| 340 | IPC::ResponseBuilder rb{ctx, 2}; | 354 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -342,7 +356,10 @@ private: | |||
| 342 | } | 356 | } |
| 343 | 357 | ||
| 344 | void ActivateMouse(Kernel::HLERequestContext& ctx) { | 358 | void ActivateMouse(Kernel::HLERequestContext& ctx) { |
| 345 | LOG_DEBUG(Service_HID, "called"); | 359 | IPC::RequestParser rp{ctx}; |
| 360 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 361 | |||
| 362 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 346 | 363 | ||
| 347 | applet_resource->ActivateController(HidController::Mouse); | 364 | applet_resource->ActivateController(HidController::Mouse); |
| 348 | IPC::ResponseBuilder rb{ctx, 2}; | 365 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -350,7 +367,10 @@ private: | |||
| 350 | } | 367 | } |
| 351 | 368 | ||
| 352 | void ActivateKeyboard(Kernel::HLERequestContext& ctx) { | 369 | void ActivateKeyboard(Kernel::HLERequestContext& ctx) { |
| 353 | LOG_DEBUG(Service_HID, "called"); | 370 | IPC::RequestParser rp{ctx}; |
| 371 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 372 | |||
| 373 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 354 | 374 | ||
| 355 | applet_resource->ActivateController(HidController::Keyboard); | 375 | applet_resource->ActivateController(HidController::Keyboard); |
| 356 | IPC::ResponseBuilder rb{ctx, 2}; | 376 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -358,7 +378,12 @@ private: | |||
| 358 | } | 378 | } |
| 359 | 379 | ||
| 360 | void ActivateGesture(Kernel::HLERequestContext& ctx) { | 380 | void ActivateGesture(Kernel::HLERequestContext& ctx) { |
| 361 | LOG_DEBUG(Service_HID, "called"); | 381 | IPC::RequestParser rp{ctx}; |
| 382 | const auto unknown{rp.Pop<u32>()}; | ||
| 383 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 384 | |||
| 385 | LOG_DEBUG(Service_HID, "called, unknown={}, applet_resource_user_id={}", unknown, | ||
| 386 | applet_resource_user_id); | ||
| 362 | 387 | ||
| 363 | applet_resource->ActivateController(HidController::Gesture); | 388 | applet_resource->ActivateController(HidController::Gesture); |
| 364 | IPC::ResponseBuilder rb{ctx, 2}; | 389 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -367,7 +392,12 @@ private: | |||
| 367 | 392 | ||
| 368 | void ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) { | 393 | void ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) { |
| 369 | // Should have no effect with how our npad sets up the data | 394 | // Should have no effect with how our npad sets up the data |
| 370 | LOG_DEBUG(Service_HID, "called"); | 395 | IPC::RequestParser rp{ctx}; |
| 396 | const auto unknown{rp.Pop<u32>()}; | ||
| 397 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 398 | |||
| 399 | LOG_DEBUG(Service_HID, "called, unknown={}, applet_resource_user_id={}", unknown, | ||
| 400 | applet_resource_user_id); | ||
| 371 | 401 | ||
| 372 | applet_resource->ActivateController(HidController::NPad); | 402 | applet_resource->ActivateController(HidController::NPad); |
| 373 | IPC::ResponseBuilder rb{ctx, 2}; | 403 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -376,22 +406,37 @@ private: | |||
| 376 | 406 | ||
| 377 | void StartSixAxisSensor(Kernel::HLERequestContext& ctx) { | 407 | void StartSixAxisSensor(Kernel::HLERequestContext& ctx) { |
| 378 | IPC::RequestParser rp{ctx}; | 408 | IPC::RequestParser rp{ctx}; |
| 379 | auto handle = rp.PopRaw<u32>(); | 409 | const auto handle{rp.Pop<u32>()}; |
| 380 | LOG_WARNING(Service_HID, "(STUBBED) called with handle={}", handle); | 410 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 411 | |||
| 412 | LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", handle, | ||
| 413 | applet_resource_user_id); | ||
| 381 | 414 | ||
| 382 | IPC::ResponseBuilder rb{ctx, 2}; | 415 | IPC::ResponseBuilder rb{ctx, 2}; |
| 383 | rb.Push(RESULT_SUCCESS); | 416 | rb.Push(RESULT_SUCCESS); |
| 384 | } | 417 | } |
| 385 | 418 | ||
| 386 | void SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { | 419 | void SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { |
| 387 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 420 | IPC::RequestParser rp{ctx}; |
| 421 | const auto handle{rp.Pop<u32>()}; | ||
| 422 | const auto drift_mode{rp.Pop<u32>()}; | ||
| 423 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 424 | |||
| 425 | LOG_WARNING(Service_HID, | ||
| 426 | "(STUBBED) called, handle={}, drift_mode={}, applet_resource_user_id={}", | ||
| 427 | handle, drift_mode, applet_resource_user_id); | ||
| 388 | 428 | ||
| 389 | IPC::ResponseBuilder rb{ctx, 2}; | 429 | IPC::ResponseBuilder rb{ctx, 2}; |
| 390 | rb.Push(RESULT_SUCCESS); | 430 | rb.Push(RESULT_SUCCESS); |
| 391 | } | 431 | } |
| 392 | 432 | ||
| 393 | void IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) { | 433 | void IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) { |
| 394 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 434 | IPC::RequestParser rp{ctx}; |
| 435 | const auto handle{rp.Pop<u32>()}; | ||
| 436 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 437 | |||
| 438 | LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", handle, | ||
| 439 | applet_resource_user_id); | ||
| 395 | 440 | ||
| 396 | IPC::ResponseBuilder rb{ctx, 3}; | 441 | IPC::ResponseBuilder rb{ctx, 3}; |
| 397 | rb.Push(RESULT_SUCCESS); | 442 | rb.Push(RESULT_SUCCESS); |
| @@ -401,8 +446,9 @@ private: | |||
| 401 | 446 | ||
| 402 | void SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { | 447 | void SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { |
| 403 | IPC::RequestParser rp{ctx}; | 448 | IPC::RequestParser rp{ctx}; |
| 404 | auto supported_styleset = rp.PopRaw<u32>(); | 449 | const auto supported_styleset{rp.Pop<u32>()}; |
| 405 | LOG_DEBUG(Service_HID, "called with supported_styleset={}", supported_styleset); | 450 | |
| 451 | LOG_DEBUG(Service_HID, "called, supported_styleset={}", supported_styleset); | ||
| 406 | 452 | ||
| 407 | applet_resource->GetController<Controller_NPad>(HidController::NPad) | 453 | applet_resource->GetController<Controller_NPad>(HidController::NPad) |
| 408 | .SetSupportedStyleSet({supported_styleset}); | 454 | .SetSupportedStyleSet({supported_styleset}); |
| @@ -412,7 +458,10 @@ private: | |||
| 412 | } | 458 | } |
| 413 | 459 | ||
| 414 | void GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { | 460 | void GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { |
| 415 | LOG_DEBUG(Service_HID, "called"); | 461 | IPC::RequestParser rp{ctx}; |
| 462 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 463 | |||
| 464 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 416 | 465 | ||
| 417 | auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); | 466 | auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); |
| 418 | 467 | ||
| @@ -422,7 +471,10 @@ private: | |||
| 422 | } | 471 | } |
| 423 | 472 | ||
| 424 | void SetSupportedNpadIdType(Kernel::HLERequestContext& ctx) { | 473 | void SetSupportedNpadIdType(Kernel::HLERequestContext& ctx) { |
| 425 | LOG_DEBUG(Service_HID, "called"); | 474 | IPC::RequestParser rp{ctx}; |
| 475 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 476 | |||
| 477 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 426 | 478 | ||
| 427 | applet_resource->GetController<Controller_NPad>(HidController::NPad) | 479 | applet_resource->GetController<Controller_NPad>(HidController::NPad) |
| 428 | .SetSupportedNPadIdTypes(ctx.ReadBuffer().data(), ctx.GetReadBufferSize()); | 480 | .SetSupportedNPadIdTypes(ctx.ReadBuffer().data(), ctx.GetReadBufferSize()); |
| @@ -431,7 +483,10 @@ private: | |||
| 431 | } | 483 | } |
| 432 | 484 | ||
| 433 | void ActivateNpad(Kernel::HLERequestContext& ctx) { | 485 | void ActivateNpad(Kernel::HLERequestContext& ctx) { |
| 434 | LOG_DEBUG(Service_HID, "called"); | 486 | IPC::RequestParser rp{ctx}; |
| 487 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 488 | |||
| 489 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 435 | 490 | ||
| 436 | IPC::ResponseBuilder rb{ctx, 2}; | 491 | IPC::ResponseBuilder rb{ctx, 2}; |
| 437 | rb.Push(RESULT_SUCCESS); | 492 | rb.Push(RESULT_SUCCESS); |
| @@ -440,8 +495,12 @@ private: | |||
| 440 | 495 | ||
| 441 | void AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) { | 496 | void AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) { |
| 442 | IPC::RequestParser rp{ctx}; | 497 | IPC::RequestParser rp{ctx}; |
| 443 | auto npad_id = rp.PopRaw<u32>(); | 498 | const auto npad_id{rp.Pop<u32>()}; |
| 444 | LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id); | 499 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 500 | const auto unknown{rp.Pop<u64>()}; | ||
| 501 | |||
| 502 | LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}, unknown={}", | ||
| 503 | npad_id, applet_resource_user_id, unknown); | ||
| 445 | 504 | ||
| 446 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 505 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| 447 | rb.Push(RESULT_SUCCESS); | 506 | rb.Push(RESULT_SUCCESS); |
| @@ -451,8 +510,11 @@ private: | |||
| 451 | 510 | ||
| 452 | void DisconnectNpad(Kernel::HLERequestContext& ctx) { | 511 | void DisconnectNpad(Kernel::HLERequestContext& ctx) { |
| 453 | IPC::RequestParser rp{ctx}; | 512 | IPC::RequestParser rp{ctx}; |
| 454 | auto npad_id = rp.PopRaw<u32>(); | 513 | const auto npad_id{rp.Pop<u32>()}; |
| 455 | LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id); | 514 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 515 | |||
| 516 | LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}", npad_id, | ||
| 517 | applet_resource_user_id); | ||
| 456 | 518 | ||
| 457 | applet_resource->GetController<Controller_NPad>(HidController::NPad) | 519 | applet_resource->GetController<Controller_NPad>(HidController::NPad) |
| 458 | .DisconnectNPad(npad_id); | 520 | .DisconnectNPad(npad_id); |
| @@ -462,8 +524,9 @@ private: | |||
| 462 | 524 | ||
| 463 | void GetPlayerLedPattern(Kernel::HLERequestContext& ctx) { | 525 | void GetPlayerLedPattern(Kernel::HLERequestContext& ctx) { |
| 464 | IPC::RequestParser rp{ctx}; | 526 | IPC::RequestParser rp{ctx}; |
| 465 | auto npad_id = rp.PopRaw<u32>(); | 527 | const auto npad_id{rp.Pop<u32>()}; |
| 466 | LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id); | 528 | |
| 529 | LOG_DEBUG(Service_HID, "called, npad_id={}", npad_id); | ||
| 467 | 530 | ||
| 468 | IPC::ResponseBuilder rb{ctx, 4}; | 531 | IPC::ResponseBuilder rb{ctx, 4}; |
| 469 | rb.Push(RESULT_SUCCESS); | 532 | rb.Push(RESULT_SUCCESS); |
| @@ -474,8 +537,11 @@ private: | |||
| 474 | 537 | ||
| 475 | void SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { | 538 | void SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { |
| 476 | IPC::RequestParser rp{ctx}; | 539 | IPC::RequestParser rp{ctx}; |
| 477 | const auto hold_type = rp.PopRaw<u64>(); | 540 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 478 | LOG_DEBUG(Service_HID, "called with hold_type={}", hold_type); | 541 | const auto hold_type{rp.Pop<u64>()}; |
| 542 | |||
| 543 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, hold_type={}", | ||
| 544 | applet_resource_user_id, hold_type); | ||
| 479 | 545 | ||
| 480 | auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); | 546 | auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); |
| 481 | controller.SetHoldType(Controller_NPad::NpadHoldType{hold_type}); | 547 | controller.SetHoldType(Controller_NPad::NpadHoldType{hold_type}); |
| @@ -485,7 +551,10 @@ private: | |||
| 485 | } | 551 | } |
| 486 | 552 | ||
| 487 | void GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { | 553 | void GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { |
| 488 | LOG_DEBUG(Service_HID, "called"); | 554 | IPC::RequestParser rp{ctx}; |
| 555 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 556 | |||
| 557 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 489 | 558 | ||
| 490 | const auto& controller = | 559 | const auto& controller = |
| 491 | applet_resource->GetController<Controller_NPad>(HidController::NPad); | 560 | applet_resource->GetController<Controller_NPad>(HidController::NPad); |
| @@ -496,15 +565,21 @@ private: | |||
| 496 | 565 | ||
| 497 | void SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) { | 566 | void SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) { |
| 498 | IPC::RequestParser rp{ctx}; | 567 | IPC::RequestParser rp{ctx}; |
| 499 | auto npad_id = rp.PopRaw<u32>(); | 568 | const auto npad_id{rp.Pop<u32>()}; |
| 500 | LOG_WARNING(Service_HID, "(STUBBED) called with npad_id={}", npad_id); | 569 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 570 | |||
| 571 | LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}", | ||
| 572 | npad_id, applet_resource_user_id); | ||
| 501 | 573 | ||
| 502 | IPC::ResponseBuilder rb{ctx, 2}; | 574 | IPC::ResponseBuilder rb{ctx, 2}; |
| 503 | rb.Push(RESULT_SUCCESS); | 575 | rb.Push(RESULT_SUCCESS); |
| 504 | } | 576 | } |
| 505 | 577 | ||
| 506 | void BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) { | 578 | void BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) { |
| 507 | LOG_DEBUG(Service_HID, "called"); | 579 | IPC::RequestParser rp{ctx}; |
| 580 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 581 | |||
| 582 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 508 | 583 | ||
| 509 | applet_resource->GetController<Controller_NPad>(HidController::NPad) | 584 | applet_resource->GetController<Controller_NPad>(HidController::NPad) |
| 510 | .SetVibrationEnabled(true); | 585 | .SetVibrationEnabled(true); |
| @@ -523,9 +598,12 @@ private: | |||
| 523 | 598 | ||
| 524 | void SendVibrationValue(Kernel::HLERequestContext& ctx) { | 599 | void SendVibrationValue(Kernel::HLERequestContext& ctx) { |
| 525 | IPC::RequestParser rp{ctx}; | 600 | IPC::RequestParser rp{ctx}; |
| 526 | const auto controller_id = rp.PopRaw<u32>(); | 601 | const auto controller_id{rp.Pop<u32>()}; |
| 527 | const auto vibration_values = rp.PopRaw<Controller_NPad::Vibration>(); | 602 | const auto vibration_values{rp.PopRaw<Controller_NPad::Vibration>()}; |
| 528 | LOG_DEBUG(Service_HID, "called with controller_id={}", controller_id); | 603 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 604 | |||
| 605 | LOG_DEBUG(Service_HID, "called, controller_id={}, applet_resource_user_id={}", | ||
| 606 | controller_id, applet_resource_user_id); | ||
| 529 | 607 | ||
| 530 | IPC::ResponseBuilder rb{ctx, 2}; | 608 | IPC::ResponseBuilder rb{ctx, 2}; |
| 531 | rb.Push(RESULT_SUCCESS); | 609 | rb.Push(RESULT_SUCCESS); |
| @@ -535,7 +613,10 @@ private: | |||
| 535 | } | 613 | } |
| 536 | 614 | ||
| 537 | void SendVibrationValues(Kernel::HLERequestContext& ctx) { | 615 | void SendVibrationValues(Kernel::HLERequestContext& ctx) { |
| 538 | LOG_DEBUG(Service_HID, "called"); | 616 | IPC::RequestParser rp{ctx}; |
| 617 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 618 | |||
| 619 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | ||
| 539 | 620 | ||
| 540 | const auto controllers = ctx.ReadBuffer(0); | 621 | const auto controllers = ctx.ReadBuffer(0); |
| 541 | const auto vibrations = ctx.ReadBuffer(1); | 622 | const auto vibrations = ctx.ReadBuffer(1); |
| @@ -557,7 +638,12 @@ private: | |||
| 557 | } | 638 | } |
| 558 | 639 | ||
| 559 | void GetActualVibrationValue(Kernel::HLERequestContext& ctx) { | 640 | void GetActualVibrationValue(Kernel::HLERequestContext& ctx) { |
| 560 | LOG_DEBUG(Service_HID, "called"); | 641 | IPC::RequestParser rp{ctx}; |
| 642 | const auto controller_id{rp.Pop<u32>()}; | ||
| 643 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 644 | |||
| 645 | LOG_DEBUG(Service_HID, "called, controller_id={}, applet_resource_user_id={}", | ||
| 646 | controller_id, applet_resource_user_id); | ||
| 561 | 647 | ||
| 562 | IPC::ResponseBuilder rb{ctx, 6}; | 648 | IPC::ResponseBuilder rb{ctx, 6}; |
| 563 | rb.Push(RESULT_SUCCESS); | 649 | rb.Push(RESULT_SUCCESS); |
| @@ -568,8 +654,11 @@ private: | |||
| 568 | 654 | ||
| 569 | void SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) { | 655 | void SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) { |
| 570 | IPC::RequestParser rp{ctx}; | 656 | IPC::RequestParser rp{ctx}; |
| 571 | const auto npad_id = rp.PopRaw<u32>(); | 657 | const auto npad_id{rp.Pop<u32>()}; |
| 572 | LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id); | 658 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 659 | |||
| 660 | LOG_DEBUG(Service_HID, "called, npad_id={}, applet_resource_user_id={}", npad_id, | ||
| 661 | applet_resource_user_id); | ||
| 573 | 662 | ||
| 574 | auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); | 663 | auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); |
| 575 | controller.SetNpadMode(npad_id, Controller_NPad::NPadAssignments::Dual); | 664 | controller.SetNpadMode(npad_id, Controller_NPad::NPadAssignments::Dual); |
| @@ -579,7 +668,14 @@ private: | |||
| 579 | } | 668 | } |
| 580 | 669 | ||
| 581 | void MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) { | 670 | void MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) { |
| 582 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 671 | IPC::RequestParser rp{ctx}; |
| 672 | const auto unknown_1{rp.Pop<u32>()}; | ||
| 673 | const auto unknown_2{rp.Pop<u32>()}; | ||
| 674 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 675 | |||
| 676 | LOG_WARNING(Service_HID, | ||
| 677 | "(STUBBED) called, unknown_1={}, unknown_2={}, applet_resource_user_id={}", | ||
| 678 | unknown_1, unknown_2, applet_resource_user_id); | ||
| 583 | 679 | ||
| 584 | IPC::ResponseBuilder rb{ctx, 2}; | 680 | IPC::ResponseBuilder rb{ctx, 2}; |
| 585 | rb.Push(RESULT_SUCCESS); | 681 | rb.Push(RESULT_SUCCESS); |
| @@ -587,8 +683,11 @@ private: | |||
| 587 | 683 | ||
| 588 | void SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { | 684 | void SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { |
| 589 | IPC::RequestParser rp{ctx}; | 685 | IPC::RequestParser rp{ctx}; |
| 590 | auto mode = rp.PopRaw<u32>(); | 686 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 591 | LOG_WARNING(Service_HID, "(STUBBED) called with mode={}", mode); | 687 | const auto mode{rp.Pop<u64>()}; |
| 688 | |||
| 689 | LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}, mode={}", | ||
| 690 | applet_resource_user_id, mode); | ||
| 592 | 691 | ||
| 593 | IPC::ResponseBuilder rb{ctx, 2}; | 692 | IPC::ResponseBuilder rb{ctx, 2}; |
| 594 | rb.Push(RESULT_SUCCESS); | 693 | rb.Push(RESULT_SUCCESS); |
| @@ -612,35 +711,55 @@ private: | |||
| 612 | } | 711 | } |
| 613 | 712 | ||
| 614 | void ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { | 713 | void ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { |
| 615 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 714 | IPC::RequestParser rp{ctx}; |
| 715 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 716 | |||
| 717 | LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}", | ||
| 718 | applet_resource_user_id); | ||
| 616 | 719 | ||
| 617 | IPC::ResponseBuilder rb{ctx, 2}; | 720 | IPC::ResponseBuilder rb{ctx, 2}; |
| 618 | rb.Push(RESULT_SUCCESS); | 721 | rb.Push(RESULT_SUCCESS); |
| 619 | } | 722 | } |
| 620 | 723 | ||
| 621 | void StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { | 724 | void StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { |
| 622 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 725 | IPC::RequestParser rp{ctx}; |
| 726 | const auto handle{rp.Pop<u32>()}; | ||
| 727 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 728 | |||
| 729 | LOG_WARNING(Service_HID, "(STUBBED) called, handle={}, applet_resource_user_id={}", handle, | ||
| 730 | applet_resource_user_id); | ||
| 623 | 731 | ||
| 624 | IPC::ResponseBuilder rb{ctx, 2}; | 732 | IPC::ResponseBuilder rb{ctx, 2}; |
| 625 | rb.Push(RESULT_SUCCESS); | 733 | rb.Push(RESULT_SUCCESS); |
| 626 | } | 734 | } |
| 627 | 735 | ||
| 628 | void StopSixAxisSensor(Kernel::HLERequestContext& ctx) { | 736 | void StopSixAxisSensor(Kernel::HLERequestContext& ctx) { |
| 629 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 737 | IPC::RequestParser rp{ctx}; |
| 738 | const auto handle{rp.Pop<u32>()}; | ||
| 739 | |||
| 740 | LOG_WARNING(Service_HID, "(STUBBED) called, handle={}", handle); | ||
| 630 | 741 | ||
| 631 | IPC::ResponseBuilder rb{ctx, 2}; | 742 | IPC::ResponseBuilder rb{ctx, 2}; |
| 632 | rb.Push(RESULT_SUCCESS); | 743 | rb.Push(RESULT_SUCCESS); |
| 633 | } | 744 | } |
| 634 | 745 | ||
| 635 | void SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) { | 746 | void SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) { |
| 636 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 747 | IPC::RequestParser rp{ctx}; |
| 748 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 749 | const auto unknown{rp.Pop<u32>()}; | ||
| 750 | |||
| 751 | LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}, unknown={}", | ||
| 752 | applet_resource_user_id, unknown); | ||
| 637 | 753 | ||
| 638 | IPC::ResponseBuilder rb{ctx, 2}; | 754 | IPC::ResponseBuilder rb{ctx, 2}; |
| 639 | rb.Push(RESULT_SUCCESS); | 755 | rb.Push(RESULT_SUCCESS); |
| 640 | } | 756 | } |
| 641 | 757 | ||
| 642 | void SetPalmaBoostMode(Kernel::HLERequestContext& ctx) { | 758 | void SetPalmaBoostMode(Kernel::HLERequestContext& ctx) { |
| 643 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 759 | IPC::RequestParser rp{ctx}; |
| 760 | const auto unknown{rp.Pop<u32>()}; | ||
| 761 | |||
| 762 | LOG_WARNING(Service_HID, "(STUBBED) called, unknown={}", unknown); | ||
| 644 | 763 | ||
| 645 | IPC::ResponseBuilder rb{ctx, 2}; | 764 | IPC::ResponseBuilder rb{ctx, 2}; |
| 646 | rb.Push(RESULT_SUCCESS); | 765 | rb.Push(RESULT_SUCCESS); |