81 Commits

Author SHA1 Message Date
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
David Walters
c5bdc02d6f replace uint64_t with retro_bits_t* for pad buttons state 2017-11-28 10:04:34 +00:00
Rob Loach
fa75f47995
Fix includes of input_config 2017-08-30 23:14:27 -04:00
twinaphex
612cb54cfe Merge input_hid_driver 2017-06-11 08:56:36 +02:00
twinaphex
c711749973 (iohidmanager_hid.c) Cleanups 2017-06-07 21:14:34 +02:00
neville
fc2654cd0f (iohidmanager_hid.c) Silence a whole bunch of warnings 2017-01-29 20:20:43 +01:00
twinaphex
1b3225089e iohidmanager.c - Attempt to silence some warnings 2017-01-29 20:11:32 +01:00
twinaphex
96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex
0354ced675 Style nits 2017-01-17 19:02:49 +01:00
twinaphex
e3e8796b2b (iohidmanager_hid.c) Stylistic cleanups 2017-01-15 21:13:01 +01:00
Twinaphex
1544a3d6e1 (OSX) Fix warnings 2017-01-15 21:07:15 +01:00
John Regan
4f352227ea OSX Joypad Improvements
This commit has two main changes to the OSX HID driver:

1.

Some joysticks have invalid/incorrect 'use' assigned to buttons and
axes. For example, my RetroUSB.com Genesis Retroport reports 8 buttons,
but they're reported as 1, 2, 3, 4, 1, 2, 3, 4, and my RetroLink
Gamecube-clone controller reports 2 axes with id 50.

OSX assigns each of these elements a unique cookie value, so it's still
possible to uniquely identify a button. Whenever a controller is
connected, the driver scans for all buttons and axes. When it identifies
a duplicate 'use' id, it reassigns it a new ID.

Whenever the input callback is called, it grabs the cookie value,
finds the input element with a matching cookie, and uses that element's
id instead of the one reported by the device.

The old joystick configs should not be broken by this - I'm using the
existing 'use' value wherever possible, and only changing it when it's
broken.

The 'faked' ids are done in a deterministic way, a joystick will never
have a button's 'faked' id change between launches of RetroArch.

2.

This enables HAT switch input.
2017-01-15 12:17:47 -06:00
twinaphex
ea3dd6a95b Set device name when autoconfig connect task fails for all
other input drivers too
2017-01-13 05:00:13 +01:00
twinaphex
103042de96 Rewrite task_autodetect.c 2016-12-31 07:43:34 +01:00
twinaphex
aafae944cb Don't memset autoconfig_params_t 2016-12-17 14:26:13 +01:00
Twinaphex
db1f3c058a (iohidmanager_hid.c) No longer need to include configuration.h now 2016-12-16 12:36:01 +01:00
twinaphex
d9def056e7 The 'connect' task now sets the device name upon completion 2016-12-16 12:33:56 +01:00
twinaphex
62f5b2d3c3 The disconnect task now clears the device name 2016-12-16 12:20:31 +01:00
Dave Leaver
cd5a5c5fd7 iohidmanager_hid: Remove name from adapters when they are disconnected 2016-12-16 20:17:24 +13:00
twinaphex
e9f853ba93 Move (joykey == NO_BTN ) to input_joypad_driver 2016-12-11 08:44:55 +01:00
Twinaphex
0d79bc754c (OSX) Buildfix 2016-12-01 22:51:46 +01:00
twinaphex
d3c22cb0e4 Move input/input_autodetect.c to tasks/task_autodetect.c 2016-12-01 20:38:20 +01:00
twinaphex
76d0380e45 Rename input_autoconfigure_joypad to input_autoconfigure_connect 2016-12-01 18:57:44 +01:00
twinaphex
e689d55414 Rename autoconfig functions 2016-12-01 18:52:34 +01:00
twinaphex
dad26e0956 Header cleanup 2016-11-05 14:10:30 +01:00
twinaphex
9ee5931c5e Nits 2016-09-14 23:37:20 +02:00
twinaphex
4571dc33fc header include cleanups 2016-09-05 17:29:19 +02:00
twinaphex
40023833e0 (IOHIDManager) Plug another potential leak 2016-05-25 02:35:13 +02:00