diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index acf748bf1..9701318b5 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -490,30 +490,19 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* | |||
| 490 | libnx_entry.connection_status.IsLeftJoyConnected.Assign(1); | 490 | libnx_entry.connection_status.IsLeftJoyConnected.Assign(1); |
| 491 | libnx_entry.connection_status.IsRightJoyConnected.Assign(1); | 491 | libnx_entry.connection_status.IsRightJoyConnected.Assign(1); |
| 492 | 492 | ||
| 493 | if (sixaxis_sensors_enabled) { | 493 | if (sixaxis_sensors_enabled && motions[i][0]) { |
| 494 | if (motions[i][0] && motions[i][1]) { | 494 | // Set motion for the left joycon |
| 495 | // set both | 495 | dual_left_sixaxis_entry.accel = motion_devices[0].accel; |
| 496 | dual_left_sixaxis_entry.accel = motion_devices[0].accel; | 496 | dual_left_sixaxis_entry.gyro = motion_devices[0].gyro; |
| 497 | dual_left_sixaxis_entry.gyro = motion_devices[0].gyro; | 497 | dual_left_sixaxis_entry.rotation = motion_devices[0].rotation; |
| 498 | dual_left_sixaxis_entry.rotation = motion_devices[0].rotation; | 498 | dual_left_sixaxis_entry.orientation = motion_devices[0].orientation; |
| 499 | dual_left_sixaxis_entry.orientation = motion_devices[0].orientation; | 499 | } |
| 500 | dual_right_sixaxis_entry.accel = motion_devices[1].accel; | 500 | if (sixaxis_sensors_enabled && motions[i][1]) { |
| 501 | dual_right_sixaxis_entry.gyro = motion_devices[1].gyro; | 501 | // Set motion for the right joycon |
| 502 | dual_right_sixaxis_entry.rotation = motion_devices[1].rotation; | 502 | dual_right_sixaxis_entry.accel = motion_devices[1].accel; |
| 503 | dual_right_sixaxis_entry.orientation = motion_devices[1].orientation; | 503 | dual_right_sixaxis_entry.gyro = motion_devices[1].gyro; |
| 504 | } else if (motions[i][0]) { | 504 | dual_right_sixaxis_entry.rotation = motion_devices[1].rotation; |
| 505 | // set right | 505 | dual_right_sixaxis_entry.orientation = motion_devices[1].orientation; |
| 506 | dual_right_sixaxis_entry.accel = motion_devices[0].accel; | ||
| 507 | dual_right_sixaxis_entry.gyro = motion_devices[0].gyro; | ||
| 508 | dual_right_sixaxis_entry.rotation = motion_devices[0].rotation; | ||
| 509 | dual_right_sixaxis_entry.orientation = motion_devices[0].orientation; | ||
| 510 | } else if (motions[i][1]) { | ||
| 511 | // set right | ||
| 512 | dual_right_sixaxis_entry.accel = motion_devices[1].accel; | ||
| 513 | dual_right_sixaxis_entry.gyro = motion_devices[1].gyro; | ||
| 514 | dual_right_sixaxis_entry.rotation = motion_devices[1].rotation; | ||
| 515 | dual_right_sixaxis_entry.orientation = motion_devices[1].orientation; | ||
| 516 | } | ||
| 517 | } | 506 | } |
| 518 | break; | 507 | break; |
| 519 | case NPadControllerType::JoyLeft: | 508 | case NPadControllerType::JoyLeft: |
| @@ -543,11 +532,11 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* | |||
| 543 | 532 | ||
| 544 | libnx_entry.connection_status.IsRightJoyConnected.Assign(1); | 533 | libnx_entry.connection_status.IsRightJoyConnected.Assign(1); |
| 545 | 534 | ||
| 546 | if (sixaxis_sensors_enabled && motions[i][0]) { | 535 | if (sixaxis_sensors_enabled && motions[i][1]) { |
| 547 | right_sixaxis_entry.accel = motion_devices[0].accel; | 536 | right_sixaxis_entry.accel = motion_devices[1].accel; |
| 548 | right_sixaxis_entry.gyro = motion_devices[0].gyro; | 537 | right_sixaxis_entry.gyro = motion_devices[1].gyro; |
| 549 | right_sixaxis_entry.rotation = motion_devices[0].rotation; | 538 | right_sixaxis_entry.rotation = motion_devices[1].rotation; |
| 550 | right_sixaxis_entry.orientation = motion_devices[0].orientation; | 539 | right_sixaxis_entry.orientation = motion_devices[1].orientation; |
| 551 | } | 540 | } |
| 552 | break; | 541 | break; |
| 553 | case NPadControllerType::Pokeball: | 542 | case NPadControllerType::Pokeball: |