Commit Graph

41403 Commits

Author SHA1 Message Date
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
d0adbd194e Revert changes to joypad API
== DETAILS

Premature. Still learning my way around the codebase.
2017-12-30 04:40:53 +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
5804233ca8 Start fleshing out wiiu_hid driver
== DETAILS

- Added entrypoints into `input/connect/joypad_connection.c` to allow
  a max value to be passed in, instead of using single macro value
- Created a hand-off between the HID attach handler and the worker thread
- Created a pad initializer in `wiiu_hid.c` leveraging the new functionality
  added to `joypad_connection.c`

== TESTING
Compiles cleanly. At best, doesn't do anything. Might crash--not ready
to test quite yet.
2017-12-30 04:40:39 +01:00
gblues
e98b006715 HID worker thread is now operational
== DETAILS
After wasting some cycles trying to isolate a crash, I went back to
basics.

I enabled the network logging, and put in a bunch of logging lines,
and noticed that the HID thread wasn't actually starting.

I did quite a bit of experimenting, working with different
memory alignments, and finally got it working.

== TESTING
As you can see, I put a log output inside the worker thread. When
I run the build, I can see the TICK messages. I can also see that
the thread shuts down as expected.

Also! The HID callback works as expected too! I have the GC
adapter, and when I register the HID callback it fires and I get the
following data:

    [INFO] USB device attach event
    [INFO]                 handle: 2058729
    [INFO]   physical_device_inst: 0
    [INFO]                    vid: 0x7e05
    [INFO]                    pid: 0x3703
    [INFO]        interface_index: 0
    [INFO]              sub_class: 0
    [INFO]               protocol: 0
    [INFO]     max_packet_size_rx: 37
    [INFO]     max_packet_size_tx: 5

Note that these are raw dumps of the data passed to the method,
so e.g. the VID/PID might be byte-swapped from how they're usually
represented.

Have not done the stress test to try to reproduce the crash.
2017-12-30 04:40:33 +01:00
gblues
192f5875b9 Simplify, add logging, revert some of the changes
== DETAILS
The old code was crashing; I did a minimalized branch and the crash
went away, so I'm bringing that over here. Meaning I'll have to
redo some of the other work I'd put in, but oh well.

(now watch it start crashing again)

== TESTING
Can confirm it builds. Wii U is busy ATM so I can't test.
2017-12-30 04:40:23 +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
gblues
d0368124e6 Add OSFastMutex WiiU calls to list of imports 2017-12-30 04:40:10 +01:00
gblues
5c5e5be649 More progress on the HID driver
== DETAILS
I think I've about got the thread startup/teardown code worked
out. Logically, anyway, if not accurately.

The challenge has been figuring out how best to integrate the
features of HID2VPAD.

I found `input/connect/joypad_connection.c` and this seems like
the logical place for:

- Special-case driver for the Switch Pro controller
- Any other special cases HIDTOVPAD supports that core RetroArch
  doesn't
- Parsing of HIDTOVPAD config file to add custom button mapping

== TESTING
Compiles. Haven't tested with a real Wii U. Probably doesn't work
though. I very likely have the threading bit wrong.
2017-12-30 04:40:01 +01:00
gblues
c3736adb77 Start implementing HID polling thread
== DETAILS

Looking at the other HID USB drivers, it looks like the typical
implementation is to start up a background thread to do the
polling, rather than wait for RA to invoke the poll() method.

This commit sets up the skeleton of the background thread:

- The thread gets created in init()
- The thread gets stopped in free()

Right now the body of the thread is a 10ms sleep.

== TESTING

It compiles cleanly, and links. Don't know if it actually works.
2017-12-30 04:39:56 +01:00
gblues
203876a206 More progress on the HID driver
== DETAILS
I think I've about got the thread startup/teardown code worked
out. Logically, anyway, if not accurately.

The challenge has been figuring out how best to integrate the
features of HID2VPAD.

I found `input/connect/joypad_connection.c` and this seems like
the logical place for:

- Special-case driver for the Switch Pro controller
- Any other special cases HIDTOVPAD supports that core RetroArch
  doesn't
- Parsing of HIDTOVPAD config file to add custom button mapping

== TESTING
Compiles. Haven't tested with a real Wii U. Probably doesn't work
though. I very likely have the threading bit wrong.
2017-12-30 04:39:44 +01:00
gblues
1657079c45 Start implementing HID polling thread
== DETAILS

Looking at the other HID USB drivers, it looks like the typical
implementation is to start up a background thread to do the
polling, rather than wait for RA to invoke the poll() method.

This commit sets up the skeleton of the background thread:

- The thread gets created in init()
- The thread gets stopped in free()

Right now the body of the thread is a 10ms sleep.

== TESTING

It compiles cleanly, and links. Don't know if it actually works.
2017-12-30 04:39:39 +01:00
gblues
7e56881b88 Some cleanups 2017-12-30 04:39:34 +01:00
gblues
3b92cce6bf Start wiring up the HID driver
- add alloc/free for necessary objects
- register callback with Wii U OS

Don't think I've put the unregister bit in, so this is very likely
broken.
2017-12-30 04:39:25 +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
a792112bd1 Update glslang support for MSVC 2017-12-30 04:36:35 +01:00
twinaphex
d49b7b28b6 input_poll - cleanup 2017-12-29 23:12:35 +01:00
twinaphex
a6afddae04 current_input_data and current_input are no longer globals 2017-12-29 23:03:25 +01:00
Alcaro
ad7dd75458 this name makes slightly more sense. 2017-12-29 21:16:28 +01:00
Alcaro
fc725e252e Maybe #5989 can accept this compromise 2017-12-29 21:15:25 +01:00
Twinaphex
22062fdf91
Merge pull request #5991 from orbea/gl
qb: Include /usr/local/include for bsd based systems.
2017-12-29 21:08:41 +01:00
Twinaphex
c4049946ea
Merge pull request #5990 from orbea/revert-5983-patch-1
Revert "config.libs.sh: reintroduce HAVE_X11 check"
2017-12-29 21:08:10 +01:00
orbea
6ab2244a43 qb: Do not check for x11 when using --disable-x11. 2017-12-29 11:25:35 -08:00
orbea
72e3d5c38c Makefile: Fix debug builds. (#5989)
RetroArch builds debug builds by default after commit ec4b0f9089
This is very bad and breaks ./configure && make.
2017-12-29 14:00:53 -05:00
orbea
a34555c9a9 qb: Include /usr/local/include for bsd based systems.
This resolves an issue where the default freebsd compiler does not
include /usr/local/include which contains important headers such as
GL/gl.h and results in the check_header function failing to find them.

Unfortunately pkg-config/pkgconf will not work here for two reasons.
1. It does not seem able to actually check for gl.h which RetroArch
explicitly needs.

2. Not all systems have a pkg-config implementation so we will still
have to fall back to checking for gl.h...

Fixes https://github.com/libretro/RetroArch/issues/5958
2017-12-29 10:23:14 -08:00
orbea
eaccab5237
Revert "config.libs.sh: reintroduce HAVE_X11 check" 2017-12-29 18:04:07 +00:00
Alcaro
ec4b0f9089 What kind of bug farm is this filestream thingy 2017-12-29 15:32:07 +01:00
twinaphex
8c2070947e Prevent some warnings 2017-12-29 13:00:24 +01:00
Twinaphex
c872edcc2b
Merge pull request #5986 from RobLoach/patch-25
xmb: Add a few icons to the menu
2017-12-29 09:23:55 +01:00
Rob Loach
0a65875956
xmb: Add a few icons to the menu 2017-12-29 02:18:40 -05:00
Twinaphex
96f5323723
Update CHANGES.md 2017-12-29 06:57:17 +01:00
Twinaphex
ba8b5749ac
Merge pull request #5985 from meepingsnesroms/master
Basic networking for 3DS, bug fixes
2017-12-29 06:56:45 +01:00
meepingsnesroms
7dbaa45172 Basic networking, bug fixes
Fix CPU count bug, make 3ds compile with networking
2017-12-28 21:49:21 -08:00
Twinaphex
688443b9a6
Merge pull request #5984 from RobLoach/slow-motion-granularity
settings: Add Slow Motion Ratio granularity
2017-12-29 06:00:09 +01:00
Rob Loach
10076706b5
settings: Add Slow Motion Ratio granularity
This makes it so that the Slow Motion setting can be set to something like 1.2, rather than 1 increments.

Fixes #5917
2017-12-28 23:51:41 -05:00
Twinaphex
c7c0ba7d03
Update CHANGES.md 2017-12-29 05:07:40 +01:00
twinaphex
893cd2b472 Make this C89-compatible 2017-12-29 04:46:13 +01:00
misson20000
3101ee8036 (NSW) fix compilation errors and warnings for switch drivers 2017-12-29 04:45:25 +01:00
Twinaphex
64ceabfc9d
Merge pull request #5983 from psyke83/patch-1
config.libs.sh: reintroduce HAVE_X11 check
2017-12-29 04:08:49 +01:00
Conn O'Griofa
010aa8061f config.libs.sh: reintroduce HAVE_X11 check
Current behaviour would force check_val to check for X11 even if explicitly disabled.

Fixes Raspberry Pi build (which requires --disable-x11).
2017-12-29 02:10:19 +00:00
Twinaphex
258c8acdad
Update switch_audio.c 2017-12-29 02:28:34 +01:00
Alcaro
353b2ebff6 Make this thing more like stdio 2017-12-29 01:38:59 +01:00
Twinaphex
e6462de5be
Merge pull request #5982 from celerizer/master
Fix unofficial achievements not being loaded
2017-12-29 00:55:57 +01:00
celerizer
a2ab7defa9
Fix unofficial achievements not being loaded
RetroArch is currently returning only achievements with flag 3 from the site, regardless of whether "Test Unofficial" is on or not. This change makes RetroArch return every achievement from the site when this the option is on or only those marked with Flag 3 (core cheevos) when off.
2017-12-28 17:48:58 -06:00
twinaphex
5c876647ed (NSW) Small cleanups 2017-12-29 00:45:00 +01:00
Twinaphex
946b765e61
Merge pull request #5981 from celerizer/master
Support Neo Geo Pocket
2017-12-29 00:13:22 +01:00
Twinaphex
817247851f
Update CHANGES.md 2017-12-29 00:12:01 +01:00
misson20000
1d6e8baa03 improve switch audio driver buffering behaviour 2017-12-29 00:10:01 +01:00
misson20000
033a7259b4 audio driver for the switch 2017-12-29 00:10:01 +01:00
misson20000
6d2a7b1f26 Nintendo Switch (libtransistor) port 2017-12-29 00:10:01 +01:00