diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-09-02 18:18:41 +0200 |
---|---|---|
committer | german <german@thesoftwareartisans.com> | 2020-09-05 04:48:13 +0200 |
commit | df3cbd4758bed28d2bc33f7ba63485a3221e6070 (patch) | |
tree | 7607175f01ca4fba8b3e26833779e42924e24ec2 /src/core/hle/service | |
parent | Include HID and configuration changes related to motion (diff) | |
download | yuzu-df3cbd4758bed28d2bc33f7ba63485a3221e6070.tar yuzu-df3cbd4758bed28d2bc33f7ba63485a3221e6070.tar.gz yuzu-df3cbd4758bed28d2bc33f7ba63485a3221e6070.tar.bz2 yuzu-df3cbd4758bed28d2bc33f7ba63485a3221e6070.tar.lz yuzu-df3cbd4758bed28d2bc33f7ba63485a3221e6070.tar.xz yuzu-df3cbd4758bed28d2bc33f7ba63485a3221e6070.tar.zst yuzu-df3cbd4758bed28d2bc33f7ba63485a3221e6070.zip |
Diffstat (limited to 'src/core/hle/service')
-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* libnx_entry.connection_status.IsLeftJoyConnected.Assign(1); libnx_entry.connection_status.IsRightJoyConnected.Assign(1); - if (sixaxis_sensors_enabled) { - if (motions[i][0] && motions[i][1]) { - // set both - dual_left_sixaxis_entry.accel = motion_devices[0].accel; - dual_left_sixaxis_entry.gyro = motion_devices[0].gyro; - dual_left_sixaxis_entry.rotation = motion_devices[0].rotation; - dual_left_sixaxis_entry.orientation = motion_devices[0].orientation; - dual_right_sixaxis_entry.accel = motion_devices[1].accel; - dual_right_sixaxis_entry.gyro = motion_devices[1].gyro; - dual_right_sixaxis_entry.rotation = motion_devices[1].rotation; - dual_right_sixaxis_entry.orientation = motion_devices[1].orientation; - } else if (motions[i][0]) { - // set right - dual_right_sixaxis_entry.accel = motion_devices[0].accel; - dual_right_sixaxis_entry.gyro = motion_devices[0].gyro; - dual_right_sixaxis_entry.rotation = motion_devices[0].rotation; - dual_right_sixaxis_entry.orientation = motion_devices[0].orientation; - } else if (motions[i][1]) { - // set right - dual_right_sixaxis_entry.accel = motion_devices[1].accel; - dual_right_sixaxis_entry.gyro = motion_devices[1].gyro; - dual_right_sixaxis_entry.rotation = motion_devices[1].rotation; - dual_right_sixaxis_entry.orientation = motion_devices[1].orientation; - } + if (sixaxis_sensors_enabled && motions[i][0]) { + // Set motion for the left joycon + dual_left_sixaxis_entry.accel = motion_devices[0].accel; + dual_left_sixaxis_entry.gyro = motion_devices[0].gyro; + dual_left_sixaxis_entry.rotation = motion_devices[0].rotation; + dual_left_sixaxis_entry.orientation = motion_devices[0].orientation; + } + if (sixaxis_sensors_enabled && motions[i][1]) { + // Set motion for the right joycon + dual_right_sixaxis_entry.accel = motion_devices[1].accel; + dual_right_sixaxis_entry.gyro = motion_devices[1].gyro; + dual_right_sixaxis_entry.rotation = motion_devices[1].rotation; + dual_right_sixaxis_entry.orientation = motion_devices[1].orientation; } break; case NPadControllerType::JoyLeft: @@ -543,11 +532,11 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* libnx_entry.connection_status.IsRightJoyConnected.Assign(1); - if (sixaxis_sensors_enabled && motions[i][0]) { - right_sixaxis_entry.accel = motion_devices[0].accel; - right_sixaxis_entry.gyro = motion_devices[0].gyro; - right_sixaxis_entry.rotation = motion_devices[0].rotation; - right_sixaxis_entry.orientation = motion_devices[0].orientation; + if (sixaxis_sensors_enabled && motions[i][1]) { + right_sixaxis_entry.accel = motion_devices[1].accel; + right_sixaxis_entry.gyro = motion_devices[1].gyro; + right_sixaxis_entry.rotation = motion_devices[1].rotation; + right_sixaxis_entry.orientation = motion_devices[1].orientation; } break; case NPadControllerType::Pokeball: |