3094 Commits

Author SHA1 Message Date
gblues
192f5875b9 Simplify, add logging, revert some of the changes
== DETAILS
The old code was crashing; I did a minimalized branch and the crash
went away, so I'm bringing that over here. Meaning I'll have to
redo some of the other work I'd put in, but oh well.

(now watch it start crashing again)

== TESTING
Can confirm it builds. Wii U is busy ATM so I can't test.
2017-12-30 04:40:23 +01:00
gblues
1beba28d02 Only call HIDSetup/HidTeardown once
== DETAILS
I did a minimalist edit of the HID thread that stripped out all
HID* syscalls, and this stopped the crashing. I then re-added just
the HIDSetup() and HIDTeardown() calls, and the crash came back.

This smells like an OS bug. To work around it, I've put the
HIDSetup() and HIDTeardown() calls into the app init/shutdown
section, so they only get called once in the application lifetime
and not each time the input driver is initialized.
2017-12-30 04:40:15 +01:00
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
d49b7b28b6 input_poll - cleanup 2017-12-29 23:12:35 +01:00
twinaphex
a6afddae04 current_input_data and current_input are no longer globals 2017-12-29 23:03:25 +01:00
twinaphex
5c876647ed (NSW) Small cleanups 2017-12-29 00:45:00 +01:00
misson20000
6d2a7b1f26 Nintendo Switch (libtransistor) port 2017-12-29 00:10: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
radius
2cab3a7e4e fix some nits 2017-12-27 15:43:03 -05:00
radius
c3e6ac96aa only reinit when HID devices are attached 2017-12-27 15:34:18 -05:00
Twinaphex
d64154bf40
Merge pull request #5965 from fr500/master
avoid dinput reinitialization on unrelated WM_DEVICECHANGE events
2017-12-27 05:55:38 +01:00
bparker06
2dcd2bc5c6
Fix relative path 2017-12-26 22:02:11 -05:00
radius
ab54fda509 avoid dinput reinitialization on unrelated WM_DEVICECHANGE events 2017-12-26 20:17:26 -05:00
radius
7d9193555a fix menu toggle with keymapper active 2017-12-26 01:20:36 -05:00
Brad Parker
6d484b7724 xinput: check for valid function pointers before calling them 2017-12-23 23:02:29 -05:00
twinaphex
95e807749d Simplification/cleanup 2017-12-18 07:09:44 +01:00
twinaphex
422ce9396c Cleanup - input_key_pressed 2017-12-18 06:14:48 +01:00
twinaphex
69f85556a3 Get rid of meta_key_pressed 2017-12-18 05:59:57 +01:00
twinaphex
7b210ccf37 Don't call meta key pressed if not bound 2017-12-18 05:49:17 +01:00
twinaphex
1978689dcb Rewrite input_keys_pressed_iterate 2017-12-18 05:22:45 +01:00
twinaphex
9b9cf7b036 Cleanups 2017-12-18 05:13:57 +01:00
twinaphex
3c5d2f047c Create input_keys_pressed_iterate 2017-12-18 05:09:16 +01:00
Twinaphex
26f483b22d
Merge pull request #5882 from hiddenasbestos/dolphinbar
Mayflash DolphinBar
2017-12-17 16:48:26 +01:00
David Walters
02f6301607 fix reversed logic 2017-12-17 12:46:21 +00:00
David Walters
adffa5fc4c Fixes for overlay buttons 2017-12-17 12:36:18 +00:00
Brad Parker
8c0adf3594 move path_file_rename and path_file_remove into VFS 2017-12-14 13:32:26 -05:00
gblues
0f7de204f7 Last batch of whitespace cleanup (post-rebase)
-- looks like a few files committed with DOS line endings
2017-12-12 00:24:46 -08: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
c950613098 C comments 2017-12-11 11:28:48 +01:00
Peter Y. Hammond
b14598657c Fixed a bug where the joypad devices were not always being assigned in the same order as they were numbered under /dev/input/. This showed up mainly when using an external USB Bluetooth dongle. In that case, controllers would be assigned often in reverse order. 2017-12-10 22:22:01 -07:00
Monroe88
cfde6a44db input_driver: Map Delete key to Y button for non-unified menu keyboard controls 2017-12-09 14:17:54 -06:00
Fabio
0d58d9ca0d
Added label to wii controllers, inverted the right stick Y axis of classic controller
The right stick Y axis of classic controller was wrong
2017-12-09 08:24:19 +01:00
David Walters
124ddcd27a Add dolphin bar VID/PID - treat like a wii over bluetooth connection 2017-12-07 23:44:29 +00:00
twinaphex
de9b0127f8 (MSVC) Buildfix 2017-12-06 04:33:54 +01:00
Andrés
0c9fce98a2 fix vid/pid enumeration on xinput controllers when the xinput controllers are interleaved with dinput (#5872) 2017-12-05 22:07:48 -05:00
Twinaphex
d881931254
Merge pull request #5867 from hiddenasbestos/more_devices
Don't limit available input devices to user count.
2017-12-06 01:43:52 +01:00
Brad Parker
f5ea4a0c65 dinput: add missing function parameter 2017-12-05 17:19:17 -05:00
David Walters
609bcb4dc2 fix device indexing 2017-12-05 22:03:56 +00:00
David Walters
0d189ae067 Don't limit available input devices to user count. 2017-12-05 21:21:29 +00:00
Brad Parker
bc4bbe79aa don't define UNICODE at all, we don't need it and it causes dinput problems (names are wchar_t) 2017-12-05 14:26:59 -05:00
twinaphex
2bdf4a5bb4 update 2017-12-05 20:08:18 +01:00
twinaphex
408878a7e1 Start making it possible for xinput_joypad to be used without
DirectInput
2017-12-05 20:04:12 +01:00
Twinaphex
7ab7ed35b7
Merge pull request #5863 from bparker06/xinput
xinput: copy VID/PID from dinput so autoconfig does not rely solely on HID name
2017-12-05 20:01:16 +01:00