Commit Graph

4004 Commits

Author SHA1 Message Date
twinaphex
5ec93d2493 (HID) Fix some warnings 2021-10-20 02:23:01 +02:00
twinaphex
1dc77507a8 Fix command stdin - courtesy of Cthulhu 2021-10-19 22:23:07 +02:00
Autechre
514534f99b
Move more state to runloop_state (#13124)
* Move more state to runloop state

* remove unused variable

* Cleanup

* Move more state to runloop_state

* Remove unused variable

* Cleanups

* move input_remapping functions over to input_driver.c

* Some buildfixes
2021-10-18 15:23:22 +02:00
grant2258
6e8a3945d5 add extra abs check for dolphinbar 2021-10-18 03:43:49 +01:00
Nathan Strong
12a44e0365 Fix crashes reported by ploggy
== DETAILS

The crashes he reported in the gbatemp thread are due to iface
being null (since it's an unsupported device) and unchecked
iface dereferences.
2021-10-17 00:13:48 -07:00
Nathan Strong
5b4b766459 Fix wiimotes regression
== DETAILS
- only call disconnect when we're actually disconnecting a remote
  (e.g. read errors or remote goes to sleep).
- clean up some compile warnings introduced by others (mainly
  unused variables)
2021-10-16 23:56:15 -07:00
Nathan Strong
81c6d3809a Finish up the OSX DS3 driver
== DETAILS
Put the finishing touches on getting the DS3 to work on Mac OSX.

Basically, there's some differences in the HID interface bewtween
wiiu and osx where OSX expects the first byte of the report to be
the report ID, while wiiu expects that byte to be trimmed off.

I was able to put this behavior in the respective HID
implementations, which eliminated the confusing packet offset
ifdefs.

And, I was able to get the LEDs working again.
2021-10-16 14:52:56 -07:00
Nathan Strong
729c219f1a Rewrite DS3 driver
== DETAILS
The DS3 driver previously only worked with the Wii U HID implementation.

I adapted this driver from the Linux driver for the DS3. It's not quite
100%--I haven't got the LEDs to work properly--but it's functional.

Going to continue tweaking it to see if I can get the LEDs to work.
2021-10-16 14:52:56 -07:00
Nathan Strong
7ed3ca7f97 WIP commit
Start trying to adapt the linux DS3 driver instead of our
hacked-together support.
2021-10-16 14:52:56 -07:00
Autechre
c1b002e454
Merge pull request #13125 from grant2258/mouse
Udev pointer pressed update to support relative devices pointer pressed
2021-10-16 22:10:36 +02:00
grant2258
1fca7507dc cleanup 2021-10-16 19:36:35 +01:00
grant2258
a68e5205bd add relative left mouse button when pointer device is not abs 2021-10-16 19:26:40 +01:00
twinaphex
9184d0e114 Move hid_data to input_st 2021-10-15 16:31:31 +02:00
twinaphex
f070da6dfc Move code to menu_driver.c and input_driver.c 2021-10-13 15:40:01 +02:00
Autechre
0a888f7868
Move video state to gfx/video_driver.c - reduces filesize of retroarch.c to 809kb (#13104)
* Move video state to gfx/video_driver.c - reduces filesize of retroarch.c
to 809Kb
2021-10-13 14:56:22 +02:00
jdgleaver
f1ac1ad9f9 (Dingux) Fix HAS_ANALOG/HAS_MENU_TOGGLE defines in sdl_dingux joypad driver 2021-10-13 12:53:54 +01:00
Kirby Kevinson
177d05144a
Fix keyboard input on Wayland (#13102)
Fixes #13036
2021-10-11 13:20:41 +02:00
gblues
dd6c70a083
Fix a couple regressions (#13101)
== DETAILS

- rewrote the HID deregistration algorithm; it should no longer
  cause issues when dealing with multiple pads of the same HID/VID
  combo
- fix initialization bug that caused wiimotes to fail to register
  without an accessory attached
2021-10-11 09:39:13 +02:00
twinaphex
bcc7581250 (joypad_connection.c) Cleanups - style nits - comment out some logs
that were generating warnings
2021-10-09 16:19:54 +02:00
Salvador
58e7dd8a1a
Add Miyoo target (#12860)
* add miyoo target
2021-10-08 13:53:49 +02:00
twinaphex
3d710db798 input_state_wrapper symbol name was causing collisions with certain
cores on statically linked platforms
2021-10-08 12:50:45 +02:00
twinaphex
e39bc07e31 Fix implicit declaration 2021-10-08 06:57:37 +02:00
Nathan Strong
ea249b3827 Get the WIIU GCA working on Mac OSX
== DETAILS
The GCA uses a weird HID class that our current filters don't
catch, so we add it.

Needed to do a small amount of tweaking on the GCA driver to
account for iohidmanager weirdness.
2021-10-06 23:11:22 -07:00
Autechre
3f179a5762
Merge pull request #12632 from Sunderland93/remove-xdg-shell-v6
[Wayland] Remove xdg-shell-v6 protocol
2021-10-07 05:10:53 +02:00
Autechre
54cbeecbb7
Merge pull request #13075 from libretro/move-more-code-to-input-driver
Move more code over to input_driver.c
2021-10-06 12:38:21 +02:00
Nathan Strong
01e96585a3 Fix crash when connecting DS3 to Mac
== DETAILS
The OSX HID driver doesn't implement `set_protocol()` and crashes
with an NPE, so we guard it.
2021-10-05 23:57:09 -07:00
twinaphex
61ee2274e6 Move more code over to input_driver.c - BSV code in particular but
also input state function callbacks - retroarch.c code size reduced
to 874Kb
2021-10-06 05:57:39 +02:00
twinaphex
55bf2b0083 (input/connect) Style nits 2021-10-06 02:52:19 +02:00
twinaphex
f81a231481 (joypad_connection) Cleanups - get rid of warning for old-style function
definition
2021-10-06 02:28:55 +02:00
Nathan Strong
e8ec65ecf7 squelch format warning 2021-10-05 19:05:12 +00:00
Nathan Strong
3e91e3fbc9 fix up non-wiiu side of ifdefs for ds3 2021-10-05 18:15:19 +00:00
Nathan Strong
002c9a30c0 Implement button() for most HID drivers
== DETAILS
The HID drivers in `input/connect/` were missing an implementation
for button(), so I added it. The only exception is the wii driver,
which is really complicated and more than I wanted to try to tackle--
especially since WIIU has its own wiimote drivers.
2021-10-05 17:43:03 +00:00
Nathan Strong
e02e345a28 Make GCA driver compatible with other HID drivers
== DETAILS
Use a little trickery to ensure the GCA driver continues working
with other HID implementation.

I've expanded the joypad implementation to support multi-pad devices.
However, this requires changes to each HID implementation to actually
function.

I've made the necessary changes for WIIU, but I don't have the means
of making the change in the other HID implementations.

So, I've built in a backwards-compatibilty mode for the driver.

The trick is to have an identifier byte at the top of both data structs
that the driver returns. We can then use that byte to determine which
of the structs has been passed to the pad functions and act accordingly.

In the GCA case, for non-wiiu platforms, it will simply expose port 1
of the GCA and the other 3 ports do nothing.
2021-10-05 09:47:03 -07:00
Nathan Strong
2715b4c9c0 get gamecube adapter working 2021-10-05 09:23:08 -07:00
Nathan Strong
c832828ddb Figured out the cause of crash
== DETAILS
cause of crash: trying to deference init when it's null
the reason it was going into deregister: the HID/VID lookup was
failing because it wasn't getting initialized first
cause of 2nd crash: the "end of pad list" method looked for an entry
with a magic value, so we add an end marker
2021-10-05 09:23:08 -07:00
Nathan Strong
a4d8ce7753 Try to support multi-pad HID devices
== DETAILS
I tried to modify the joypad connection interface to support
multi-pad HID devices ... it doesn't work. I'm not sure why.
2021-10-05 09:23:08 -07:00
Nathan Strong
9846ebb171 enable GCA adapter, minor cleanup
== DETAILS

I'm going to need to re-implement the abstraction between HID device
and gamepad; the changes here lay down some foundation for that work.

- reduce logging priority of some statements I modified while debugging
- factor out the pad driver lookup into its own method
- fix so the pad driver list isn't re-initialized every invocation
- add the button() method for the GCA driver
2021-10-05 09:23:08 -07:00
Nathan Strong
5da1cd08ff Unify the HID driver architecture
== DETAILS
When I first implemented the Wii U HID architecture, I ended up
having to design my own implementation because, at the time, I did
not have a way to read the HID device string to allow the existing
code to successfully detect the gamepad.

After spending some time experimenting, I've figured out how to
do this. And that means I can better align the HID driver with other
platforms.

change summary:

- create a single state structure for all three sub-types of wiiu pads
  (kpad, wpad, and hid)
- eliminate confusing duplicate pad lists
- eliminate confusing duplicate HID pad drivers (ds3, gamecube
  adapter, etc)
- ensure the ds3 driver still works
2021-10-05 09:23:08 -07:00
Nathan Strong
9edb449471 wip commit 2021-10-05 09:10:41 -07:00
p-sam
54d2ac9f43 libnx: Splitted Joycons button mapping
- Minus/Plus is always Plus when splitted (JOYPAD_START)
- StickR/StickL is always StickL when splitted (JOYPAD_L3)
2021-10-01 20:18:54 +02:00
twinaphex
fde3406d1b Get rid of input_event_get_osk_ptr/get_osk_grid 2021-10-01 07:37:33 +02:00
Autechre
8807e2957e
Input refactors pt3 (#13053)
* Move more internal state over to input_driver.c and menu_driver.c -
retroarch.c now down to 893kb
- Remove now unused p_rarch pointers in functions
2021-10-01 07:18:30 +02:00
twinaphex
e9a4e811ac Move more code and variables from rarch_state out to input_driver
and menu_driver
2021-10-01 00:41:50 +02:00
twinaphex
49fbed2423 Get rid of input_mouse_grabbed - move retroarch types to
retroarch_types.h
2021-09-30 23:22:50 +02:00
twinaphex
12c81bc073 Replace input_state_get_ptr call 2021-09-30 21:31:37 +02:00
twinaphex
dbe414e1e1 move input_poll_overlay to input_driver.c 2021-09-30 21:29:35 +02:00
twinaphex
ddceb51f89 Get rid of some needless getters/setters 2021-09-30 21:10:12 +02:00
twinaphex
ef875f6102 Create input_state_get_ptr - move to input_driver.c -
also moved over the functions that had a dependence on this
state - retroarch.c reduced to 979kb now
2021-09-30 20:54:56 +02:00
twinaphex
e886e908d5 Create consistent naming conventions - use retroarch_ instead
of rarch_ for some functions for all functions coming from retroarch.h
2021-09-28 12:56:10 +02:00
twinaphex
8ef9065c86 Get rid of menu_driver_is_alive - we don't want these one/two-line getters/setters anymore 2021-09-28 10:27:00 +02:00