3132 Commits

Author SHA1 Message Date
radius
3792a5e502 remap-redux part2: cleanup 2018-04-08 12:13:49 -05:00
radius
fa3dfd5f63 remap-redux part2: finally user 2 mapping works! 2018-04-08 12:13:48 -05:00
radius
4260423e48 remap-redux part2: let's use this function instead, add logging 2018-04-08 12:13:48 -05:00
radius
1fa28f0e31 remap-redux part2: let's use this function instead, add logging 2018-04-08 12:13:47 -05:00
radius
d8d22a9c40 remap-redux part2: simplify this code a bit, still not working 2018-04-08 12:13:47 -05:00
radius
e42e79db28 remap-redux part2: rename variable 2018-04-08 12:13:47 -05:00
radius
958216ede9 remap-redux part2: change remap file labels because old ones are incompatible 2018-04-08 12:13:46 -05:00
radius
e130afff73 remap-redux part2: cleanup 2018-04-08 12:13:46 -05:00
radius
5efba1c257 remap-redux part2: better wraparound, skip analogs, add RARCH_UNMAPPED 2018-04-08 12:13:46 -05:00
radius
be2c648596 remap-redux part2: after 60 attempsts, new mapper works, N:1 mapping too 2018-04-08 12:13:43 -05:00
radius
7f5fe5ebff remap-redux part 2: add controller sublabel 2018-04-08 12:13:43 -05:00
radius
c4754815b6 remap-redux part 2: fix small issue with keymapper 2018-04-08 12:13:43 -05:00
radius
34649d1abf remap-redux part 2: start inverting the gamepad mapper columns 2018-04-08 12:13:42 -05:00
radius
51edf47ed2 remap-redux part 2: cleanup keymapper code 2018-04-08 12:13:42 -05:00
radius
f6ee035011 remap-redux part 2: only add items for devices set to RETRO_DEVICE_KEYBOARD (or a subclass) 2018-04-08 12:13:41 -05:00
radius
c57f8722e5 remap-redux part 2: restore original var names 2018-04-08 12:13:41 -05:00
radius
2bfb5ec0df remap-redux part 2: fix nits, hookup left/right callbacks 2018-04-08 12:13:40 -05:00
radius
ed334cd1dd remap-redux part 2: allow multiple gamepads to work for the keymapper 2018-04-08 12:13:40 -05:00
gblues
4433cbebc6 Get digital inputs for Sony DualShock 3 working
== DETAILS

- fix the bitshift math
- read the right bytes out of the ds3 data packet
- remove verbose logging in critical path
- stop caring about errors in the hid read loop -- seems to just
  be benign "device not ready" -- or at least, that's what I'm assuming
  given that the read eventually succeeds.

== TESTING
Played Mario 3 with the DS3 with no issues.
2018-04-05 23:03:38 -07:00
gblues
46dad14d5f Merge branch 'master' into gblues/hid 2018-04-03 20:30:06 -07:00
gblues
af08e5015a More work on Dual Shock 3 driver
== DETAILS

- update to not try starting the read loop until after the device
  is successfully initialized
- add new HID wrapper macros needed by ds3 driver
- add some debug logging to help with troubleshooting
- add button map for DS3

== TESTING
Tested with local build. DS3 init is not working.
2018-04-02 23:16:49 -07: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
39e4167df6 Start work on DualShock 3 driver
== DETAILS

The WiiU GC adapter is working!

Next up: DualShock 3

I have the skeleton of the driver started, need to work out the
activation packet.

== TESTING

The DS3 driver is broke as hell right now.
2018-03-30 23:00:14 -07:00
gblues
d65bd90e67 Fix GC pad button mapping 2018-03-30 18:57:34 -07:00
twinaphex
8acc085dec (input_overlay.c) Get rid of some forward declarations 2018-03-30 13:57:50 +02:00
twinaphex
94254e4c79 (IOHIDManager) Cleanups 2018-03-30 11:49:25 +02:00
Twinaphex
86bfd8f4fc
Merge pull request #6497 from ceb33/master
fix to have a deterministic HID device registration
2018-03-30 11:40:24 +02:00
ceb33
c6d6fc7098 fix memory leak 2018-03-30 11:00:38 +02:00
ceb33
82e2cc7c73 set hid device registration deterministic (sorting by ascending location_id), this solve the issue where game with same vid and pid where sometime swapped by the OS 2018-03-30 10:43:54 +02: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
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
twinaphex
1103f4f630 (input_overlay.c) Cleanups 2018-03-29 19:43:04 +02:00
Ash
aeea0e6ca8
[WiiU] Fix OOB read/write in keyboard driver
This code used a keyboardState size of 256 and indexed it with a
retro_key, which can be any value (RETROK_RALT is 307). This fixes
that by using RETROK_LAST as the array size.

Should fix #6322.
2018-03-17 13:00:47 +11:00
twinaphex
6653818dc8 Revert "(input_overlay.c) Cleanups"
This reverts commit 56389466aaff5e2e196031e3f6b4d468bd35607c.
2018-03-15 06:39:06 +01:00
Ryunam
c5775fd73c Implement Slow motion toggle 2018-03-10 18:42:45 +01:00
Twinaphex
4dc9c408d4
Merge pull request #6329 from markand/fix-vid-pid
Use EVIOCGID's ioctl to get vendor/product id, #6325
2018-02-26 18:39:33 +01:00
twinaphex
fae9223641 Remove hashes from task_overlay 2018-02-25 13:03:54 +01: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
5139241e87 Fix Python codepath 2018-02-19 09:11:33 +01:00
twinaphex
070c09faec Avoid more pointer grabbing for video driver ptr 2018-02-16 20:42:37 +01:00
twinaphex
2b02616512 Disable ENABLE_TOUCH_SCREEN_MOUSE for now until issues are resolved 2018-02-15 14:50:14 +01:00