163 Commits

Author SHA1 Message Date
Francisco Javier Trujillo Mata
0880bd00b0 PS2 is compiling with null drivers 2018-11-09 22:40:50 +01:00
twinaphex
527228e571 Add L + R Menu toggle 2018-10-01 01:36:53 +02:00
twinaphex
4f2c108088 Add another toggle 2018-10-01 00:21:07 +02:00
Twinaphex
467aa30131 Cleanups 2018-06-21 07:26:05 +02:00
gblues
6eebbe4213 Build fix for PC
== DETAILS
Hooray for conditional compile directives.

Moving things around broke things in unexpected ways on non-WiiU builds.

Well, not *completely* unexpected. But still.

Changes:

- Move some typedefs around to avoid circular include dependencies
- Include the file where the HID driver definition got moved to

== TESTING
- verified build for Wii U still runs successfully
- did a local build without any errors (some weird warnings, but since they
  happen in code I didn't change, I'm assuming they're pre-existing?)
2018-04-15 00:04:49 -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
radius
d8d22a9c40 remap-redux part2: simplify this code a bit, still not working 2018-04-08 12:13:47 -05: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
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
twinaphex
5139241e87 Fix Python codepath 2018-02-19 09:11:33 +01:00
Toad King
21d928ba0e add joypad driver for emscripten 2018-01-14 00:15:30 -06:00
radius
3b334b60d6 add display name and config name to autoconf 2018-01-11 17:06:14 -05:00
gblues
0ae7ffe0d3 Clean up dumb compile warnings, fix crash bug
== DETAILS

- the free() method of the hid_driver_t interface needs its
  parameter defined as const in order for the compiler to stop
  complaining about losing const-ness.
- if a joypad list is created with <MAX_USERS slots in it, the
  destroy() function will crash because it assumes there are MAX_USERS
  entries.

  To do this, the allocate function creates n+1 slots, and gives the
  last slot a canary value that the destroy() method can then watch for
  when iterating through the list.
2017-12-30 04:43:27 +01:00
gblues
661e5bf50b Implement new functions in hid_driver_t in WiiU driver
== DETAILS

This implements the WiiU-specific functions.

Since the wiiu_hid_t data structure contains the handle and interface
index, the method signatures can be simplified quite a bit. And since
(at least for now) we want these to be synchronous, we don't need to
expose the callback parameters.
2017-12-30 04:41:19 +01:00
gblues
678c4093c1 Start adapting the dual shock 3 driver to use the new driver format.
== DETAILS

The handshake stuff is derived from the old HID2VPAD, just in knowing
what data goes in what report.

- Added the HID_REPORT_ flags to syshid.h
- Renamed the generic "REPORT_TYPE" flags to be meaningful
- also fixed incorrect parameter list for set_protocol
== TESTING
The functions aren't implemented in wiiu_hid.c just yet,
so this is gonna crash if you try to run it.
2017-12-30 04:41:12 +01:00
gblues
5b37ced196 Update HID pad driver architecture
== DETAILS

The current HID implementation assumes a very low-level USB library
is being used. This causes a problem on Wii U, because the Cafe OS
only exposes a high-level interface.

To get these functions exposed to the HID pad drivers, I had to make
three changes:

1. I added the legacy "send_control" function to the HID driver
   interface
2. I modified the signature of pad_connection_pad_init() to send the
   driver pointer instead of the function pointer
3. I updated the HID pad drivers to keep the pointer to the driver
   instead of the function pointer, and updated the calls into the
   send_control function as appropriate
4. I updated the HID drivers to use the new pad init signature

== TESTING
Untested, in theory it should work without a hitch because at this
point all I've done is abstract things a little. I still need to
update the HID pad drivers to use the Wii U-specific calls as
appropriate.
2017-12-30 04:41:01 +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
a6afddae04 current_input_data and current_input are no longer globals 2017-12-29 23:03:25 +01:00
misson20000
6d2a7b1f26 Nintendo Switch (libtransistor) port 2017-12-29 00:10:01 +01:00
twinaphex
69f85556a3 Get rid of meta_key_pressed 2017-12-18 05:59:57 +01:00
David Walters
0d189ae067 Don't limit available input devices to user count. 2017-12-05 21:21:29 +00:00
David Walters
c5bdc02d6f replace uint64_t with retro_bits_t* for pad buttons state 2017-11-28 10:04:34 +00:00
David Walters
c733f96a16 listen for mouse buttons/wheel when binding input 2017-11-26 15:42:47 +00:00
David Walters
1d70fef70c load/save mbutton assignments to retroarch config 2017-11-26 11:54:10 +00:00
David Walters
b190ac1943 Add 'mbutton' field to retro_keybind struct 2017-11-26 11:49:37 +00:00
David Walters
5be7921445 reimplement using retro_bits_t; pass by ref; raise bind limit to 256 2017-11-24 11:19:17 +00:00
David Walters
5294d43bf1 use C89 compatible comment style 2017-11-24 09:28:26 +00:00
David Walters
b0e383d5f0 Extend input bind limit to 128 2017-11-23 23:04:09 +00:00
David Walters
795057bacf Support for RETRO_DEVICE_INDEX_ANALOG_BUTTON 2017-11-17 22:46:23 +00:00
twinaphex
fcf6228dce Turn into char pointer array 2017-09-27 20:11:44 +02:00
twinaphex
b79f95668b Turn it into char pointer array 2017-09-27 20:08:37 +02:00
radius
fe8a0657b4 add input_mapper scafolding 2017-09-11 00:20:20 -05:00
twinaphex
d1a41a742f Reduce joykey_label/joyaxis_label char arrays 2017-09-08 06:01:21 +02:00
twinaphex
44a1a429c8 Change type of pid/vid to uint16_t 2017-08-31 12:14:27 +02:00
twinaphex
e16371b8a5 Merge input_config.c and input_driver.c 2017-08-31 02:25:04 +02:00
twinaphex
d8f27886ad Reduce size of input driver ids to uint16_t - should be enough 2017-08-30 14:02:18 +02:00
twinaphex
5e0e970c92 Cleanups 2017-06-11 19:48:40 +02:00
twinaphex
0751cb238d Add HAVE_HID ifdefs 2017-06-11 18:12:38 +02:00
twinaphex
060753258a Combine input_driver.c and input_keyboard.c 2017-06-11 17:51:12 +02:00
twinaphex
612cb54cfe Merge input_hid_driver 2017-06-11 08:56:36 +02:00
twinaphex
5d78c2209f Remove obsolete header 2017-06-06 08:30:01 +02:00
twinaphex
efdfb29d50 Turn input_joypad_is_pressed into static inline function 2017-06-06 08:12:53 +02:00
twinaphex
f307135d1d Split up wayland input driver into separate driver; and
improve mouse support for menu
2017-06-06 07:34:33 +02:00
twinaphex
6b3dbff75f Merge input_driver.c and input_joypad_driver.c 2017-06-06 05:56:02 +02:00
twinaphex
d7de9facc3 Simplify input_keys_pressed 2017-05-21 22:31:15 +02:00
twinaphex
77d83b4782 Cleanups 2017-05-21 21:55:20 +02:00
twinaphex
f8f25602e8 Get rid of old_input variable 2017-05-21 21:24:01 +02:00