Commit Graph

137 Commits

Author SHA1 Message Date
gblues 89c1ba7929 Keep HID pads from clobbering gamepad/wiimotes
== DETAILS

Trying to do weird pad math just wasn't working so I bit the bullet and just
let it allocate all 16 pads in the slot list, then just mark 0-4 as
connected so that the slot allocator would start at 5.

I can see it detect the pad, but no idea if it works. Out of time for
today.
2018-03-29 23:37:11 -07:00
gblues 1eea48d0c8 Fix crash on exit bug
== DETAILS

Turns out freeing memory that's already been freed is.. bad.

Fix two double-free instances; one due to over-freeing and the other
due to wrong order-of-operations causing a double free.

Also updated logging a little.

== TESTING

The GC adapter still clobbers slot 0, but the "emergency exit" sequence
works to quit RA cleanly.
2018-03-29 23:37:11 -07:00
gblues 8a4c5086fb Finish HID implementation for WiiU GCA adapter
== DETAILS

(I think)

- Uncomment the call in the read loop to start feeding packets to the
  driver
- implement the GCA packet driver
- implement the pad interface
- fix indentations in GCA driver

== TESTING
Compiles. Haven't tested yet.
2018-03-29 23:37:11 -07:00
gblues 180d6a28bf Fix up HID device driver initialization
== DETAILS
Turns out the cause of the crash was a bad cast, resulting in a
function call to nowhere.

Also, I think the DSI exception handler only works on the primary core;
when this was happening in the background thread, I got a black
screen error instead.

Next up: finishing up the GCA driver.
2018-03-29 23:37:11 -07:00
gblues dc6f4c23ed Rename hid_driver_instance members for clarity 2018-03-29 23:37:11 -07:00
gblues 4b9d5c0ab7 Start implementing "detach" code path
== DETAILS
We're at a point where we need to do more than just
clean up a local data structure, so I've started
implementing the "detach" part of the code so that
everything gets cleaned up properly.

Also, added error handling inside the polling
thread.

== TESTING

Have not tested yet.
2018-03-29 23:37:11 -07:00
gblues 0100d58ffb WIP: evolve driver implementation
== DETAILS

I've created the concept of a hid_driver_instance_t which is basically
a central place to store the hid pad driver, hid subsystem driver,
the pad list, and the instance data for the above in a central location.

The HID pad device drivers can use it to perform HID operations in a
generic manner.

This is more-or-less a pause point so I can catch up with upstream.

== TESTING

Haven't tested this yet. Compiles without warnings though!
2018-03-29 23:37:11 -07:00
gblues 41ce8853d7 Add name for hid device; implement detect
== DETAILS

- detect() methods in device_* files now check for VID/PID
  instead of just returning false
- add "name" field on hid device, mainly for logging purposes

== TESTING
Verified my WiiU GC adapter detected properly
2018-03-29 23:37:11 -07:00
gblues ae19eed00f implement hid device search 2018-03-29 23:37:11 -07: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 fa8db9b4d2 Silence another Coverity warning 2017-06-28 06:59:00 +02:00
twinaphex a41b8bc199 Direct usage of epoll 2017-06-11 20:51:21 +02:00
twinaphex 84f5fa1f26 (epoll_common.c) Cleanups; don't use verbosity logging inside 2017-06-10 12:07:01 +02:00
twinaphex 8980f8c1ea Get rid of useless wrapper function epoll_waiting 2017-06-08 21:52:50 +02:00
twinaphex eb08a86647 Get rid of udev_common.c 2017-06-08 21:46:26 +02:00
twinaphex b633b8ad2d Get rid of implicit memset 2017-06-08 21:38:05 +02:00
twinaphex 96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex b63b675274 (linuxraw_joypad.c) Cleanups 2016-12-01 16:42:21 +01:00
twinaphex d7f7d5f99a Rewrite epoll_common 2016-12-01 16:40:04 +01:00
twinaphex 63ae172a23 Add udev_common.c/.h 2016-12-01 15:02:42 +01:00
twinaphex 4a7ab8366b Move libretro.h headers to libretro-common/include 2016-05-10 19:03:53 +02:00
twinaphex ca3f352ed1 Remove unused udev_common 2016-02-05 13:30:19 +01:00
twinaphex 32ee695f9d Create udev_ctl 2016-02-05 01:49:31 +01:00
twinaphex 347a18cb30 Update input headers 2016-01-10 04:33:01 +01:00
twinaphex ef7a786527 Attempt to prevent segfault when pressing Enter in DRM/KMS mode 2016-01-02 22:28:21 +01:00
twinaphex 5ba14b45ce Change some header includes 2015-12-05 20:05:32 +01:00
twinaphex 7cb78cca58 Make g_epoll static 2015-11-30 18:14:07 +01:00
twinaphex 54655c37cd Create epoll_waiting 2015-11-30 18:08:00 +01:00
twinaphex ecbfc72e9b Create epoll_common 2015-11-30 18:05:10 +01:00
twinaphex 6d90c42bb5 We need to check for the instance where udev is only initialized
for the joypad part and not the general input driver
2015-11-30 16:56:32 +01:00
twinaphex 62260cf892 Turn g_udev static 2015-11-30 16:52:29 +01:00
twinaphex 28602d84af Make g_udev_mon static 2015-11-30 16:47:43 +01:00
twinaphex b76481b21e Create udev_mon_hotplug_available 2015-11-30 16:42:52 +01:00
twinaphex 2db1197942 Expand udev_common.c 2015-11-30 16:39:22 +01:00
twinaphex fd91cf130e Create udev_common.c/udev_common.h 2015-11-30 16:31:05 +01:00
twinaphex 9fd9fd10e8 Create input_x11_common 2015-11-29 03:34:09 +01:00
twinaphex 03b1f36af1 Move linux_common to input/common/ 2015-11-17 06:46:32 +01:00