296 Commits

Author SHA1 Message Date
gblues
bf9706395d
Fix gamepad disconnect on unrecognized HID device (#13321)
== DETAILS
So, the reason the gamepad was getting deregistered was
because adapter free code wasn't properly handling null-interface
adapters, causing the gamepad to match erroneously and get
deregistered.

This doesn't fix the weird "Generic SNES USB" detection issue,
but it should make it non-fatal.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-04 12:43:58 +01:00
gblues
1dd15ac516
WIIU: Fix keyboard support (#13308)
== DETAILS
The problem was caused by changing the driver lookup point. The deferred
lookup resulted in the WIIU trying to treat the keyboard as a gamepad which ...
didn't work.

This change short-circuits at the connection event by ignoring mouse &
keyboard connection events.

Tested this with a dev build.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-02 12:43:19 +01:00
twinaphex
619398bbe4 Backport parts of 73c0760236 2021-11-09 23:12:57 +01:00
twinaphex
5ec93d2493 (HID) Fix some warnings 2021-10-20 02:23:01 +02:00
Nathan Strong
81c6d3809a Finish up the OSX DS3 driver
== DETAILS
Put the finishing touches on getting the DS3 to work on Mac OSX.

Basically, there's some differences in the HID interface bewtween
wiiu and osx where OSX expects the first byte of the report to be
the report ID, while wiiu expects that byte to be trimmed off.

I was able to put this behavior in the respective HID
implementations, which eliminated the confusing packet offset
ifdefs.

And, I was able to get the LEDs working again.
2021-10-16 14:52:56 -07:00
Nathan Strong
729c219f1a Rewrite DS3 driver
== DETAILS
The DS3 driver previously only worked with the Wii U HID implementation.

I adapted this driver from the Linux driver for the DS3. It's not quite
100%--I haven't got the LEDs to work properly--but it's functional.

Going to continue tweaking it to see if I can get the LEDs to work.
2021-10-16 14:52:56 -07:00
gblues
dd6c70a083
Fix a couple regressions (#13101)
== DETAILS

- rewrote the HID deregistration algorithm; it should no longer
  cause issues when dealing with multiple pads of the same HID/VID
  combo
- fix initialization bug that caused wiimotes to fail to register
  without an accessory attached
2021-10-11 09:39:13 +02:00
Nathan Strong
ea249b3827 Get the WIIU GCA working on Mac OSX
== DETAILS
The GCA uses a weird HID class that our current filters don't
catch, so we add it.

Needed to do a small amount of tweaking on the GCA driver to
account for iohidmanager weirdness.
2021-10-06 23:11:22 -07:00
Nathan Strong
2715b4c9c0 get gamecube adapter working 2021-10-05 09:23:08 -07:00
Nathan Strong
a4d8ce7753 Try to support multi-pad HID devices
== DETAILS
I tried to modify the joypad connection interface to support
multi-pad HID devices ... it doesn't work. I'm not sure why.
2021-10-05 09:23:08 -07:00
Nathan Strong
5da1cd08ff Unify the HID driver architecture
== DETAILS
When I first implemented the Wii U HID architecture, I ended up
having to design my own implementation because, at the time, I did
not have a way to read the HID device string to allow the existing
code to successfully detect the gamepad.

After spending some time experimenting, I've figured out how to
do this. And that means I can better align the HID driver with other
platforms.

change summary:

- create a single state structure for all three sub-types of wiiu pads
  (kpad, wpad, and hid)
- eliminate confusing duplicate pad lists
- eliminate confusing duplicate HID pad drivers (ds3, gamecube
  adapter, etc)
- ensure the ds3 driver still works
2021-10-05 09:23:08 -07:00
Nathan Strong
9edb449471 wip commit 2021-10-05 09:10:41 -07:00
ComradeEcho
35c2ec993b
Remove code that duplicates controllers 2021-08-07 11:43:50 -05:00
Adie
ce4fce12c0 Implement changes to fix macOS controller duplication bug 2021-08-06 22:02:43 -05:00
twinaphex
f459472f6d Fix leaks - we were not honoring the ownership policy/create rule
for various CoreFoundation functions with 'Copy' or 'Create' in the title
2021-08-07 03:46:08 +02:00
twinaphex
c1ed271a12 (Mac/IOHIDManager) Fix leak of elements_raw and elements in iohidmanager_hid_device_add_device 2021-08-07 03:30:17 +02:00
twinaphex
3607d03ff8 Get rid of warning on older OSX SDK versions 2021-02-09 16:20:40 +01:00
twinaphex
bf806f09ac kIOHIDElementTypeInput_NULL is apparently not available on previous OSX SDK versions 2021-02-09 16:14:20 +01:00
Autechre
e282cfe2fe
(IOHIDManager) Fix enumeration value 'kIOHIDElementTypeInput_NULL' (#11944)
not handled in switch warning
2021-01-26 19:39:36 +01:00
James Montgomerie
f83f706565 Make style of if statment conform to the one already in use in the file/ 2020-09-06 18:36:32 -07:00
James Montgomerie
5c58c6969e Allow controllers with no/empty names to work. 2020-09-06 18:24:32 -07:00
twinaphex
708a029665 (HID) Hardcode 'hid' name for passing to input_autoconfig_connect 2020-08-28 19:01:24 +02:00
twinaphex
5166eebcaf for loop cleanups - use space after 'for' 2020-08-19 03:06:22 +02:00
twinaphex
454338c4f3 (BTStack) Buildfix 2020-08-15 17:14:27 +02:00
twinaphex
501165af0b (BTStack) Buildfix attempt two 2020-08-15 02:26:43 +02:00
twinaphex
bf85a658ba (BTStack) Attempt build fix 2020-08-14 23:46:31 +02:00
twinaphex
ed3ee2511f Cleanups - add local variable 2020-07-29 05:31:23 +02:00
rsn8887
78c9dbbd20 Fix input port assignments 2020-07-28 16:35:16 -05:00
twinaphex
d2c3a6d71e (Wiiu) Buildfix 2020-07-24 04:40:39 +02:00
twinaphex
2efb1600a8 (BTStack) Cleanup 2020-07-20 01:32:45 +02:00
twinaphex
005a9c005e (IOHIDManager) Cleanup 2020-07-20 01:30:42 +02:00
twinaphex
174675ee71 (Wii) Buildfix 2020-07-20 00:57:16 +02:00
twinaphex
18dcda09d0 (IOHIDManager) Another buildfix 2020-07-19 03:39:32 +02:00
twinaphex
b8f9e38b7e (IOHIDManager) Buildfix 2020-07-19 03:38:07 +02:00
twinaphex
de73e3bff9 Buildfixes 2020-07-19 03:25:30 +02:00
twinaphex
285b0ec0bb Buildfix 2020-07-19 03:20:41 +02:00
twinaphex
d97e590aaf Reimplement multi button state functions 2020-07-19 03:18:12 +02:00
twinaphex
cb5b22b6ac (Android) Refactor axis functions 2020-07-18 22:38:23 +02:00
twinaphex
08ad00f5d3 Start preparing for being able to grab multiple buttons at the same time 2020-07-18 19:51:14 +02:00
twinaphex
8b078662cd Change function signature of joypad driver's 'button' 2020-07-18 18:07:57 +02:00
twinaphex
0a1942f528 Turn fifo_read_avail and fifo_write_avail into macros 2020-07-07 08:13:32 +02:00
twinaphex
1ae20ea17c Style nits - turn macro names into upper-case - some while style nits 2020-06-26 20:00:19 +02:00
Ash Logan
41541128c5 (WiiU/hid) Warning fixes 2020-05-17 16:42:31 +10:00
A Schain
1e751d00ea
In case last hatswitch does not match cookie
For the mayflash N64 adapter, I was getting a BAD EXC ADDRESS (in mac OS 10.13) for this line (tmp was NULL). Retroarch would crash in the gui if I pressed a button from the DPAD on controller 2. With this change, it no longer crashes in the gui and still registers the button push.
2020-04-30 13:27:44 -04:00
twinaphex
74cd84399f Cleanups - Replace '== NULL' 2020-01-30 16:47:33 +01:00
twinaphex
a034909ae9 Cleanups 2020-01-30 16:35:59 +01:00
twinaphex
1d2150cb45 Remove drivers_hid/null_hid.c 2020-01-06 15:52:35 +01:00
revvv
22669edfed update coding style for PR 2019-08-11 21:08:16 +02:00
revvv
976e4672b4 add Retrode support 2019-08-11 20:13:38 +02:00
twinaphex
0257e01bee Refactor input_autoconfigure_connect - don't return
value - set input device name upon failure implicitly
2019-07-16 15:28:22 +02:00