Commit Graph

3397 Commits

Author SHA1 Message Date
twinaphex af2805406d Move more functionality to input_driver.c ; make more functions static 2019-04-21 07:30:14 +02:00
twinaphex 270e95bc97 Turn a lot of input_config_parse functions static 2019-04-21 06:42:13 +02:00
Brad Parker e0b59f13e2 no analog/sensitivity correction for analog buttons 2019-04-09 23:17:11 -04:00
Brad Parker 8639018976 use proper scaled radial deadzone calculation 2019-03-29 14:07:35 -04:00
Brad Parker e7891b8c1a add analog deadzone and sensitivity options, rename axis threshold 2019-03-25 23:22:19 -04:00
rsn8887 28ef222886 [VITA] Bluetooth mouse and keyboard support 2019-03-22 21:32:59 -05:00
rsn8887 5aa0d17659 [LIBNX] Fix USB keyboard support for controlling Vice core and Menu 2019-03-19 19:49:45 -05:00
rsn8887 208a68b528 [LIBNX] USB mouse support 2019-03-19 18:44:12 -05:00
rsn8887 f943688dff [LIBNX] USB keyboard support 2019-03-19 08:43:46 -05:00
Brad Parker 145013074e android buildfix 2019-03-14 21:26:39 -04:00
Brad Parker 15e489fd0a android: allow stylus/pen to move mouse without pressing down 2019-03-14 19:33:51 -04:00
Brad Parker 2f659e3e17 style nits 2019-03-14 19:33:02 -04:00
Twinaphex a8a7fba2ca
Merge pull request #8450 from Exvat/switch-rumble
Add rumble support for the switch
2019-03-13 12:28:05 +01:00
Twinaphex ae35484eea
Merge pull request #8456 from phcoder/kbd
Fix keyboard on android
2019-03-13 11:35:27 +01:00
Twinaphex 062a307b09
Merge pull request #8458 from phcoder/kbd102
input_keymaps: Add 102nd key
2019-03-13 11:34:16 +01:00
Brad Parker 44a06d69a6 android: add gamepad rumble support 2019-03-13 03:32:18 -04:00
Vladimir Serbinenko 2d56ceedfd input_keymaps: Add 102nd key 2019-03-12 23:52:50 +01:00
Vladimir Serbinenko fa1603127f Fix keyboard on Android
This bug interferes with my BK-0010 libretro port.
2019-03-12 23:45:52 +01:00
Brad Parker 954c54baee add device vibration option for cores that support rumble (with initial android implementation) 2019-03-12 13:07:16 -04:00
Exvat e7bf2a345c Add rumble support for the switch 2019-03-11 19:33:02 -07:00
Brad Parker f6dc7f4f02 android: add option to vibrate on touch 2019-03-10 21:36:52 -04:00
Twinaphex 0ff2832e83
Merge pull request #8438 from bparker06/netplay_toggle
add hotkey to toggle netplay hosting
2019-03-10 23:16:21 +01:00
Brad Parker ed5bd8023e Bliss-Box: add PSX Jogcon ID 2019-03-09 18:04:03 -05:00
Brad Parker 19ced73596 add hotkey to toggle netplay hosting 2019-03-09 17:48:03 -05:00
Brad Parker 4bb81bbb1b add F10 hotkey to send debug info, fix F3 hotkey for FPS toggle when inside menu 2019-03-09 16:03:17 -05:00
Brad Parker 10df615d14 add "Send Debug Info" option under Help 2019-03-07 19:17:54 -05:00
Twinaphex 5827e3b3af
Merge pull request #8382 from casdevel/i8326
Fix issue #8326
2019-02-28 23:26:53 +01:00
Zoran Vuckovic 2b2903cfff Fix issue #8326 2019-02-28 21:56:38 +01:00
Francisco Javier Trujillo Mata 48d46dcc44 [PS2] Analog support improvement 2019-02-27 19:43:59 +01:00
twinaphex ebae7ebc79 Input driver - Get rid of 'own driver' mechanism 2019-02-27 17:17:34 +01:00
Brad Parker 4f0d61a2ac update copyright 2019-02-22 19:13:36 -05:00
Francisco Javier Trujillo Mata c147866562 Implemented analog support for ps2 controllers 2019-02-20 19:17:14 +01:00
twinaphex 1daaf7385c 9PS2) Silence some warnings 2019-02-14 07:20:44 +01:00
twinaphex 386657a366 (menu widgets backport) Re-commit task queue changes 2019-02-08 08:00:32 +01:00
twinaphex 7022786f34 Revert parts of menu_widgets that were causing breakage, but leave
all the hooks in so we can add them back piece by piece again
2019-02-08 07:26:43 +01:00
radius b549f5181b try to fix #8121 by making the interval configurable 2019-02-07 22:34:18 -05:00
natinusala c20ab3864d First version of menu widgets (gl only) 2019-02-06 20:48:24 +01:00
orbea 8ff0b14281 Fix C89_BUILD=1. 2019-02-06 09:16:26 -08:00
Yoshi Sugawara b06d75ec99 iOS: check if mfi controller already added to the internal list when connecting 2019-02-05 06:43:14 -10:00
orbea 28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
twinaphex 85708b7ef8 (Emscripten) Buildfixes 2019-02-03 17:15:18 +01:00
Twinaphex b321753944
Merge pull request #8144 from orbea/coreaudio
Fix warnings.
2019-02-01 19:13:49 +01:00
orbea 5d56080312 Use the posix poll.h instead of sys/poll.h. 2019-02-01 09:58:04 -08:00
orbea 5150d96074 Fix warnings. 2019-02-01 08:40:43 -08:00
Yoshi Sugawara 45185d6827 tvOS: remove the tvOS modules directory and use the iOS modules one since cores built using the iOS SDK work on tvOS
iOS: change default joypad driver to be mfi
iOS: move autodetect of mfi controller to mfi_joypad driver and set the default mapping for both iOS and tvOS
iOS: support unsupported buttons on mfi controller (select,L3,R3) by using hotkey combinations using the MENU button
tvos: use INPUT_TOGGLE_DOWN_Y_L_R as default for menu toggle gamepad combo
2019-02-01 05:33:29 -10:00
twinaphex 4b0b4e727b Cleanups 2019-01-31 15:24:21 +01:00
Twinaphex 422e421900
Merge pull request #8122 from yoshisuga/tvos2
Support for AppleTV (tvOS)
2019-01-31 15:19:10 +01:00
David Skywalker 347519a4d8 now X11 driver using keycodes instead keysyms, fixes international layouts problems. 2019-01-31 12:50:58 +01:00
Yoshi Sugawara e039472300 Merge remote-tracking branch 'upstream/master' into tvos2 2019-01-30 07:50:26 -10:00
Yoshi Sugawara a18512375b Support for tvOS
- add tvOS target
    - support code signing tvOS cores by adding an argument to the code signing cores script
    - use NSCachesDirectory for the documents directory
    - add some mfi controller handling logic to set non-game controllers to the last index to avoid interfering with operation
    - autodetect mfi controller for apple tv on startup - added autodetect to hid joypad
    - added a webserver to transfer files for tvOS
    - xcode: clean up project, remove unused folders
    - remove HAVE_MATERIALUI setting for tvos build, make it use XMB as default
    - added retroarch app icon courtesy of @MrJs
    - added auto-detect of mfi controller for apple tv
2019-01-29 10:13:46 -10:00
Rob Loach fa875692c3
Added menu toggle for 'Down+Select' 2019-01-28 11:43:57 -05:00
orbea 088860e499 Silence -Wformat-truncation warnings with DEBUG=1. 2019-01-24 10:59:53 -08:00
orbea cb602c190d Some C89_BUILD fixes. 2019-01-20 14:03:42 -08:00
Twinaphex 8cd85c4f51
Merge pull request #8034 from orbea/blank
Remove trailing blank lines.
2019-01-18 20:22:09 +01:00
krzys-h d98962189a Fix crash in xinput with verbose logging 2019-01-18 17:50:13 +01:00
orbea e062b98088 Remove trailing blank lines.
find . -type f -exec sed -i '${/^[[:space:]]*$/d;}' {} \+
2019-01-17 19:39:38 -08:00
orbea ff2e3bbbce Fix CXX_BUILD errors. 2019-01-13 11:51:33 -08:00
krzys-h e65f87a4ee Fix warning in uwp_input.c 2019-01-13 16:01:59 +01:00
Twinaphex cb596aec3a
Merge pull request #7820 from meepingsnesroms/master
Buttons are only 16 bits so only use uint16_t to prevent wasting 6 bytes
2019-01-13 04:55:34 +01:00
twinaphex 4c8e5e07c0 Fix some CXX_BUILD errors 2019-01-12 18:35:14 +01:00
krzys-h e08f79e16b (UWP) Add keyboard mapping support in the uwp driver 2019-01-11 20:24:26 +01:00
twinaphex c98b2e2292 Buildfixes and more static code analysis warning fixes 2019-01-10 22:24:43 +01:00
twinaphex b9ff2e4de1 Fix some static code analysis warnings from MSVC 2017 2019-01-10 21:47:15 +01:00
krzys-h 0cff7eefa7 Initialize COM only once, globally 2019-01-10 16:48:02 +01:00
Twinaphex 40997473ed
Merge branch 'master' into orbis2 2019-01-08 20:18:08 +01:00
orbea bfc366decc Squeeze extra blank lines with cat(1).
Example:

find . -type f -iname '*.c' | while read -r i; do
  cat -s "$i" > "$i.new"
  mv "$i.new" "$i"
done
2019-01-08 11:04:58 -08:00
Francisco Javier Trujillo Mata 9370fb604d Enable 2 controller for PS2 Driver (multiplayer is not implemented yet) 2019-01-08 00:28:14 +01:00
Francisco Javier Trujillo Mata f48ffb9aac Open RetroArch Menu Long Pressing Start button 2019-01-07 01:38:48 +01:00
orbea 2b0838ac02 udev: Disable the mouse when the window has lost focus. (#7851)
Fixes https://github.com/libretro/RetroArch/issues/5520

v2: Move check to udev_handle_mouse().
v3: Change check to udev_get_mouse to fix issue reported by RobLoach.
2019-01-05 19:56:41 -05:00
krzys-h fce7ca80c1 (UWP) Fix multiple gamepads on xinput 2019-01-05 21:50:58 +01:00
orbea 849259d8f6 libretro-common: Sort config file conditionally.
This allows optionally sorting configure files and is needed to fix the
order of inputs in the autoconfig profiles which should not be sorted
alphabetically.

Fixes https://github.com/libretro/RetroArch/issues/7873
2019-01-03 15:28:32 -08:00
Francisco José García García 4204bfc67f [ORBIS] Add Menu toggle combo and some cleaning 2019-01-02 12:13:17 +01:00
Twinaphex 8f2fa4527c
Merge pull request #7849 from krzys-h/fix-7842
Fix the taskbar extension not initializing properly
2019-01-02 02:34:19 +01:00
orbea 7ac080ea50 sdl: Flush the joypad events.
Bastien found a fix to the issue
"The lag after 10-15 minutes issue appears to be a bug in the sdl2 input
driver in RetroArch. RetroArch never clears the SDL event queue. After a
while it is so large it takes a significant time to traverse."

Fixes https://github.com/libretro/RetroArch/issues/7868

Solution thanks to Bastien.
2019-01-01 17:16:35 -08:00
krzys-h 9c75b9cb7f Add missing CoUninitialize calls, fix COM initialization problems
It turns out, some of the CoInitialize calls were failing because they
specified conflicting threading models
2019-01-01 17:30:43 +01:00
Greg V a838582b11 udev: support on FreeBSD via libepoll-shim/libudev-devd 2019-01-01 03:16:33 +03:00
Greg V f1e516bfaf keymaps: define 'x11' and 'linux' on any platform with Wayland
Such as FreeBSD
2019-01-01 03:03:29 +03:00
Francisco José García García ea2ed2fb07 [ORBIS] More input driver changes 2018-12-31 00:14:56 +01:00
twinaphex aecd532dac UWP needs this to return true for some reason 2018-12-30 20:03:14 +01:00
twinaphex 74f391de9b This fixes all-non Xinput/Xbox pads - they were all non-working
before
2018-12-30 19:55:37 +01:00
Francisco José García García 4ad083cb97 [ORBIS] Update input driver 2018-12-30 14:00:18 +01:00
Francisco José García García 9c5a934529 [ORBIS] Untested input driver 2018-12-30 01:29:34 +01:00
krzys-h f6c8a0c5c2 Add UWP input driver
Keyboard, mouse and touch support: done
2018-12-28 22:09:30 +01:00
krzys-h b201d669b5 First iteration of UWP support
Enough to kind of run

Working drivers: xinput, d3d11
Still missing: input driver with keyboard support, audio driver
2018-12-28 22:09:22 +01:00
Francisco Javier Trujillo Mata 90ba2df972 Put proper license in the files for the PS2 development 2018-12-26 13:48:48 +01:00
meepingsnesroms a6f097c873 Buttons are only 16 bits so only use uint16_t to prevent wasting 6 bytes 2018-12-25 14:33:43 -08:00
Brad Parker 458bb9fbb5 add option to toggle menu by holding down start button 2018-12-19 14:53:17 -05:00
jdgleaver f68d756af3 (RGUI) Add user index label to control menu entries 2018-12-19 12:19:29 +00:00
jdgleaver 37acbd1ecf (3DS) Add joypad input labels 2018-12-18 16:30:05 +00:00
grant2258 3a0c27e753 use none zero as requested 2018-12-17 00:07:00 +00:00
Twinaphex fbb095cc06
Merge pull request #7730 from grant2258/mouse
fix udev mouse
2018-12-16 23:17:06 +01:00
grant2258 74de0ade03 resolve changes 2018-12-16 20:52:15 +00:00
grant2258 fd6856ce20 fix tpouchpad as well 2018-12-12 18:27:29 +00:00
grant2258 1d8dd133b7 tidy code up 2018-12-12 17:29:31 +00:00
grant2258 07b17059f1 fix udev mouse 2018-12-11 23:24:21 +00:00
rsn8887 44cd329125 [LIBNX] Fix switching from Split Joycon mode to Dual Joycon mode 2018-12-05 18:29:28 -06:00
rsn8887 f953962d08 [LIBNX] Fix Split Joycon mode for horizontal holding 2018-12-05 18:12:55 -06:00
Tatsuya79 d52b38eadc Add FPS counter hotkey. 2018-11-29 13:12:11 +01:00
Royerson ba435ce22a
add more model names for Xperia Play hack 2018-11-21 14:06:34 -07:00
radius 390c9a4dde xperia play hack 2018-11-18 17:34:54 -05:00
Tatsuya79 1e5192462e Analog stick to trigger remap functionality. 2018-11-10 17:27:14 +01:00
Francisco Javier Trujillo Mata fc9cd8f639 JoyPad implemented 2018-11-09 22:40:50 +01:00
Francisco Javier Trujillo Mata 8a0266cf8d PS2 Input looks to be ready 2018-11-09 22:40:50 +01:00
Francisco Javier Trujillo Mata 0880bd00b0 PS2 is compiling with null drivers 2018-11-09 22:40:50 +01:00
Stuart Carnie 5c1075127b
chore(metal): Separate legacy GL and Metal source
* Forks of Cocoa / Cocoa Touch to *_metal.* version
* Reverted original GL Cocoa / Cocoa Touch versions
* GL and Metal projects still build
2018-11-04 20:50:50 -07:00
M4xw efb71fc38e [LIBNX] Initialize HID anyway, might fix randomly having no controls 2018-10-27 19:27:24 +02:00
natinusala ce873906fc libnx: add multitouch to input driver 2018-10-24 17:23:22 +02:00
twinaphex c17135df3e Revert "Use sceCtrlIsMultiControllerSupported to detect"
This reverts commit ef10b7897d.
2018-10-23 02:42:06 +02:00
Twinaphex 50682c9a46
Merge pull request #7014 from mickski56/master
address #6920 Proper analog trigger support
2018-10-12 01:08:39 +02:00
natinusala 57db04b389 switch_input: add pointer capabilities 2018-10-08 14:36:03 +02:00
rsn8887 827aa4936a [SWITCH] Use proper button labels 2018-10-03 18:50:33 -05:00
natinusala a5f122a84e libnx: improve touch scaling calc 2018-10-03 18:50:36 +02:00
natinusala fef4448ddb libnx: added touch support 2018-10-01 21:22:21 +02: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
M4xw be85ec4627 [LIBNX] Add Split Joycon support 2018-10-01 00:03:57 +02:00
twinaphex cb8148878c Add hotkeys for 'Toggle Recording' / 'Toggle Streaming' 2018-09-18 08:52:09 +02:00
radius 1c85058e72 [recording] rename bsv recording from movie to input replay 2018-09-15 21:47:23 -05:00
twinaphex bde5905eba Cleanup 2018-09-15 08:12:18 +02:00
Brad Parker 19329fe7c7 prevent out of bound array access for unmapped input binds 2018-09-15 01:21:10 -04:00
M4xw 64edf5f879 [LIBNX] Fixups and bare minimum to function 2018-09-14 20:38:42 +02:00
twinaphex 517b1b9089 Add HAVE_LIBNX ifdefs to switch_input.c/switch_joypad.c, and
features_cpu.c
2018-09-12 19:54:51 +02:00
David Walters b592f254b9 Support for "OEM-102" key (usually '\' on Euro keyboards) 2018-09-02 18:24:51 +01:00
twinaphex dac4034954 Add PPC ifdefs; kIOHIDUniqueKey is not available on OSX 10.5 2018-08-30 15:56:02 +02:00
twinaphex ae0d9fd60d (Wayland) Buildfixes 2018-08-17 17:42:14 +02:00
Twinaphex 4d96fddf5e
Merge pull request #7061 from wiktorek140/sailfishos-touch
Sailfish OS  device build configuration connected with touch screen support required for device with this OS
2018-08-15 13:30:04 +02:00
twinaphex a6941fb4ed Initial work done on VS2017 solution for Android 2018-08-14 16:02:31 +02:00
Wiktor Strzębała 45799ee034 Bring up touch support for wayland subsystem for sailfish os devices
Touch code cleanup
Make variabled static as suggest bparker06
C89 compilation error fix (at least for loops)
More C89 fixes

Signed-off-by: Wiktor Strzębała <wiktorek140@tlen.pl>
2018-08-09 20:49:27 +02:00
greso 2c9fda1798 (macOS) Fix input issues
For my Xbox One Controller the min input for the hat is 1 and not 0. 0
points to the default state that is called after each button press.

On top of that the two axis for the trigger buttons were ignored. I
added some additional axis that are not present on my controller but
will probably help for other input devices.
2018-08-07 19:51:50 +02:00
twinaphex d08f0f1234 CXX_BUILD cleanups 2018-07-28 23:18:44 +02:00
mickski56 aa0e0de1d9
address #6920 Proper analog trigger support 2018-07-24 22:48:50 +01:00
TheOfficialFloW ef10b7897d
Use sceCtrlIsMultiControllerSupported to detect 2018-07-24 10:12:15 +02:00
Yoshi Sugawara 0a710564e1 issue 6751: read input of overlay for remapped keyboard keys 2018-07-22 11:32:52 -10:00
twinaphex ea09c29e04 Update implementations for other input drivers - not all input
drivers support this yet
2018-07-15 14:34:02 +02:00
twinaphex 9a1ac6d77b (rwebinput) Fix game focus toggle 2018-07-15 14:22:16 +02:00
twinaphex 13431c7cbf (udev) Fix game focus toggle for udev input driver 2018-07-15 14:20:26 +02:00
twinaphex 98190294db (winraw_input) Fix game focus toggle for winraw_input 2018-07-15 14:18:35 +02:00
twinaphex d50850762b Fix game focus toggling for DInput driver 2018-07-15 14:17:10 +02:00
Twinaphex 11244d78b0
Merge pull request #6981 from casdevel/dinput
Add dinput rumble support
2018-07-13 12:20:28 +02:00
twinaphex fab08c9cfb Only load Xinput DLL once 2018-07-12 21:39:18 +02:00
Zoran Vuckovic 544802e1a8 Add dinput rumble support 2018-07-05 20:01:23 +02:00
radius 717e45dc52 Add mouse wheel support
enable hold to bind on android

cleanup
2018-06-29 21:12:47 -05:00
radius fef9b63bc0 Revert "Disable ENABLE_TOUCH_SCREEN_MOUSE for now until issues are resolved"
This reverts commit 2b02616512.
2018-06-29 21:12:47 -05:00
Twinaphex fd11b205da Silence bunch of warnings 2018-06-21 07:52:01 +02:00
Twinaphex 467aa30131 Cleanups 2018-06-21 07:26:05 +02:00
twinaphex 981b0eec91 Take this out 2018-06-19 06:28:38 +02:00
twinaphex 54a95eed83 These defines are not available on Android NDK APIs lower than 24 2018-06-18 01:56:22 +02:00
Gregor Richards af357c1afe Fix input when the joypad driver is NULL. 2018-06-01 23:22:04 -04:00
Twinaphex 743ab2351c
Merge pull request #6829 from fr500/overrides
only apply deadzone on analog to digital remapping, not analog to analog
2018-05-27 21:08:52 +02:00
radius c2c5265916 only apply deadzone on analog to digital remapping, not analog to analog 2018-05-27 11:58:52 -05:00
misson20000 dd0ad28818 NSW: fix analog sticks 2018-05-24 00:18:38 -07:00
Tatsuya79 dd3c9dd838
call input_remapping_set_defaults before loading a new remap 2018-05-16 13:30:57 +02:00
radius f81ea09f20 add saving, deletion options for per-dir remaps 2018-05-13 23:17:44 -05:00
rsn8887 6d5115a50d (Vita/PSP) Use proper button labels, fix inverted R-Stick Y axis 2018-05-09 22:55:33 -05:00
Twinaphex 8484ea4154
Merge pull request #6672 from gblues/master
Cleanup of Wii U launcher code
2018-05-06 15:24:00 +02:00
ceb33 bafd2af885 remove custom debug output 2018-05-05 13:33:15 +02:00
ceb33 67784c85cf update and merge to current Retroarch version 2018-05-05 12:59:04 +02:00
ceb33 9008684651 re-add callback to manage usb device plugged in while retroarch is running 2018-05-05 12:48:01 +02:00
Twinaphex de1bf58997 Buildfix 2018-05-03 20:39:03 +02:00
twinaphex 3796e52018 (OSX) Go back to old code - connect handler was broken 2018-05-03 20:31:28 +02:00
Twinaphex 909ffd4de4
Update input_driver.c 2018-05-03 15:28:26 +02:00
twinaphex 4fac2b339c Remove unused variable 2018-05-03 13:20:05 +02:00
twinaphex 28025802da Try to fix build failure 2018-05-03 13:11:38 +02:00
gblues 84e9c93c35 quotes for some, braces for others 2018-05-02 22:37:34 -07:00
radius 7bdbd005a8 fix #6700 2018-05-02 23:32:40 -05:00
gblues 27bfcf3c77 Replace angle includes with quote includes
=== DETAILS

Replaced includes for things that aren't standard library headers so
they use quotes instead of brackets.

Also fixed up a couple of headers that had include-order dependencies.
2018-05-02 21:31:00 -07:00
twinaphex eac899f573 Try to fix build for targets that don't have HAvE_OVERLAY defined 2018-05-02 13:52:27 +02:00
gblues 7448fd3157 More code re-organization
=== DETAILS
Since @aliaspider wants the `wiiu/` to be something of a mini-SDK, I've
reorganized the code I put in there:

- `wiiu/main.c` now only has the ELF/RPX entrypoints, and the code used
  by those entrypoints, with RA code removed (e.g. swapped retro_sleep()
  for usleep()). These entrypoints then call main() ...
- Moved `main()` and its support functions back into `frontend/drivers/platform_wiiu.c`
  I also renamed some of the support functions I wrote, and better
  organized them within the code.
- Moved `wiiu/input/` into the `input/` hierarchy:

  * The joypad drivers now live in `input/drivers_joypad/wiiu/`
  * The HID driver now lives in `input/drivers_hid/`
  * The Wii U specific headers now live in `input/include/wiiu`
  * I added `input/include` into the include search path to avoid
    using really ugly relative includes
2018-05-01 23:23:40 -07:00
radius 3304dad729 fix #6631 2018-05-01 18:09:04 -05:00
Brad Parker a1aefc901c Qt WIMP GUI 2018-04-30 14:33:05 -04:00
radius 7b82c8a9bc fix #6644 2018-04-28 11:56:21 -05:00
radius 5e1a698fa2 fix #6644 2018-04-28 11:42:48 -05:00
gblues f378e2bfcf Fix WaveBird support for the Wii U GCA
== DETAILS
Thanks to JacobM at GBAtemp for helping me test this.

The WaveBird wasn't being properly picked up due to the port status byte
being different from normal GC controllers. (Why? who knows. Probably
so games could detect the WB and show WB-specific OSDs).

This implementation should be more future-proof, to handle any other
unexpected status bytes.
2018-04-25 21:28:33 -07:00
Twinaphex 6ac4032735
Merge pull request #6580 from gblues/gblues/hid
Working HID driver for Wii U [TESTING NEEDED]
2018-04-25 23:10:39 +02:00
gblues f6b33b1d30 missing file 2018-04-24 06:37:02 -07:00
gblues 1d84c0eca1 Fix analog for DS3, plus some cleanups
== DETAILS

- DS3 analog wasn't working mainly because I forgot to actually declare the
  axes in input/input_autoconfig.c when declaring the pad. Whoops.
- I also moved the axis decoding logic to a more central place, because it
  clearly is not Wii U specific.
- Removed some dead commented-out code

== TESTING

Can use analog inputs on both GCA and DS3. Tested in Mario 3 on Nestopia core.

Haven't tested with any actual analog games, but I did confirm via logging
that the correct ranges are produced.
2018-04-23 23:22:27 -07:00
gblues f7135bcee6 Fix analog reading on GCA
== DETAILS
After a little trial and error, I got analog input working for the
Wii U GC adapter.

DS3 might work, but it's untested.
2018-04-22 23:47:07 -07:00
gblues ed742c48e0 Fix hotplugging
== DETAILS
So, it turns out that there *is* a autoconfig disconnect handler. Took digging
through tasks/task_autodetect.c to find it!

So, I added a call to the handler when the pad gets disconnected.

This seems to solve the problem of the pad not disappearing from the menu.

(At the very least, the user's pad index reverts to "none" which is still
an improvement)

== TESTING
Tested manually, made sure it didn't crash or leak slots.
2018-04-22 17:34:20 -07:00
gblues 0c92fab0b9 Fix GameCube button detection
This should fix the issue where R/L buttons didn't register when doing
input detection.

This also brings the GC pad in line with the rest of the gamepads in
input_autodetect_builtin.c.

Also fixed a really stupid bug that was part of why analog inputs aren't
being read. Analog still isn't working, mind, but it's a lot closer to
working now that it's actually getting down into the pad driver level!
2018-04-20 00:00:33 -07:00
gblues 53738e4a0d Allow Wii U GCA to work without 2nd cable attached
=== DETAILS

So, the GCA has 2 USB connections; one is the data connection, and the
second is used to drive rumble.

Due to a driver bug, if the second cable wasn't attached, the pads wouldn't
get detected.

I fixed that bug.
2018-04-18 23:12:45 -07:00
radius 8198e5c0b2 fix #6596 2018-04-19 09:54:16 -05: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 4cd301bd92 Add pad unregistration
== DETAILS

I think this will fix the problem with duplicate pads--pads weren't properly
de-initializing and registering as disconnected. When a pad is disconnected,
the slot should properly release now.
2018-04-14 21:30:44 -07:00
gblues 6ab91a422e Small cleanup to adapt to upstream code changes
retro_bits_t turned into input_bits_t and there were parts of my
code that needed to update.

== TESTING
No idea if upstream changes broke anything, but it compiles cleanly
now.
2018-04-14 14:34:13 -07:00
gblues fb5b31faf3 Merge branch 'master' into gblues/hid 2018-04-14 14:18:03 -07:00
gblues 97e09d179f Fix deadlocks when device is unplugged
== DETAILS
TIL that it's bad to call synchronization code from callbacks.

To avoid that, I made the following changes:

- Implemented an atomic swap (see previous commit) to avoid explicit
  locking when working with the event list
- ensure locks are only acquired in either the main thread or the
  I/O polling thread
- use an explicit polling loop; we still use async reads, but the
  read doesn't immediately re-invoke itself.
- remove the sleep in the polling thread.
- remove unnecessary locking in the thread cleanup call--verified that
  the list can't be modified while it is being executed.

== TESTING
I tested locally, and was able to disconnect/reconnect USB devices several times without the worker thread getting deadlocked.
2018-04-14 13:30:34 -07:00
gblues dca36ebaf8 Add small snippet for atomic value swapping
Fortunately, the gcc port implements the builtins and, from basic
testing, they seem to work.

This is only really useful on Wii U--other platforms have more
robust atomic operations, or aren't using gcc to build.
2018-04-14 01:26:26 -07:00
twinaphex 6761ec471d Silence some Coverity warnings 2018-04-12 21:39:31 +02:00
twinaphex 0fb766b921 Move variables 2018-04-09 16:15:31 +02:00
twinaphex be5057eafc Cleanups 2018-04-09 00:38:44 +02:00
twinaphex a5c7b79842 Move BIT256_CLEAR_ALL_PTR outside of function 2018-04-09 00:34:07 +02:00
twinaphex 7b5a0bf706 Move clear operation outside of keys_pressed functions 2018-04-09 00:31:03 +02:00
Andrés 47a528801d
Merge pull request #6547 from fr500/master
add comment
2018-04-08 17:22:32 -05:00
twinaphex 2cb14e730f Initialize to false by default 2018-04-09 00:21:22 +02:00
radius 215868f755 add comment 2018-04-08 17:21:17 -05:00
radius 066d181535 cleanup 2018-04-08 16:58:48 -05:00
twinaphex 4cd4de3bd3 Simplify input_overlay_add_inputs_inner 2018-04-08 23:20:06 +02:00
Twinaphex 8dc63653e5 Remove unused variables 2018-04-08 23:17:45 +02:00
twinaphex 3a4d094277 MSVC buildfix 2018-04-08 23:13:20 +02:00
twinaphex bc70477005 (input_mapper.c) Some more refactors 2018-04-08 23:08:21 +02:00