Commit Graph

35 Commits

Author SHA1 Message Date
gblues
5b13f85967 Use the right value for BIT256_GET macro
== DETAILS

The BIT256_GET() macro expects a bit number (from 0-255), and we're giving it
a 32-bit mask (0x000080000).

Solution:

- Define VPAD_BUTTON_xxx_BIT macros using the bit number
- Use said macro in wiiu_input.c
- organizational cleanup:

  * put VPAD_BUTTON_TOUCH into the enum in stead of as a hokey define
  * put the touch bits in the right order
  * put in placeholder enums for (currently) unused bits
2018-01-05 20:03:10 -08: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
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
twinaphex
69f85556a3 Get rid of meta_key_pressed 2017-12-18 05:59:57 +01:00
twinaphex
7b210ccf37 Don't call meta key pressed if not bound 2017-12-18 05:49:17 +01:00
twinaphex
f0c143766e Change to 256bit macros 2017-12-05 12:07:35 +01:00
twinaphex
e94300a581 Get rid of a lot of RARCH_INPUT_STATE_BIT_ macros - replace them
with BIT128_ equivalents instead
2017-12-05 09:22:56 +01:00
David Walters
5f095677a7 fix for wiiu build (#5826) 2017-11-29 15:55:31 -05:00
Ash
a3e4a7612f
[WiiU] Fix DRC touch - proper scaling; press detection
Oops! Didn't do this quite right the first time round.
This commit fixes RETRO_DEVICE_ID_POINTER_PRESSED, which would always
return 0 due to to an implicit case to int16_t. Basically, we'd do
(val & 0x00080000) & 0xFFFF; which would return 0 every time. Fixed that
by wrapping it in a ternary. Yes, I know we could use a rotation, but
for a boolean value it really doesn't matter.
I also rewrote scaleTP to deal entirely in integers. While the
floating-point math was theoretically faster on PowerPC; it gets awkward
to cast -0x7FFF to a float.
Speaking of, the driver now actually conforms to the libretro API. Not
sure how I managed to not see the spec; but hey, now its fixed.
RETRO_DEVICE_POINTER_ID_X/Y will now return values between -0x7FFF and
0x7FFF like they're supposed to.

Big thanks to @r-type for hounding me to fix this.
Partially addresses #5294; we still need mouse emulation.
2017-11-04 15:01:58 +11:00
twinaphex
a3ded01b64 Cleanups 2017-09-27 23:16:37 +02:00
twinaphex
e16371b8a5 Merge input_config.c and input_driver.c 2017-08-31 02:25:04 +02:00
Ash
6b5aef09a1
[WiiU] DRC touch support as pointer device
Allow using the Gamepad's touch screen as a RETRO_DEVICE_POINTER.
Methodology could use some work, had to add an extra axis to
joypad in order to get the data transferred into the input driver.
Feel free to change this.
Needs to emulate RETRO_DEVICE_LIGHTGUN to really be useful.
Potential for Wiimote IR in future.

Partially addresses libretro/RetroArch#5294
2017-08-19 17:40:56 +10:00
twinaphex
ca80f13b2b Try to be somewhat safer here in case of null pointer derefences 2017-08-09 02:42:19 +02:00
twinaphex
060753258a Combine input_driver.c and input_keyboard.c 2017-06-11 17:51:12 +02:00
twinaphex
5ef8b69c9c (wiiu_input.c) Minor style nits 2017-06-07 21:06:24 +02:00
twinaphex
afd6a2bec5 Cleanups 2017-06-07 00:10:39 +02:00
twinaphex
6b3dbff75f Merge input_driver.c and input_joypad_driver.c 2017-06-06 05:56:02 +02:00
xhp-creations
b04bf809e3 WiiU Fix Keyboard Input
WiiU Fix Keyboard Input
2017-02-09 14:08:27 -05:00
xhp-creations
4915f452f5 WiiU Initial Keyboard Support
WiiU Initial Keyboard Support
2017-02-09 12:34:12 -05:00
twinaphex
96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
aliaspider
8cb692622a (WiiU) add support for bluetooth controllers (Wiimote, nunchuk, classic
controller, wiiu pro controller).
2017-01-16 18:52:39 +01:00
twinaphex
b45c96cc18 (WiiU) Buildfix 2017-01-11 08:24:55 +01:00
twinaphex
6b5bf1ccc3 (wiiu_input.c) Fix build 2017-01-10 22:44:44 +01:00
twinaphex
8bd12368ef Pass joypad_driver name to input_driver_init function and make
sure we don't need to access the settings struct from the
input driver
2017-01-10 17:59:48 +01:00
twinaphex
d48141041d Pass joypad_info to input_state function callback - less
settings pointer grabbing
2017-01-10 17:40:21 +01:00
twinaphex
da4d2a9f42 Remove conditionals for device JOYPAD from input_state callback functions 2017-01-10 17:05:04 +01:00
twinaphex
b9945f05f1 Pass joypad_info to input_joypad_analog 2017-01-10 03:53:57 +01:00
twinaphex
6376f2af68 Add rarch_joypad_info_t 2017-01-10 03:44:53 +01:00
aliaspider
0433cae3c9 (WIIU) misc. 2016-11-05 15:01:43 +01:00
aliaspider
176dd79f33 (WIIU) misc. 2016-11-02 22:06:15 +01:00
twinaphex
ce98a4dd19 Get rid of now unused input_driver_key_pressed 2016-10-29 04:57:28 +02:00
twinaphex
d246d320c7 Get rid of messy 'all_users_control_menu' hack - will be dealt
with better once menu_input branch has been merged
2016-10-27 07:00:13 +02:00
twinaphex
b9909bf5ba Add CONFIG_BIND_ALT 2016-10-27 04:03:24 +02:00
aliaspider
a4d745a471 preliminary port to the wiiu platform 2016-10-27 01:34:10 +01:00