diff options
| -rw-r--r-- | src/core/hle/service/hid/hidbus.cpp | 26 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hidbus.h | 4 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/core/hle/service/hid/hidbus.cpp b/src/core/hle/service/hid/hidbus.cpp index bd94e8f3d..8dbb2cf50 100644 --- a/src/core/hle/service/hid/hidbus.cpp +++ b/src/core/hle/service/hid/hidbus.cpp | |||
| @@ -91,7 +91,7 @@ std::optional<std::size_t> HidBus::GetDeviceIndexFromHandle(BusHandle handle) co | |||
| 91 | if (handle.abstracted_pad_id == device_handle.abstracted_pad_id && | 91 | if (handle.abstracted_pad_id == device_handle.abstracted_pad_id && |
| 92 | handle.internal_index == device_handle.internal_index && | 92 | handle.internal_index == device_handle.internal_index && |
| 93 | handle.player_number == device_handle.player_number && | 93 | handle.player_number == device_handle.player_number && |
| 94 | handle.bus_type == device_handle.bus_type && | 94 | handle.bus_type_id == device_handle.bus_type_id && |
| 95 | handle.is_valid == device_handle.is_valid) { | 95 | handle.is_valid == device_handle.is_valid) { |
| 96 | return i; | 96 | return i; |
| 97 | } | 97 | } |
| @@ -123,7 +123,7 @@ void HidBus::GetBusHandle(Kernel::HLERequestContext& ctx) { | |||
| 123 | continue; | 123 | continue; |
| 124 | } | 124 | } |
| 125 | if (static_cast<Core::HID::NpadIdType>(handle.player_number) == parameters.npad_id && | 125 | if (static_cast<Core::HID::NpadIdType>(handle.player_number) == parameters.npad_id && |
| 126 | handle.bus_type == parameters.bus_type) { | 126 | handle.bus_type_id == static_cast<u8>(parameters.bus_type)) { |
| 127 | is_handle_found = true; | 127 | is_handle_found = true; |
| 128 | handle_index = i; | 128 | handle_index = i; |
| 129 | break; | 129 | break; |
| @@ -140,7 +140,7 @@ void HidBus::GetBusHandle(Kernel::HLERequestContext& ctx) { | |||
| 140 | .abstracted_pad_id = static_cast<u8>(i), | 140 | .abstracted_pad_id = static_cast<u8>(i), |
| 141 | .internal_index = static_cast<u8>(i), | 141 | .internal_index = static_cast<u8>(i), |
| 142 | .player_number = static_cast<u8>(parameters.npad_id), | 142 | .player_number = static_cast<u8>(parameters.npad_id), |
| 143 | .bus_type = parameters.bus_type, | 143 | .bus_type_id = static_cast<u8>(parameters.bus_type), |
| 144 | .is_valid = true, | 144 | .is_valid = true, |
| 145 | }; | 145 | }; |
| 146 | handle_index = i; | 146 | handle_index = i; |
| @@ -172,7 +172,7 @@ void HidBus::IsExternalDeviceConnected(Kernel::HLERequestContext& ctx) { | |||
| 172 | LOG_INFO(Service_HID, | 172 | LOG_INFO(Service_HID, |
| 173 | "Called, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 173 | "Called, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 174 | "player_number={}, is_valid={}", | 174 | "player_number={}, is_valid={}", |
| 175 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 175 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 176 | bus_handle_.player_number, bus_handle_.is_valid); | 176 | bus_handle_.player_number, bus_handle_.is_valid); |
| 177 | 177 | ||
| 178 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 178 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -201,7 +201,7 @@ void HidBus::Initialize(Kernel::HLERequestContext& ctx) { | |||
| 201 | LOG_INFO(Service_HID, | 201 | LOG_INFO(Service_HID, |
| 202 | "called, abstracted_pad_id={} bus_type={} internal_index={} " | 202 | "called, abstracted_pad_id={} bus_type={} internal_index={} " |
| 203 | "player_number={} is_valid={}, applet_resource_user_id={}", | 203 | "player_number={} is_valid={}, applet_resource_user_id={}", |
| 204 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 204 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 205 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); | 205 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); |
| 206 | 206 | ||
| 207 | is_hidbus_enabled = true; | 207 | is_hidbus_enabled = true; |
| @@ -253,7 +253,7 @@ void HidBus::Finalize(Kernel::HLERequestContext& ctx) { | |||
| 253 | LOG_INFO(Service_HID, | 253 | LOG_INFO(Service_HID, |
| 254 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 254 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 255 | "player_number={}, is_valid={}, applet_resource_user_id={}", | 255 | "player_number={}, is_valid={}, applet_resource_user_id={}", |
| 256 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 256 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 257 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); | 257 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); |
| 258 | 258 | ||
| 259 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 259 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -301,7 +301,7 @@ void HidBus::EnableExternalDevice(Kernel::HLERequestContext& ctx) { | |||
| 301 | "called, enable={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 301 | "called, enable={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 302 | "player_number={}, is_valid={}, inval={}, applet_resource_user_id{}", | 302 | "player_number={}, is_valid={}, inval={}, applet_resource_user_id{}", |
| 303 | parameters.enable, parameters.bus_handle.abstracted_pad_id, | 303 | parameters.enable, parameters.bus_handle.abstracted_pad_id, |
| 304 | parameters.bus_handle.bus_type, parameters.bus_handle.internal_index, | 304 | parameters.bus_handle.bus_type_id, parameters.bus_handle.internal_index, |
| 305 | parameters.bus_handle.player_number, parameters.bus_handle.is_valid, parameters.inval, | 305 | parameters.bus_handle.player_number, parameters.bus_handle.is_valid, parameters.inval, |
| 306 | parameters.applet_resource_user_id); | 306 | parameters.applet_resource_user_id); |
| 307 | 307 | ||
| @@ -329,7 +329,7 @@ void HidBus::GetExternalDeviceId(Kernel::HLERequestContext& ctx) { | |||
| 329 | LOG_DEBUG(Service_HID, | 329 | LOG_DEBUG(Service_HID, |
| 330 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 330 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 331 | "is_valid={}", | 331 | "is_valid={}", |
| 332 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 332 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 333 | bus_handle_.player_number, bus_handle_.is_valid); | 333 | bus_handle_.player_number, bus_handle_.is_valid); |
| 334 | 334 | ||
| 335 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 335 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -357,7 +357,7 @@ void HidBus::SendCommandAsync(Kernel::HLERequestContext& ctx) { | |||
| 357 | LOG_DEBUG(Service_HID, | 357 | LOG_DEBUG(Service_HID, |
| 358 | "called, data_size={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 358 | "called, data_size={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 359 | "player_number={}, is_valid={}", | 359 | "player_number={}, is_valid={}", |
| 360 | data.size(), bus_handle_.abstracted_pad_id, bus_handle_.bus_type, | 360 | data.size(), bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, |
| 361 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); | 361 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); |
| 362 | 362 | ||
| 363 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 363 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -384,7 +384,7 @@ void HidBus::GetSendCommandAsynceResult(Kernel::HLERequestContext& ctx) { | |||
| 384 | LOG_DEBUG(Service_HID, | 384 | LOG_DEBUG(Service_HID, |
| 385 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 385 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 386 | "is_valid={}", | 386 | "is_valid={}", |
| 387 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 387 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 388 | bus_handle_.player_number, bus_handle_.is_valid); | 388 | bus_handle_.player_number, bus_handle_.is_valid); |
| 389 | 389 | ||
| 390 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 390 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -413,7 +413,7 @@ void HidBus::SetEventForSendCommandAsycResult(Kernel::HLERequestContext& ctx) { | |||
| 413 | LOG_INFO(Service_HID, | 413 | LOG_INFO(Service_HID, |
| 414 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 414 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 415 | "is_valid={}", | 415 | "is_valid={}", |
| 416 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 416 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 417 | bus_handle_.player_number, bus_handle_.is_valid); | 417 | bus_handle_.player_number, bus_handle_.is_valid); |
| 418 | 418 | ||
| 419 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 419 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -464,7 +464,7 @@ void HidBus::EnableJoyPollingReceiveMode(Kernel::HLERequestContext& ctx) { | |||
| 464 | LOG_INFO(Service_HID, | 464 | LOG_INFO(Service_HID, |
| 465 | "called, t_mem_handle=0x{:08X}, polling_mode={}, abstracted_pad_id={}, bus_type={}, " | 465 | "called, t_mem_handle=0x{:08X}, polling_mode={}, abstracted_pad_id={}, bus_type={}, " |
| 466 | "internal_index={}, player_number={}, is_valid={}", | 466 | "internal_index={}, player_number={}, is_valid={}", |
| 467 | t_mem_handle, polling_mode_, bus_handle_.abstracted_pad_id, bus_handle_.bus_type, | 467 | t_mem_handle, polling_mode_, bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, |
| 468 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); | 468 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); |
| 469 | 469 | ||
| 470 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 470 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -492,7 +492,7 @@ void HidBus::DisableJoyPollingReceiveMode(Kernel::HLERequestContext& ctx) { | |||
| 492 | LOG_INFO(Service_HID, | 492 | LOG_INFO(Service_HID, |
| 493 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 493 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 494 | "is_valid={}", | 494 | "is_valid={}", |
| 495 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 495 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 496 | bus_handle_.player_number, bus_handle_.is_valid); | 496 | bus_handle_.player_number, bus_handle_.is_valid); |
| 497 | 497 | ||
| 498 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 498 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
diff --git a/src/core/hle/service/hid/hidbus.h b/src/core/hle/service/hid/hidbus.h index 8c687f678..91c99b01f 100644 --- a/src/core/hle/service/hid/hidbus.h +++ b/src/core/hle/service/hid/hidbus.h | |||
| @@ -41,7 +41,7 @@ private: | |||
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | // This is nn::hidbus::BusType | 43 | // This is nn::hidbus::BusType |
| 44 | enum class BusType : u8 { | 44 | enum class BusType : u32 { |
| 45 | LeftJoyRail, | 45 | LeftJoyRail, |
| 46 | RightJoyRail, | 46 | RightJoyRail, |
| 47 | InternalBus, // Lark microphone | 47 | InternalBus, // Lark microphone |
| @@ -54,7 +54,7 @@ private: | |||
| 54 | u32 abstracted_pad_id; | 54 | u32 abstracted_pad_id; |
| 55 | u8 internal_index; | 55 | u8 internal_index; |
| 56 | u8 player_number; | 56 | u8 player_number; |
| 57 | BusType bus_type; | 57 | u8 bus_type_id; |
| 58 | bool is_valid; | 58 | bool is_valid; |
| 59 | }; | 59 | }; |
| 60 | static_assert(sizeof(BusHandle) == 0x8, "BusHandle is an invalid size"); | 60 | static_assert(sizeof(BusHandle) == 0x8, "BusHandle is an invalid size"); |