445 Commits

Author SHA1 Message Date
misson20000
dd0ad28818 NSW: fix analog sticks 2018-05-24 00:18:38 -07:00
gblues
84e9c93c35 quotes for some, braces for others 2018-05-02 22:37:34 -07:00
gblues
27bfcf3c77 Replace angle includes with quote includes
=== DETAILS

Replaced includes for things that aren't standard library headers so
they use quotes instead of brackets.

Also fixed up a couple of headers that had include-order dependencies.
2018-05-02 21:31:00 -07:00
gblues
7448fd3157 More code re-organization
=== DETAILS
Since @aliaspider wants the `wiiu/` to be something of a mini-SDK, I've
reorganized the code I put in there:

- `wiiu/main.c` now only has the ELF/RPX entrypoints, and the code used
  by those entrypoints, with RA code removed (e.g. swapped retro_sleep()
  for usleep()). These entrypoints then call main() ...
- Moved `main()` and its support functions back into `frontend/drivers/platform_wiiu.c`
  I also renamed some of the support functions I wrote, and better
  organized them within the code.
- Moved `wiiu/input/` into the `input/` hierarchy:

  * The joypad drivers now live in `input/drivers_joypad/wiiu/`
  * The HID driver now lives in `input/drivers_hid/`
  * The Wii U specific headers now live in `input/include/wiiu`
  * I added `input/include` into the include search path to avoid
    using really ugly relative includes
2018-05-01 23:23:40 -07:00
gblues
fb5b31faf3 Merge branch 'master' into gblues/hid 2018-04-14 14:18:03 -07:00
twinaphex
a82bb0ec94 Create special type input_bits_t 2018-04-08 20:21:12 +02:00
gblues
9bc5a15c2d Enable pads to register in any order
== DETAILS

Whereas the last commit had a hack (that disabled the wiimote
driver in the process), this has.. well, a *different* hack that
allows pads to register in any order.

Note that due to the initialization routines, the gamepad will still
likely always get slot 0. Not sure if this can be overridden via config
or not.

== TESTING

Tested locally with GC adapter
2018-04-01 18:52:26 -07:00
gblues
2cf89feb86 Code clean-up
== DETAILS

Now that I have a working implementation, it's time to tidy up a bit:

- there was no need for the HID subsystem's object data to have a reference
  to the global hid state (since it's global), so removed it.
- refactored the users of that member to use the global state, defining
  reusable macros.
- reorganized the information in *.h files
- removing the hid state also made the constructor changes to the hid driver
  unneeded, so I reverted those changes.

== TESTING
Confirmed clean build. Haven't tested the build yet to make sure everything
still works, though.
2018-03-31 22:25:30 -07:00
gblues
5060c2aac4 More fixes, GC pad kinda sorta works
== DETAILS

- Added a new method to the joypad_connection_t interface for
  getting a single button
- wired everything into the hidpad driver
- for testing purposes, hacking the top-level joypad driver
  so that kpad isn't used
- add a new RARCH_LOG_BUFFER method to verbosity for logging the
  contents of a binary buffer (useful for writing/debugging pad drivers)
- fix a few bugs in the wiiu GC pad driver

The button mapping isn't quite right, and I'm not sure what's
going wrong.
2018-03-29 23:37:11 -07:00
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 49c399217d5b8dbd3db549506fa3d6c2a28b7293.
2018-01-21 01:48:28 +01:00
twinaphex
6c73cea470 Revert "Buildfix"
This reverts commit 832cf072477700b61d25708509acf28b6fba7347.
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