410 Commits

Author SHA1 Message Date
twinaphex
0731a79a4f Pass this to XInputOpen 2018-01-19 06:56:44 +01:00
twinaphex
f71bbeae9f (XDK) Try to autodetect all pads at startup 2018-01-19 06:49:52 +01:00
twinaphex
61ff51be2f Start using string_is_equal predominantly 2018-01-16 22:53:38 +01:00
Toad King
4fd750b48a add builtin autoconf script for emscripten gamepads with "standard" mapping 2018-01-14 04:24:37 -06:00
Toad King
b3900217da clamp axis values to -1.0 - 1.0, at least firefox can report values outside that range 2018-01-14 03:43:23 -06:00
Toad King
1f8a85615c don't always clear poll state 2018-01-14 02:34:38 -06:00
Toad King
de3581de73 fix analog sticks 2018-01-14 01:35:28 -06:00
Toad King
15c3f56b37 fix phantom button presses 2018-01-14 01:00:46 -06:00
Toad King
21d928ba0e add joypad driver for emscripten 2018-01-14 00:15:30 -06:00
gblues
5894d0ef86 Remove all HID code from WiiU build via ifdef
== DETAILS
We're trying to track down the source of crashes when switching cores.
To rule out the HID code, this commit does the following:

- Wraps the library imports in an ifdef
- Wraps the object files in conditionals in Makefile.wiiu
- In wiiu_joypad, calls into the hidpad driver are wrapped in ifdef

== TESTING
This didn't solve the "System memory error" crash I've been experiencing.
But, maybe it will impact the other flavors of crashes others are seeing.
2018-01-07 20:26:24 -08:00
vgmoose
890de0e79b allow joycons to work while attached 2018-01-07 12:10:28 +01:00
twinaphex
edb8ecdbf8 (xdk_joypad.c) Add C codepath for XGetDeviceChanges 2018-01-03 14:13:29 +01:00
twinaphex
2884ad2d73 (360) Some buildfixes 2017-12-31 06:09:39 +01:00
misson20000
7cc614263a (NSW) add default button bindings and fix right joystick 2017-12-31 03:04:11 +01:00
Twinaphex
0389bc64fe
Merge pull request #5997 from libretro/new_hid
New HID system (courtesy of gblues)
2017-12-30 15:30:03 +01:00
twinaphex
20bb653f1e (Xbox 360) Buildfixes 2017-12-30 12:36:00 +01: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
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
5c876647ed (NSW) Small cleanups 2017-12-29 00:45:00 +01:00
misson20000
6d2a7b1f26 Nintendo Switch (libtransistor) port 2017-12-29 00:10:01 +01:00
Brad Parker
6d484b7724 xinput: check for valid function pointers before calling them 2017-12-23 23:02:29 -05:00
gblues
0f7de204f7 Last batch of whitespace cleanup (post-rebase)
-- looks like a few files committed with DOS line endings
2017-12-12 00:24:46 -08:00
gblues
6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
twinaphex
c950613098 C comments 2017-12-11 11:28:48 +01:00
Peter Y. Hammond
b14598657c Fixed a bug where the joypad devices were not always being assigned in the same order as they were numbered under /dev/input/. This showed up mainly when using an external USB Bluetooth dongle. In that case, controllers would be assigned often in reverse order. 2017-12-10 22:22:01 -07:00
twinaphex
de9b0127f8 (MSVC) Buildfix 2017-12-06 04:33:54 +01:00
Andrés
0c9fce98a2 fix vid/pid enumeration on xinput controllers when the xinput controllers are interleaved with dinput (#5872) 2017-12-05 22:07:48 -05:00
Brad Parker
f5ea4a0c65 dinput: add missing function parameter 2017-12-05 17:19:17 -05:00
Brad Parker
bc4bbe79aa don't define UNICODE at all, we don't need it and it causes dinput problems (names are wchar_t) 2017-12-05 14:26:59 -05:00
twinaphex
2bdf4a5bb4 update 2017-12-05 20:08:18 +01:00
twinaphex
408878a7e1 Start making it possible for xinput_joypad to be used without
DirectInput
2017-12-05 20:04:12 +01:00
Brad Parker
35ab48ee61 xinput: copy VID/PID from dinput so autoconfig does not rely solely on HID name 2017-12-05 12:47:52 -05:00
twinaphex
f0c143766e Change to 256bit macros 2017-12-05 12:07:35 +01:00
twinaphex
6c09661a64 Move defines to retro_miscellaneous.h 2017-12-05 10:42:37 +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
Ash
bf3e256a43
[WiiU] Input: Make controller_patcher a compile-time option
As discussed in libretro#5357; controller_patcher is now optional. It's
off by default; though this could be changed with a simple makefile
tweak (ENABLE_CONTROLLER_PATCHER ?= 1, perhaps?)

To re-enable controller_patcher; append ENABLE_CONTROLLER_PATCHER=1 to
your usual make command.

controller_patcher was the only user of c++ constructors in the Wii U
port, so you'll need 26a006c in your tree otherwise you will have a
blackscreen on startup.
2017-12-01 18:29:21 +11:00
David Walters
c5bdc02d6f replace uint64_t with retro_bits_t* for pad buttons state 2017-11-28 10:04:34 +00:00
Ash
efad07e89f
[WiiU] Add proper DRC touch scaling for non-720p resolutions 2017-11-19 17:18:03 +11:00
Twinaphex
b8df76271c
Merge pull request #5654 from QuarkTheAwesome/wiiu-warnings
[WiiU] Various warning fixes
2017-11-05 16:14:18 +01:00
Ash
6090aa8f8a
[WiiU] Account for 12px clamp on physical screen
Seriously, I think it's good now.
2017-11-04 20:58:25 +11:00
Ash
e39c820cee
[WiiU] Change up wiiu_joypad_name semantics
Prevents warnings from GCC around the possibility of a negative index
going into hidName.
2017-11-04 20:37:30 +11:00
Ash
fc79fec964
[WiiU] DRC Touch - scale to game image viewport 2017-11-04 16:14:28 +11: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
Glenn
ec806f65f9 fixed MFI controller being set to P2 2017-10-29 18:20:39 +11:00
Francisco José García García
03524278c6 Trying to fix L2/R2/L3/R3
Related to #5431
2017-10-25 21:05:15 +02:00
Maschell
05ef63fd08 [WII U] Fix for Issue #5556
This hopefully fixes the issues when you try to use 2 Controllers with
the same vid/pid at the same time.

Tested with 2 DS4 controller via the Hid to VPAD Network Client.
Adapters with multiple ports (like the official GC-Adapter) are still
working
2017-10-17 21:38:42 +02:00
Brad Parker
38c30667c5 fix include paths 2017-10-14 23:08:43 -04:00
twinaphex
d10de20bff Start compiling Griffin as C for 360 - C89 fixes 2017-10-03 04:11:41 +02:00