diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 1e04ee3f2..c08b0a5dc 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -56,7 +56,7 @@ bool Controller_NPad::IsDeviceHandleValid(const Core::HID::VibrationDeviceHandle return npad_id && npad_type && device_index; } -ResultCode Controller_NPad::VerifyValidSixAxisSensorHandle( +Result Controller_NPad::VerifyValidSixAxisSensorHandle( const Core::HID::SixAxisSensorHandle& device_handle) { const auto npad_id = IsNpadIdValid(static_cast<Core::HID::NpadIdType>(device_handle.npad_id)); if (!npad_id) { @@ -160,7 +160,7 @@ void Controller_NPad::InitNewlyAddedController(Core::HID::NpadIdType npad_id) { shared_memory->system_properties.raw = 0; switch (controller_type) { case Core::HID::NpadStyleIndex::None: - UNREACHABLE(); + ASSERT(false); break; case Core::HID::NpadStyleIndex::ProController: shared_memory->style_tag.fullkey.Assign(1); @@ -422,7 +422,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing) { libnx_state.connection_status.is_connected.Assign(1); switch (controller_type) { case Core::HID::NpadStyleIndex::None: - UNREACHABLE(); + ASSERT(false); break; case Core::HID::NpadStyleIndex::ProController: case Core::HID::NpadStyleIndex::NES: @@ -597,7 +597,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing switch (controller_type) { case Core::HID::NpadStyleIndex::None: - UNREACHABLE(); + ASSERT(false); break; case Core::HID::NpadStyleIndex::ProController: case Core::HID::NpadStyleIndex::Pokeball: @@ -720,9 +720,9 @@ Controller_NPad::NpadCommunicationMode Controller_NPad::GetNpadCommunicationMode return communication_mode; } -ResultCode Controller_NPad::SetNpadMode(Core::HID::NpadIdType npad_id, - NpadJoyDeviceType npad_device_type, - NpadJoyAssignmentMode assignment_mode) { +Result Controller_NPad::SetNpadMode(Core::HID::NpadIdType npad_id, + NpadJoyDeviceType npad_device_type, + NpadJoyAssignmentMode assignment_mode) { if (!IsNpadIdValid(npad_id)) { LOG_ERROR(Service_HID, "Invalid NpadIdType npad_id:{}", npad_id); return InvalidNpadId; @@ -856,7 +856,7 @@ void Controller_NPad::VibrateController( } if (vibration_device_handle.device_index == Core::HID::DeviceIndex::None) { - UNREACHABLE_MSG("DeviceIndex should never be None!"); + ASSERT_MSG(false, "DeviceIndex should never be None!"); return; } @@ -984,7 +984,7 @@ void Controller_NPad::UpdateControllerAt(Core::HID::NpadStyleIndex type, InitNewlyAddedController(npad_id); } -ResultCode Controller_NPad::DisconnectNpad(Core::HID::NpadIdType npad_id) { +Result Controller_NPad::DisconnectNpad(Core::HID::NpadIdType npad_id) { if (!IsNpadIdValid(npad_id)) { LOG_ERROR(Service_HID, "Invalid NpadIdType npad_id:{}", npad_id); return InvalidNpadId; @@ -1032,7 +1032,7 @@ ResultCode Controller_NPad::DisconnectNpad(Core::HID::NpadIdType npad_id) { WriteEmptyEntry(shared_memory); return ResultSuccess; } -ResultCode Controller_NPad::SetGyroscopeZeroDriftMode( +Result Controller_NPad::SetGyroscopeZeroDriftMode( const Core::HID::SixAxisSensorHandle& sixaxis_handle, GyroscopeZeroDriftMode drift_mode) { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { @@ -1046,7 +1046,7 @@ ResultCode Controller_NPad::SetGyroscopeZeroDriftMode( return ResultSuccess; } -ResultCode Controller_NPad::GetGyroscopeZeroDriftMode( +Result Controller_NPad::GetGyroscopeZeroDriftMode( const Core::HID::SixAxisSensorHandle& sixaxis_handle, GyroscopeZeroDriftMode& drift_mode) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); @@ -1061,8 +1061,8 @@ ResultCode Controller_NPad::GetGyroscopeZeroDriftMode( return ResultSuccess; } -ResultCode Controller_NPad::IsSixAxisSensorAtRest( - const Core::HID::SixAxisSensorHandle& sixaxis_handle, bool& is_at_rest) const { +Result Controller_NPad::IsSixAxisSensorAtRest(const Core::HID::SixAxisSensorHandle& sixaxis_handle, + bool& is_at_rest) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { LOG_ERROR(Service_HID, "Invalid handle, error_code={}", is_valid.raw); @@ -1074,7 +1074,7 @@ ResultCode Controller_NPad::IsSixAxisSensorAtRest( return ResultSuccess; } -ResultCode Controller_NPad::IsFirmwareUpdateAvailableForSixAxisSensor( +Result Controller_NPad::IsFirmwareUpdateAvailableForSixAxisSensor( const Core::HID::SixAxisSensorHandle& sixaxis_handle, bool& is_firmware_available) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { @@ -1087,7 +1087,7 @@ ResultCode Controller_NPad::IsFirmwareUpdateAvailableForSixAxisSensor( return ResultSuccess; } -ResultCode Controller_NPad::EnableSixAxisSensorUnalteredPassthrough( +Result Controller_NPad::EnableSixAxisSensorUnalteredPassthrough( const Core::HID::SixAxisSensorHandle& sixaxis_handle, bool is_enabled) { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { @@ -1100,7 +1100,7 @@ ResultCode Controller_NPad::EnableSixAxisSensorUnalteredPassthrough( return ResultSuccess; } -ResultCode Controller_NPad::IsSixAxisSensorUnalteredPassthroughEnabled( +Result Controller_NPad::IsSixAxisSensorUnalteredPassthroughEnabled( const Core::HID::SixAxisSensorHandle& sixaxis_handle, bool& is_enabled) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { @@ -1113,7 +1113,7 @@ ResultCode Controller_NPad::IsSixAxisSensorUnalteredPassthroughEnabled( return ResultSuccess; } -ResultCode Controller_NPad::LoadSixAxisSensorCalibrationParameter( +Result Controller_NPad::LoadSixAxisSensorCalibrationParameter( const Core::HID::SixAxisSensorHandle& sixaxis_handle, Core::HID::SixAxisSensorCalibrationParameter& calibration) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); @@ -1128,7 +1128,7 @@ ResultCode Controller_NPad::LoadSixAxisSensorCalibrationParameter( return ResultSuccess; } -ResultCode Controller_NPad::GetSixAxisSensorIcInformation( +Result Controller_NPad::GetSixAxisSensorIcInformation( const Core::HID::SixAxisSensorHandle& sixaxis_handle, Core::HID::SixAxisSensorIcInformation& ic_information) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); @@ -1143,7 +1143,7 @@ ResultCode Controller_NPad::GetSixAxisSensorIcInformation( return ResultSuccess; } -ResultCode Controller_NPad::ResetIsSixAxisSensorDeviceNewlyAssigned( +Result Controller_NPad::ResetIsSixAxisSensorDeviceNewlyAssigned( const Core::HID::SixAxisSensorHandle& sixaxis_handle) { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { @@ -1157,8 +1157,8 @@ ResultCode Controller_NPad::ResetIsSixAxisSensorDeviceNewlyAssigned( return ResultSuccess; } -ResultCode Controller_NPad::SetSixAxisEnabled(const Core::HID::SixAxisSensorHandle& sixaxis_handle, - bool sixaxis_status) { +Result Controller_NPad::SetSixAxisEnabled(const Core::HID::SixAxisSensorHandle& sixaxis_handle, + bool sixaxis_status) { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { LOG_ERROR(Service_HID, "Invalid handle, error_code={}", is_valid.raw); @@ -1170,7 +1170,7 @@ ResultCode Controller_NPad::SetSixAxisEnabled(const Core::HID::SixAxisSensorHand return ResultSuccess; } -ResultCode Controller_NPad::IsSixAxisSensorFusionEnabled( +Result Controller_NPad::IsSixAxisSensorFusionEnabled( const Core::HID::SixAxisSensorHandle& sixaxis_handle, bool& is_fusion_enabled) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { @@ -1183,7 +1183,7 @@ ResultCode Controller_NPad::IsSixAxisSensorFusionEnabled( return ResultSuccess; } -ResultCode Controller_NPad::SetSixAxisFusionEnabled( +Result Controller_NPad::SetSixAxisFusionEnabled( const Core::HID::SixAxisSensorHandle& sixaxis_handle, bool is_fusion_enabled) { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { @@ -1197,7 +1197,7 @@ ResultCode Controller_NPad::SetSixAxisFusionEnabled( return ResultSuccess; } -ResultCode Controller_NPad::SetSixAxisFusionParameters( +Result Controller_NPad::SetSixAxisFusionParameters( const Core::HID::SixAxisSensorHandle& sixaxis_handle, Core::HID::SixAxisSensorFusionParameters sixaxis_fusion_parameters) { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); @@ -1217,7 +1217,7 @@ ResultCode Controller_NPad::SetSixAxisFusionParameters( return ResultSuccess; } -ResultCode Controller_NPad::GetSixAxisFusionParameters( +Result Controller_NPad::GetSixAxisFusionParameters( const Core::HID::SixAxisSensorHandle& sixaxis_handle, Core::HID::SixAxisSensorFusionParameters& parameters) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); @@ -1232,8 +1232,8 @@ ResultCode Controller_NPad::GetSixAxisFusionParameters( return ResultSuccess; } -ResultCode Controller_NPad::MergeSingleJoyAsDualJoy(Core::HID::NpadIdType npad_id_1, - Core::HID::NpadIdType npad_id_2) { +Result Controller_NPad::MergeSingleJoyAsDualJoy(Core::HID::NpadIdType npad_id_1, + Core::HID::NpadIdType npad_id_2) { if (!IsNpadIdValid(npad_id_1) || !IsNpadIdValid(npad_id_2)) { LOG_ERROR(Service_HID, "Invalid NpadIdType npad_id_1:{}, npad_id_2:{}", npad_id_1, npad_id_2); @@ -1304,8 +1304,8 @@ void Controller_NPad::StopLRAssignmentMode() { is_in_lr_assignment_mode = false; } -ResultCode Controller_NPad::SwapNpadAssignment(Core::HID::NpadIdType npad_id_1, - Core::HID::NpadIdType npad_id_2) { +Result Controller_NPad::SwapNpadAssignment(Core::HID::NpadIdType npad_id_1, + Core::HID::NpadIdType npad_id_2) { if (!IsNpadIdValid(npad_id_1) || !IsNpadIdValid(npad_id_2)) { LOG_ERROR(Service_HID, "Invalid NpadIdType npad_id_1:{}, npad_id_2:{}", npad_id_1, npad_id_2); @@ -1336,8 +1336,8 @@ ResultCode Controller_NPad::SwapNpadAssignment(Core::HID::NpadIdType npad_id_1, return ResultSuccess; } -ResultCode Controller_NPad::GetLedPattern(Core::HID::NpadIdType npad_id, - Core::HID::LedPattern& pattern) const { +Result Controller_NPad::GetLedPattern(Core::HID::NpadIdType npad_id, + Core::HID::LedPattern& pattern) const { if (!IsNpadIdValid(npad_id)) { LOG_ERROR(Service_HID, "Invalid NpadIdType npad_id:{}", npad_id); return InvalidNpadId; @@ -1347,8 +1347,8 @@ ResultCode Controller_NPad::GetLedPattern(Core::HID::NpadIdType npad_id, return ResultSuccess; } -ResultCode Controller_NPad::IsUnintendedHomeButtonInputProtectionEnabled( - Core::HID::NpadIdType npad_id, bool& is_valid) const { +Result Controller_NPad::IsUnintendedHomeButtonInputProtectionEnabled(Core::HID::NpadIdType npad_id, + bool& is_valid) const { if (!IsNpadIdValid(npad_id)) { LOG_ERROR(Service_HID, "Invalid NpadIdType npad_id:{}", npad_id); return InvalidNpadId; @@ -1358,7 +1358,7 @@ ResultCode Controller_NPad::IsUnintendedHomeButtonInputProtectionEnabled( return ResultSuccess; } -ResultCode Controller_NPad::SetUnintendedHomeButtonInputProtectionEnabled( +Result Controller_NPad::SetUnintendedHomeButtonInputProtectionEnabled( bool is_protection_enabled, Core::HID::NpadIdType npad_id) { if (!IsNpadIdValid(npad_id)) { LOG_ERROR(Service_HID, "Invalid NpadIdType npad_id:{}", npad_id); |