gblues
5c5e5be649
More progress on the HID driver
...
== DETAILS
I think I've about got the thread startup/teardown code worked
out. Logically, anyway, if not accurately.
The challenge has been figuring out how best to integrate the
features of HID2VPAD.
I found `input/connect/joypad_connection.c` and this seems like
the logical place for:
- Special-case driver for the Switch Pro controller
- Any other special cases HIDTOVPAD supports that core RetroArch
doesn't
- Parsing of HIDTOVPAD config file to add custom button mapping
== TESTING
Compiles. Haven't tested with a real Wii U. Probably doesn't work
though. I very likely have the threading bit wrong.
2017-12-30 04:40:01 +01:00
gblues
c3736adb77
Start implementing HID polling thread
...
== DETAILS
Looking at the other HID USB drivers, it looks like the typical
implementation is to start up a background thread to do the
polling, rather than wait for RA to invoke the poll() method.
This commit sets up the skeleton of the background thread:
- The thread gets created in init()
- The thread gets stopped in free()
Right now the body of the thread is a 10ms sleep.
== TESTING
It compiles cleanly, and links. Don't know if it actually works.
2017-12-30 04:39:56 +01:00
gblues
203876a206
More progress on the HID driver
...
== DETAILS
I think I've about got the thread startup/teardown code worked
out. Logically, anyway, if not accurately.
The challenge has been figuring out how best to integrate the
features of HID2VPAD.
I found `input/connect/joypad_connection.c` and this seems like
the logical place for:
- Special-case driver for the Switch Pro controller
- Any other special cases HIDTOVPAD supports that core RetroArch
doesn't
- Parsing of HIDTOVPAD config file to add custom button mapping
== TESTING
Compiles. Haven't tested with a real Wii U. Probably doesn't work
though. I very likely have the threading bit wrong.
2017-12-30 04:39:44 +01:00
gblues
1657079c45
Start implementing HID polling thread
...
== DETAILS
Looking at the other HID USB drivers, it looks like the typical
implementation is to start up a background thread to do the
polling, rather than wait for RA to invoke the poll() method.
This commit sets up the skeleton of the background thread:
- The thread gets created in init()
- The thread gets stopped in free()
Right now the body of the thread is a 10ms sleep.
== TESTING
It compiles cleanly, and links. Don't know if it actually works.
2017-12-30 04:39:39 +01:00
gblues
7e56881b88
Some cleanups
2017-12-30 04:39:34 +01:00
gblues
3b92cce6bf
Start wiring up the HID driver
...
- add alloc/free for necessary objects
- register callback with Wii U OS
Don't think I've put the unregister bit in, so this is very likely
broken.
2017-12-30 04:39:25 +01:00
Nathan Strong
e80d99dbae
Delete controller_patcher; start on proper HID driver
...
== DETAILS
We discovered that the controller_patcher code was causing
the WiiU to intermittently crash when switching ROMs.
Changes:
- Completely extricates the controller_patcher code
- Create a skeleton wiiu_hid driver
- Wire up the build system to build/link it successfully
== TESTING
Has not been tested. Probably doesn't crash, since the
skeleton driver is just a copy of the null driver.
2017-12-30 04:38:57 +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
gblues
6904101c44
Clean up trailing whitespace
...
== DETAILS
Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08: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
David Walters
a9451822b5
Improved handling of libusb hotplug capability ( #5830 )
...
* Improved handling of libusb hotplug capability
* Only deregister hotplug callback if registration happened.
2017-11-30 10:30:46 -05:00
David Walters
05578f0634
Show VID/PID values for unsupported devices. ( #5825 )
2017-11-29 15:56:18 -05:00
Brad Parker
5453853001
remove extra paren
2017-11-29 11:32:32 -05:00
Brad Parker
f41187df22
remove extra brace
2017-11-29 11:17:13 -05:00
Brad Parker
44b70efb68
style nits
2017-11-29 10:42:39 -05:00
Brad Parker
42e81dcef4
add back missing code from c5bdc02
2017-11-29 10:35:52 -05:00
Brad Parker
aa1f95b3d5
undo changes in c5bdc02
that reverted my previous commits: 34491a6
28c6237
1f58d9c
61bd9d7
2017-11-29 10:22:30 -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
Brad Parker
61bd9d7d70
libusb: early return if we fail to get a config descriptor, otherwise the memory returned is invalid (and should not be freed either)
2017-11-27 11:30:29 -05:00
Brad Parker
1f58d9cd1f
comment
2017-11-27 11:30:29 -05:00
Brad Parker
28c6237b47
FreeBSD: support libusb hid input driver
2017-11-27 11:30:29 -05:00
Brad Parker
34491a6025
libusb: prevent crash on driver deinit when there are no pad connections
2017-11-27 11:30:29 -05:00
Rob Loach
fa75f47995
Fix includes of input_config
2017-08-30 23:14:27 -04:00
Rob Loach
40f4d805a8
Fix non-existent include of input_config.h
2017-08-30 23:01:12 -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
twinaphex
126a5bf121
Use string_is_equal_fast/string_is_not_equal_fast
2017-05-16 04:00:37 +02:00
Twinaphex
aa2e7dc794
Silence warning
2017-02-26 03:53:05 +01: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
66f189dff6
(wiiusb_hid.c) Prevent crashes
2016-12-26 00:38:54 +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
021559a877
Get rid of runloop.h dependencies inside input/ dir
2016-12-02 06:07:45 +01:00
twinaphex
70557fdee6
(Wii) Buildfix
2016-12-02 00:24:54 +01:00
Twinaphex
0d79bc754c
(OSX) Buildfix
2016-12-01 22:51:46 +01:00
Brad Parker
23dd41a3cc
missing ../
2016-12-01 15:40:31 -05: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
7dcf9dfa75
(libusb) Silence warning 'value stored to 'adaptor' is never read
2016-09-22 21:49:59 +02: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
467451fccc
Cleanup more header includes
2016-09-01 18:18:55 +02:00
twinaphex
eea287d156
(BTStack HID) Create HAVE_DYNAMIC ifdefs
2016-06-27 01:11:49 +02:00
twinaphex
d8b3597455
menu_cbs_deferred_push.c - Fix 'array compared against 0'
2016-06-02 20:51:27 +02:00
twinaphex
a98616b45b
Fix explicit NULL dereferenced/dereference before null check warnings
2016-05-26 17:47:21 +02:00
twinaphex
40023833e0
(IOHIDManager) Plug another potential leak
2016-05-25 02:35:13 +02:00
Twinaphex
c1e82d3f1a
(IOHidManager) Fix adapter leak
2016-05-24 14:01:46 +02:00
twinaphex
4e74a990d4
(IOHIDManager) Free some resource leaks
2016-05-24 13:48:02 +02:00
twinaphex
0f21ab247c
header cleanup
2016-04-17 07:37:00 +02:00
twinaphex
ef4a1a3c0f
(libretro-common) Rename fifo_buffer to fifo_queue
2016-03-20 14:06:21 +01:00
twinaphex
d3aaa7ac88
Style nits
2016-02-05 14:42:20 +01:00
twinaphex
341e8f8f15
Cleanup
2016-02-05 14:35:16 +01:00
netux79
bca4ccb155
(GX) Refactor of the Wii USB HID support. Now it's working!
...
In order to have a controller working you need:
1) Have a matching HID autoconfig file in autoconfig/hid for your controller.
2) Create a "connect" driver for the pad in "input/connect" folder (source code of RA).
3) Once you are in RA, change the joystick driver to HID and restart.
4) You may be now able to use you USB HID compatible pad in RA.
I included some "connect" drivers as an example. It also need to include them for compilation.
2016-02-04 17:01:03 -05:00
twinaphex
347a18cb30
Update input headers
2016-01-10 04:33:01 +01:00
twinaphex
697351ee67
(input) Use string_is_empty
2015-12-26 07:54:17 +01:00
twinaphex
2f29d9f18c
Take out menu/menu_driver.h include from driver.h
2015-12-05 13:22:50 +01:00
twinaphex
d15ad86705
Create hid_driver_get_data
2015-11-29 21:11:57 +01:00
twinaphex
a3c34a7813
Cleanups
2015-11-28 02:31:19 +01:00
twinaphex
074f14b132
Add verbosity.c/verbosity.h
2015-11-23 12:03:38 +01:00
Twinaphex
bcaa2f9aa7
(BTStack) Another buildfix
2015-11-18 02:12:05 +01:00
twinaphex
80d44ce333
(btstack_hid.c) Buildfixes
2015-11-18 02:11:06 +01:00
twinaphex
5edcb99b35
(btstack_hid.c) Cleanups
2015-11-18 02:06:03 +01:00
twinaphex
37d45643f9
(BTStack) Move btpad_set_inquery_state calls to btstack_hid.c
2015-11-18 01:57:45 +01:00
twinaphex
aa208993d5
btstack_hid.h - remove
2015-11-17 06:37:33 +01:00
twinaphex
de9be22071
(btstack_hid.c) Add RUN_LOOP_POSIX else conditional
2015-11-16 06:53:29 +01:00
twinaphex
170b4bbbe2
(btstack_hid.c) Add Cocoa ifdef
2015-11-16 06:52:26 +01:00
Twinaphex
e88fff9985
(iohidmanager_hid.c) Fix header dependencies
2015-11-16 06:49:40 +01:00
Twinaphex
5dee9838c4
(iohidmanager_hid.c) remove Cocoa dependencies
2015-11-16 06:48:02 +01:00
twinaphex
08bb85e509
(OSX) apple->buttons refactored away
2015-11-16 06:46:29 +01:00
twinaphex
018db7c081
(IOHIDManager) buildfix
2015-11-16 06:40:07 +01:00
twinaphex
2fa91ba26c
(IOHIDManager) Make axes code independent from CocoaTouch
2015-11-16 06:32:25 +01:00
twinaphex
7b7869eb4c
(btstack_hid.c) Cleanup
2015-11-16 04:14:48 +01:00
twinaphex
595646fea4
(btstack_hid.c) Move variables to top
2015-11-16 04:00:59 +01:00
Twinaphex
83b38cd5c1
Remove mfi_hid.h too
2015-11-16 03:56:08 +01:00
twinaphex
f1ba8d62d7
remove mfi_hid.m
2015-11-16 03:52:44 +01:00
Twinaphex
db35a28e50
Revert "Refactor slots to be a part of input_hid_driver.c now"
...
This reverts commit 646ded9d1c
.
2015-11-16 03:48:51 +01:00
Twinaphex
f089fff42f
Revert "Fix warnings"
...
This reverts commit 8d67d5175e
.
2015-11-16 03:48:44 +01:00
twinaphex
8d67d5175e
Fix warnings
2015-11-16 03:40:57 +01:00
twinaphex
646ded9d1c
Refactor slots to be a part of input_hid_driver.c now
2015-11-16 03:39:40 +01:00
Twinaphex
57e8cfe1f9
Totally reimplemented MFi support
2015-11-16 02:39:38 +01:00
Twinaphex
bbb80a8ffa
(BTStack HID) Should read axes too from apple struct
2015-11-15 23:45:03 +01:00
Arche-san
b9a0793444
os x hid : reorder axis (keep compatibility with others platforms)
2015-11-15 13:11:40 +01:00
Arche-san
c47254e64b
os x : add right stick support for xbox 360 gamepad (and others hid gamepad with 6 axes instead of 4)
2015-11-14 18:04:07 +01:00
Twinaphex
9bd302b4ec
(iohidmanager) Buildfix
2015-10-02 18:24:33 +02:00
twinaphex
87d44af218
Static code analysis cleanups
2015-09-29 18:08:33 +02:00
twinaphex
e986b9e42a
Static code analysis cleanups
2015-09-29 17:35:28 +02:00
twinaphex
a79b571d7b
Static code analysis fixes
2015-09-28 16:20:26 +02:00
twinaphex
61a40be54d
Remove USB_Initialize/USB_Deinitialize from wiiusb_hid.c
2015-09-24 00:09:59 +02:00
Twinaphex
6c6a293388
(MFi) Build fixes
2015-09-16 03:40:16 +02:00
twinaphex
346f44a7da
(MFI) Start adding own button state
2015-09-16 03:29:38 +02:00
twinaphex
54ad123b06
Simplify apple_gamecontroller_available
2015-09-16 02:50:22 +02:00
twinaphex
e654c5cb65
Header cleanups
2015-09-05 20:53:56 +02:00
twinaphex
bc6692e567
(wiiusb_hid.c) Remove goto error
2015-09-01 18:53:35 +02:00
twinaphex
d5d498df5f
(wiiusb_hid.c) Remove problematic line
2015-09-01 18:44:25 +02:00
twinaphex
cd781ff4b5
Cleanups
2015-08-30 15:15:39 +02:00
twinaphex
202ffaee3b
(wiiusb_hid.c) Don't call remove_adapter from remove_notify
2015-08-30 12:44:29 +02:00
twinaphex
f95049e99c
Add wiiusb_hid driver courtesy of @xerpi
2015-08-30 09:48:38 +02:00
twinaphex
24a94490ab
Remove some header includes
2015-08-30 09:36:50 +02:00
twinaphex
1489839384
(OSX) Add HAVE_COCOA and HAVE_COCOATOUCH ifdefs to iohidmanager_hid.c
2015-08-01 05:19:44 +02:00
slotek
7431529e89
Restore generic Mac OS X joypad functionality
2015-07-29 10:12:31 -06:00
twinaphex
01415528c6
(libusb) Update
2015-07-12 01:08:53 +02:00
twinaphex
1c406bc098
Add rarch_main_data_pending_scan_finished and other mechanisms
...
so that the call to menu_environment_cb gets made on main thread
2015-07-09 02:31:46 +02:00
twinaphex
12ca517cf7
(libusb) Cleanups
2015-07-09 01:51:44 +02:00
twinaphex
4109768a9a
(libusb_hid.c) Use retro_log.h
2015-06-30 14:48:57 +02:00
twinaphex
80142af594
(libusb) Another API not C89-compliantl
2015-06-29 23:19:02 +02:00
twinaphex
46c99bd225
(libusb_hid.c) Buildfixes for CXX_BUILD
2015-06-26 13:16:47 +02:00
twinaphex
6988f1bb76
(libusb_hid.c) Define LIBUSB_CAP_HAS_HOTPLUG in case it's not there
2015-06-26 13:06:48 +02:00
twinaphex
b679f75f91
(iohidmanager_hid.c) Cleanups
2015-06-25 18:27:28 +02:00
Twinaphex
227c986143
More CXX_BUILD fixes
2015-06-25 17:40:09 +02:00
twinaphex
0e2345227a
Some CXX_BUILD fixes
2015-06-25 17:25:09 +02:00
twinaphex
123b85dbb0
Change returntype of pad_connection_init
2015-06-13 01:40:55 +02:00
twinaphex
1a5e16ff99
Create input_config_autoconfigure_disconnect
2015-06-03 18:55:04 +02:00
twinaphex
87d9834d06
Move dylib.c to libretro-common
2015-05-08 09:49:49 +02:00
twinaphex
f02ef849ae
(HID) Fixup
2015-05-06 04:10:49 +02:00
twinaphex
f57132ff6f
Protect against failed pad init
2015-05-06 04:03:00 +02:00
Twinaphex
1fb00bdac3
Add HAVE_IOHIDMANAGER to qb/config.libs.sh
2015-04-20 12:04:31 +02:00
Twinaphex
f506e722b1
(Apple) Rename apple_hid to iohidmanager_hid
2015-04-20 11:52:10 +02:00
twinaphex
8702141d90
(Cocoa) Start renaming input_apple to input_cocoa
2015-04-19 17:58:15 +02:00
Lioncash
fff8ef3db7
libusb_hid: Fix a potential memory leak
2015-04-15 03:22:27 -04:00
twinaphex
0057510caf
(libusb) Add disconnect message, change "Joypad" terminology to
...
'Device'
2015-04-14 05:36:43 +02:00
Toad King
7f229e57ab
add hotplugging to libusb hid driver
2015-04-13 19:19:10 -05:00
twinaphex
6c5489e9c8
Rename get_ios_version_major
2015-04-13 18:20:05 +02:00
Twinaphex
2c53d57e9e
(iOS) Refactor get_ios_version_major
2015-04-13 18:17:48 +02:00
twinaphex
19260898eb
Replace dynamic.h header dependencies to dylib.h header dependencies
2015-04-11 10:38:10 +02:00
Twinaphex
ab87700597
(MFI) Forgot to commit MFi HID files
2015-04-09 17:26:42 +02:00
twinaphex
ea7815bf32
(libusb) Cleanups
2015-04-07 18:24:16 +02:00
Toad King
9eb2dab4d4
fix crash in libusb_hid
2015-04-06 23:05:39 -05:00
Toad King
730be95302
stop threads before destroying pad_connections
2015-04-06 22:24:01 -05:00
Toad King
5701f4f73a
libusb updates, still need to figure out config issue preventing keys being registered
2015-04-06 22:07:59 -05:00
twinaphex
a670f3466c
(libusb) libusb changes
2015-04-06 04:53:05 +02:00
Twinaphex
24cc0b5e4d
(iOS) Move files around for MFi gamepad code
2015-04-05 15:41:41 +02:00
twinaphex
5bffebd203
(libusb_hid.c) Preliminary implementation of adapter_thread
2015-04-04 17:30:50 +02:00
twinaphex
a6056819cf
(libusb_hid.c) Move pad_connection_init up in 'init' function
2015-04-04 16:32:06 +02:00