108 Commits

Author SHA1 Message Date
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
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
005a9c005e (IOHIDManager) Cleanup 2020-07-20 01:30:42 +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
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
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
a034909ae9 Cleanups 2020-01-30 16:35:59 +01: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
twinaphex
6d17d11132 Rewrite '== false' to '!' for our own code 2019-06-06 13:50:39 +02:00
Twinaphex
077a5dd685 (OSX) CXX_BUILD buildfix 2019-04-22 10:33:30 +02:00
orbea
28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
orbea
bfc366decc Squeeze extra blank lines with cat(1).
Example:

find . -type f -iname '*.c' | while read -r i; do
  cat -s "$i" > "$i.new"
  mv "$i.new" "$i"
done
2019-01-08 11:04:58 -08:00
twinaphex
dac4034954 Add PPC ifdefs; kIOHIDUniqueKey is not available on OSX 10.5 2018-08-30 15:56:02 +02:00
greso
2c9fda1798 (macOS) Fix input issues
For my Xbox One Controller the min input for the hat is 1 and not 0. 0
points to the default state that is called after each button press.

On top of that the two axis for the trigger buttons were ignored. I
added some additional axis that are not present on my controller but
will probably help for other input devices.
2018-08-07 19:51:50 +02:00
Twinaphex
fd11b205da Silence bunch of warnings 2018-06-21 07:52:01 +02:00
ceb33
bafd2af885 remove custom debug output 2018-05-05 13:33:15 +02:00
ceb33
67784c85cf update and merge to current Retroarch version 2018-05-05 12:59:04 +02:00
ceb33
9008684651 re-add callback to manage usb device plugged in while retroarch is running 2018-05-05 12:48:01 +02:00
Twinaphex
de1bf58997 Buildfix 2018-05-03 20:39:03 +02:00
twinaphex
3796e52018 (OSX) Go back to old code - connect handler was broken 2018-05-03 20:31:28 +02:00
twinaphex
a82bb0ec94 Create special type input_bits_t 2018-04-08 20:21:12 +02:00
twinaphex
94254e4c79 (IOHIDManager) Cleanups 2018-03-30 11:49:25 +02:00
ceb33
c6d6fc7098 fix memory leak 2018-03-30 11:00:38 +02:00
ceb33
82e2cc7c73 set hid device registration deterministic (sorting by ascending location_id), this solve the issue where game with same vid and pid where sometime swapped by the OS 2018-03-30 10:43:54 +02:00
Olivier PARRA
8bff69eae8 1.[IOS9]Remove HID entry from menu as IOKIT is not available 2.[OSX]Add robustness and determinism to HID buttons detection code (add controller buttons in a sorted list) 2018-01-25 02:20:52 +01:00
twinaphex
3fc2ddb8d2 (IOHIDManager) Add improvements - https://github.com/libretro/RetroArch/issues/4816#issuecomment-359145035 2018-01-22 06:48:56 +01:00
gblues
0ae7ffe0d3 Clean up dumb compile warnings, fix crash bug
== DETAILS

- the free() method of the hid_driver_t interface needs its
  parameter defined as const in order for the compiler to stop
  complaining about losing const-ness.
- if a joypad list is created with <MAX_USERS slots in it, the
  destroy() function will crash because it assumes there are MAX_USERS
  entries.

  To do this, the allocate function creates n+1 slots, and gives the
  last slot a canary value that the destroy() method can then watch for
  when iterating through the list.
2017-12-30 04:43:27 +01:00
gblues
982d6893b0 Set the send_control pointer on the drivers
== DETAIL

One minor detail missed in the last commit: actually putting the
send_control function into the driver declaration. Woops.

Not doing the Wii U because it will be using the other methods.
2017-12-30 04:41:07 +01:00
gblues
5b37ced196 Update HID pad driver architecture
== DETAILS

The current HID implementation assumes a very low-level USB library
is being used. This causes a problem on Wii U, because the Cafe OS
only exposes a high-level interface.

To get these functions exposed to the HID pad drivers, I had to make
three changes:

1. I added the legacy "send_control" function to the HID driver
   interface
2. I modified the signature of pad_connection_pad_init() to send the
   driver pointer instead of the function pointer
3. I updated the HID pad drivers to keep the pointer to the driver
   instead of the function pointer, and updated the calls into the
   send_control function as appropriate
4. I updated the HID drivers to use the new pad init signature

== TESTING
Untested, in theory it should work without a hitch because at this
point all I've done is abstract things a little. I still need to
update the HID pad drivers to use the Wii U-specific calls as
appropriate.
2017-12-30 04:41:01 +01:00
Twinaphex
c7c71cb01f Fix Apple build 2017-12-27 22:36:10 +01:00
Twinaphex
b1c0fe7d0d Fix CXX_BUILD for Apple 2017-12-27 22:33:32 +01:00
twinaphex
f0c143766e Change to 256bit macros 2017-12-05 12:07:35 +01:00
twinaphex
e94300a581 Get rid of a lot of RARCH_INPUT_STATE_BIT_ macros - replace them
with BIT128_ equivalents instead
2017-12-05 09:22:56 +01:00
Brad Parker
44b70efb68 style nits 2017-11-29 10:42:39 -05:00
David Walters
f09477d46a additional compile fixes 2017-11-28 10:36:16 +00:00