Commit Graph

436 Commits

Author SHA1 Message Date
David Demelier
e99049a8ff Use EVIOCGID's ioctl to get vendor/product id, #6325
The current code get the USB vendor/product controller, in case of
bluetooth connection this means that you get the bluetooth dongle ids
instead of gamepads. This is not fine as we match gamepads using their
product and vendor ids.

Credits go to SDL which helped me to figure out this issue.

http://hg.libsdl.org/SDL/file/f7c6b974d5af/src/joystick/linux/SDL_sysjoystick.c#l208
2018-02-23 09:19:43 +01:00
Twinaphex
0c3a684e2c
Merge pull request #6192 from gblues/master
Fix memory management bugs
2018-01-28 08:48:21 +01:00
gblues
f2ea5dde11 Fix memory management bugs
== DETAILS

 * Fix double-free in hidpad shutdown code
 * Fix possible double-free in hidpad error handling code
 * Fix memory leak in adapter delete method
2018-01-27 22:54:59 -08:00
twinaphex
80b17668b6 Add initial VS2013 solution 2018-01-24 01:29:45 +01:00
twinaphex
c5ffd06778 Revert "(xdk_joypad.c) Cleanups"
This reverts commit 49c399217d.
2018-01-21 01:48:28 +01:00
twinaphex
6c73cea470 Revert "Buildfix"
This reverts commit 832cf07247.
2018-01-21 01:48:21 +01:00
twinaphex
832cf07247 Buildfix 2018-01-21 01:44:18 +01:00
twinaphex
49c399217d (xdk_joypad.c) Cleanups 2018-01-21 01:43:19 +01:00
twinaphex
932904e07e (Xbox 360) Buildfixes 2018-01-20 23:42:10 +01:00
twinaphex
b7bbf368fe (XBox XDK) Input should work again completely 2018-01-20 23:38:32 +01:00
twinaphex
528e4d8cc4 xdk_joypad_axis - implement case 4/5 for Xbox 360 2018-01-20 19:57:14 +01:00
twinaphex
6311885824 (XDK1) Change D-pad to hat controls - make gamepad D-pad and analog
stick work properly
2018-01-20 19:48:29 +01:00
twinaphex
13da6bf4a2 With Xbox OG, some of the face buttons are analog buttons -
need to implement this in _button callback function
2018-01-20 19:34:01 +01:00
twinaphex
b4bb6e2ef4 Start making xdk_joypad code more similar to PC code 2018-01-20 19:05:39 +01:00
twinaphex
64e0861aee remove iteration variables 2018-01-20 18:57:19 +01:00
twinaphex
3ba978caa9 Make axis function more like PC version 2018-01-20 18:55:28 +01:00
twinaphex
e16d962c01 Start getting rid of analog_state 2018-01-20 18:54:21 +01:00
twinaphex
f25306ba22 memset g_xinput_states to 0 2018-01-20 18:50:24 +01:00
twinaphex
03a745e5b4 Remove xdk_joypad_get_buttons 2018-01-20 18:47:39 +01:00
twinaphex
0550b22a35 (XDK) Buildfix 2018-01-20 18:46:13 +01:00
twinaphex
f74e399bdf Start rewriting xdk_joypad.c 2018-01-20 18:44:35 +01:00
twinaphex
41575a63ac (XDK joypad) Cleanups 2018-01-20 17:59:59 +01:00
twinaphex
e6f637ea6b Set autoconfig binds for Xbox 2018-01-20 03:14:17 +01:00
twinaphex
d01b9c4a09 Cleanups 2018-01-19 21:25:35 +01:00
twinaphex
82f721145c (XDK) Refactor xdk_joypad.c 2018-01-19 21:24:28 +01:00
twinaphex
b4b5ed1630 Rely on xbox input subsystem to attach/detach gamepads 2018-01-19 07:02:47 +01:00
twinaphex
0731a79a4f Pass this to XInputOpen 2018-01-19 06:56:44 +01:00
twinaphex
f71bbeae9f (XDK) Try to autodetect all pads at startup 2018-01-19 06:49:52 +01:00
twinaphex
61ff51be2f Start using string_is_equal predominantly 2018-01-16 22:53:38 +01:00
Toad King
4fd750b48a add builtin autoconf script for emscripten gamepads with "standard" mapping 2018-01-14 04:24:37 -06:00
Toad King
b3900217da clamp axis values to -1.0 - 1.0, at least firefox can report values outside that range 2018-01-14 03:43:23 -06:00
Toad King
1f8a85615c don't always clear poll state 2018-01-14 02:34:38 -06:00
Toad King
de3581de73 fix analog sticks 2018-01-14 01:35:28 -06:00
Toad King
15c3f56b37 fix phantom button presses 2018-01-14 01:00:46 -06:00
Toad King
21d928ba0e add joypad driver for emscripten 2018-01-14 00:15:30 -06:00
gblues
5894d0ef86 Remove all HID code from WiiU build via ifdef
== DETAILS
We're trying to track down the source of crashes when switching cores.
To rule out the HID code, this commit does the following:

- Wraps the library imports in an ifdef
- Wraps the object files in conditionals in Makefile.wiiu
- In wiiu_joypad, calls into the hidpad driver are wrapped in ifdef

== TESTING
This didn't solve the "System memory error" crash I've been experiencing.
But, maybe it will impact the other flavors of crashes others are seeing.
2018-01-07 20:26:24 -08:00
vgmoose
890de0e79b allow joycons to work while attached 2018-01-07 12:10:28 +01:00
twinaphex
edb8ecdbf8 (xdk_joypad.c) Add C codepath for XGetDeviceChanges 2018-01-03 14:13:29 +01:00
twinaphex
2884ad2d73 (360) Some buildfixes 2017-12-31 06:09:39 +01:00
misson20000
7cc614263a (NSW) add default button bindings and fix right joystick 2017-12-31 03:04:11 +01:00
Twinaphex
0389bc64fe
Merge pull request #5997 from libretro/new_hid
New HID system (courtesy of gblues)
2017-12-30 15:30:03 +01:00
twinaphex
20bb653f1e (Xbox 360) Buildfixes 2017-12-30 12:36:00 +01:00
gblues
52c754cfa8 Split wiiu_gamepad into three sub-drivers
== DETAILS
Well, after a lot of code analysis, this seems like the
best way to handle things on the Wii U without also completely
re-architecting the I/O handling in RetroArch.

How it works:

- the top-level wiiu_joypad driver is now nothing more than a
  delegator.
- the wiiu-specific drivers live in `wiiu/input/`
- wpad_driver.c handles the WiiU gamepad
- kpad_driver.c handles the wiimotes
- hidpad_driver.c will handle HID devices like the GC adapter, DS3/DS4, etc.

  (I say "will" because this isn't implemented yet)

== TESTING
Haven't actually tried the build to see if it works, but it does
compile.
2017-12-30 04:43:18 +01:00
gblues
c1496a8600 WIP - reorganizing input data
== DETAILS

Looking at the apple input driver gave me an idea--moving the
HID driver into the wiiu_input_t data instead of piggy-backing
it off the wiiu_joypad driver.

- Remove changes to wiiu_joypad
- Add equivalent to wiiu_input

This is probably broke as hell. Haven't tried to compile.
2017-12-30 04:40:43 +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
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
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
Brad Parker
6d484b7724 xinput: check for valid function pointers before calling them 2017-12-23 23:02:29 -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