Commit Graph

44 Commits

Author SHA1 Message Date
libretroadmin
6728d5a2fa (Subsystem) Cleanups 2023-02-19 12:15:45 +01: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
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
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
twinaphex
a01380f847 (WiiU) Buildfixes 2020-07-23 18:01:15 +02:00
twinaphex
de73e3bff9 Buildfixes 2020-07-19 03:25:30 +02:00
twinaphex
b1a6b35379 Buildfix 2020-07-19 03:23:07 +02:00
twinaphex
08ad00f5d3 Start preparing for being able to grab multiple buttons at the same time 2020-07-18 19:51:14 +02:00
Ash Logan
41541128c5 (WiiU/hid) Warning fixes 2020-05-17 16:42:31 +10:00
Ash Logan
cdaf907467 (WiiU/hid) hid.h only used in drivers_hid/wiiu, don't include everywhere 2020-05-17 16:39:41 +10:00
Ash Logan
f22af81e7d (WiiU/wpad) Allow hotplugging Gamepad, support >1 channel 2020-05-17 16:32:51 +10:00
twinaphex
7748ac207c Split up blissbox code into separate file
tasks/task_autodetect_blissbox.c
2020-01-19 06:40:07 +01:00
orbea
e13ec54dc6 Fix --disable-overlay. 2019-07-21 10:26:42 -07:00
twinaphex
ee3208ac39 Integrate video_driver.c into retroarch.c 2019-06-17 15:10:22 +02:00
Brad Parker
1120a7e490 Bliss-Box: add additional pad types from firmware 3.0 2019-06-03 23:40:31 -04:00
Twinaphex
8db0e2db7c
Revert "xfree86_keycodes: Add non-evdev keycodes to fix keyboard input on non-Linux systems with X11." 2019-05-21 17:15:59 +02:00
nia
cdcb819a79 xfree86_keycodes: Add non-evdev keycodes. 2019-05-18 17:11:42 +01:00
Brad Parker
ed5bd8023e Bliss-Box: add PSX Jogcon ID 2019-03-09 18:04:03 -05:00
Brad Parker
4f0d61a2ac update copyright 2019-02-22 19:13:36 -05:00
orbea
8ff0b14281 Fix C89_BUILD=1. 2019-02-06 09:16:26 -08:00
orbea
28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
David Skywalker
347519a4d8 now X11 driver using keycodes instead keysyms, fixes international layouts problems. 2019-01-31 12:50:58 +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
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
gblues
84e9c93c35 quotes for some, braces for others 2018-05-02 22:37:34 -07: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
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
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
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
4433cbebc6 Get digital inputs for Sony DualShock 3 working
== DETAILS

- fix the bitshift math
- read the right bytes out of the ds3 data packet
- remove verbose logging in critical path
- stop caring about errors in the hid read loop -- seems to just
  be benign "device not ready" -- or at least, that's what I'm assuming
  given that the read eventually succeeds.

== TESTING
Played Mario 3 with the DS3 with no issues.
2018-04-05 23:03:38 -07:00
gblues
af08e5015a More work on Dual Shock 3 driver
== DETAILS

- update to not try starting the read loop until after the device
  is successfully initialized
- add new HID wrapper macros needed by ds3 driver
- add some debug logging to help with troubleshooting
- add button map for DS3

== TESTING
Tested with local build. DS3 init is not working.
2018-04-02 23:16:49 -07:00
gblues
9bc5a15c2d Enable pads to register in any order
== DETAILS

Whereas the last commit had a hack (that disabled the wiimote
driver in the process), this has.. well, a *different* hack that
allows pads to register in any order.

Note that due to the initialization routines, the gamepad will still
likely always get slot 0. Not sure if this can be overridden via config
or not.

== TESTING

Tested locally with GC adapter
2018-04-01 18:52:26 -07:00
gblues
2cf89feb86 Code clean-up
== DETAILS

Now that I have a working implementation, it's time to tidy up a bit:

- there was no need for the HID subsystem's object data to have a reference
  to the global hid state (since it's global), so removed it.
- refactored the users of that member to use the global state, defining
  reusable macros.
- reorganized the information in *.h files
- removing the hid state also made the constructor changes to the hid driver
  unneeded, so I reverted those changes.

== TESTING
Confirmed clean build. Haven't tested the build yet to make sure everything
still works, though.
2018-03-31 22:25:30 -07: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
dc6f4c23ed Rename hid_driver_instance members for clarity 2018-03-29 23:37:11 -07:00
gblues
0100d58ffb WIP: evolve driver implementation
== DETAILS

I've created the concept of a hid_driver_instance_t which is basically
a central place to store the hid pad driver, hid subsystem driver,
the pad list, and the instance data for the above in a central location.

The HID pad device drivers can use it to perform HID operations in a
generic manner.

This is more-or-less a pause point so I can catch up with upstream.

== TESTING

Haven't tested this yet. Compiles without warnings though!
2018-03-29 23:37:11 -07: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
bparker06
78bf72e29e
blissbox: add atari pad type 2017-12-02 13:33:09 -05:00
Brad Parker
def24ef8eb blissbox: print message if detecting update mode or old firmware versions, override vid/pid check for autoconfig profiles, misc comments 2017-11-28 21:25:54 -05:00
Brad Parker
2dd64d9c11 Initial blissbox support, requires firmware 2.0. Currently limited to platforms with libusb support. 2017-11-28 18:25:12 -05:00
Twinaphex
a26482d302 (mfi_joypad.m) Use local headers 2015-11-17 08:29:21 +01:00