40 Commits

Author SHA1 Message Date
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
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
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
8f900de65e Clean up USB VID/PID declarations
== DETAILS

USB Vendor and Product IDs are in little-endian byte order, and they
need to be byteswapped on big-endian systems.

This approach allows us to use the standard hex notation for the VID/HID
values, and give them meaningful names, and only swap on the platforms
that need it. Also prevents having to abuse SWAP16() in the platform-
specific code.
2017-12-30 04:43:03 +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
d0adbd194e Revert changes to joypad API
== DETAILS

Premature. Still learning my way around the codebase.
2017-12-30 04:40:53 +01:00
gblues
5804233ca8 Start fleshing out wiiu_hid driver
== DETAILS

- Added entrypoints into `input/connect/joypad_connection.c` to allow
  a max value to be passed in, instead of using single macro value
- Created a hand-off between the HID attach handler and the worker thread
- Created a pad initializer in `wiiu_hid.c` leveraging the new functionality
  added to `joypad_connection.c`

== TESTING
Compiles cleanly. At best, doesn't do anything. Might crash--not ready
to test quite yet.
2017-12-30 04:40:39 +01:00
David Walters
c5bdc02d6f replace uint64_t with retro_bits_t* for pad buttons state 2017-11-28 10:04:34 +00:00
Daniel Jimenez
5267b630f8 Added code for single port psx to ps3 adapter
On branch master
 Changes to be committed:
	modified:   ../griffin/griffin.c
	modified:   ../input/connect/connect_ps2adapter.c
	new file:   ../input/connect/connect_psxadapter.c
	modified:   ../input/connect/joypad_connection.c
	modified:   ../input/connect/joypad_connection.h
2017-06-17 14:19:09 -07:00
twinaphex
96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
Brad Parker
1d3e1a6962 DOS/DJGPP buildfix 2017-01-20 18:23:45 -05:00
twinaphex
4a7ab8366b Move libretro.h headers to libretro-common/include 2016-05-10 19:03:53 +02:00
Ernesto Ramirez
c4f2de321a (GX) Added PS2/PSX Controller Adapter for HID driver. 2016-04-16 19:33:17 -05:00
twinaphex
24f5275001 Use wiiugca for non-Wii too 2016-02-04 23:49:04 +01:00
twinaphex
407d85f604 Use nesusb/snesusb for non-Wii too 2016-02-04 23:43:33 +01:00
netux79
bca4ccb155 (GX) Refactor of the Wii USB HID support. Now it's working!
In order to have a controller working you need:
1) Have a matching HID autoconfig file in autoconfig/hid for your controller.
2) Create a "connect" driver for the pad in "input/connect" folder (source code of RA).
3) Once you are in RA, change the joystick driver to HID and restart.
4) You may be now able to use you USB HID compatible pad in RA.

I included some "connect" drivers as an example. It also need to include them for compilation.
2016-02-04 17:01:03 -05:00
twinaphex
347a18cb30 Update input headers 2016-01-10 04:33:01 +01:00
twinaphex
9394294956 (joypad_connection) Stub Wii U Pro implementation - untested 2015-12-12 18:30:17 +01:00
twinaphex
a3c34a7813 Cleanups 2015-11-28 02:31:19 +01:00
twinaphex
a6ccc188a8 Rename input_common.c to input_config.c 2015-11-28 02:22:58 +01:00
twinaphex
53aa251008 (joypad_connection.h) Cleanups 2015-11-17 06:54:59 +01:00
twinaphex
123b85dbb0 Change returntype of pad_connection_init 2015-06-13 01:40:55 +02:00
twinaphex
4c7c1094e2 (joypad_connection.c) Remove unused is_gcapi 2015-04-04 23:38:19 +02:00
twinaphex
35e273bcdb Make pad_connection_find_vacant_pad non-static 2015-04-04 23:34:04 +02:00
twinaphex
31b6323094 Move apple_joypad_connect_gcapi to apple_gamecontroller.m and
make it a static function
2015-04-04 23:33:01 +02:00
twinaphex
5e83eefd81 Add VID/PID detection for joypad connection 2015-04-03 23:30:51 +02:00
Twinaphex
047fdbd3fc (PS4/joypad_connection) Changes 2015-03-31 19:23:06 +02:00
Twinaphex
da428a70d3 (Apple) apple_joypad_hid.c is going to become a more generic
'HID joypad' driver
2015-03-31 15:14:39 +02:00
twinaphex
65f6d2253d (joypad_connection.c ) change 'used' to 'connected' 2015-02-15 03:54:38 +01:00
twinaphex
738d70d2f8 Add get_buttons callback 2015-02-15 01:57:29 +01:00
twinaphex
453321c50b Start updating headers 2015-01-07 17:46:50 +01:00
twinaphex
f08f78e86a (joypad_connection) start calling 'connect' function 'init'
and 'disconnect' 'deinit'
2014-10-22 07:59:52 +02:00
twinaphex
0fb301fa43 (joypad/connect) Change 'index' local variables 2014-10-20 20:32:41 +02:00
Twinaphex
800bf13846 (joypad_connection.h) Fix 'no previous prototype for function' warning 2014-10-14 19:01:52 +02:00
Twinaphex
fdd616abcb (joypad_connection.c) Refactor pt. 2 2014-10-06 01:49:00 +02:00
Twinaphex
29f640fe5d (joypad_connection.c) refactor pt. 1 2014-10-06 00:37:11 +02:00
Twinaphex
df0fbb7cf3 (OSX) More optimal polling of buttons/axis from pad_connection 2014-10-05 03:28:43 +02:00
twinaphex
d4a14c4cb9 Move joypad_connection code to input/connect 2014-10-04 23:02:48 +02:00