98 Commits

Author SHA1 Message Date
aliaspider
a7632620da (WIIU) add a sprite shader. 2018-01-04 17:38:04 +01:00
aliaspider
e63697dca7 (WIIU) fix net logger. 2018-01-04 17:21:16 +01:00
gblues
80cdb92154 Re-re-fix wpad scaling. For real this time.
== DETAILS

@r-type got me the link to the fixed-fixed version.

Which was actually closer to where I was originally!

So:

- Revert the previous commit
- Apply the actual changes needed to fix the problem
- Bring in and fix the logging code from the previous implementation

== TESTING
- Verified that top-left is -0x7fff,-0x7fff and that bottom-right is
  0x7fff, 0x7fff.

== REVIEW
@QuarkTheAwesome @r-type @twinaphex
2018-01-03 21:32:00 -08:00
gblues
c1ef5c5497 Revert "Fix wiiu touchpad scaling"
This reverts commit 1d933a6b52e15ec281deb2aff5151292b8ebe655.
2018-01-03 19:57:38 -08:00
gblues
1d933a6b52 Fix wiiu touchpad scaling
== DETAILS

Apparently when I refactored this code, I missed out on the fix for
touchpad coordinates that @QuarkTheAwesome had committed.

Oops.

- Fix the touchpad coordinates
- Remove unneeded references to video driver in wpad_driver.c
- Remove unneeded video driver include in pad_driver.h
- Add logging in wpad_driver to verify the fix (#ifdef'd out by default)

== TESTING

Verified fix manually.
2018-01-02 23:25:03 -08:00
aliaspider
0a32642f17 (WIIU) shader: use a single attribute stream. 2017-12-31 14:06:49 +01:00
gblues
c2d2fe971e Add timeout for HID thread shutdown
== DETAILS
If a call to HIDRead() ends up blocking indefinitely, it will
cause the shutdown process to wait forever.

To avoid a deadlock, I've put in a retry counter so that it will
give up after 5s and print a warning to the log.
2017-12-30 20:59:07 -08:00
Twinaphex
d9c0f769c7
Merge pull request #6006 from aliaspider/master
(WIIU) update shader and add alpha blending to menu + overlays.
2017-12-31 00:21:53 +01:00
aliaspider
b371f4bb32 (WIIU) add a color attribute to tex_shader.
+ some fixes to overlay and menu display code.
2017-12-30 23:21:32 +01:00
aliaspider
f6fdd421c6 (WIIU) shaders: use bitfields for GPU register values. 2017-12-30 16:39:23 +01:00
twinaphex
136fb6e3c9 (WIIU) Cleanup 2017-12-30 15:35:32 +01:00
gblues
ec45df79f4 Dummy out calls into HID driver
== DETAILS

Got system memory error. Probably because the calls aren't properly
implemented. So  dummy them out for now.
2017-12-30 04:43:46 +01:00
gblues
65c177a0ee Move HID driver into wiiu/ code
== DETAILS

RetroArch's general HID drivers are intended as a full-on substitute for
other input drivers such as XInput, DInput, SDL, etc. The Wii U port is,
to my knowledge, the first case of heterogenous input drivers working
concurrently.

As such, I've moved things around:

- The HID driver source is moved into the wiiu/input/ directory alongside
  the joypad subdrivers.
- We no longer use the input_hid_init_first() method to instantiate; instead
  we just init the wiiu HID driver directly.
- The HID pad driver and HID subsystem driver enjoy a tighter coupling,
  mainly having to do with the initialization of the joypad connections
  list, because there's no way to inform the HID driver's init() method
  how many slots to allocate.

== TESTING
Will test in a moment, but at  least it compiles cleanly. ;)
2017-12-30 04:43:38 +01:00
gblues
704cc61fd8 Fix bug in autodetect macro, gamepad now works properly
== DETAILS
The gamepad didn't work because I had tried to rename the pad from
'WIIU Gamepad' to 'WiiU Gamepad'.

I added some debug logging and (to cut out a lot of trial-and-error)
discovered that the reason it didn't work was because a bug in a macro
was  using the define literally instead of substituting it (so e.g.
the autodetect handler was trying to match 'WiiU Gamepad' against the
literal string 'PAD_NAME_WIIU_GAMEPAD').

- Fixed the macro bug
- Left a minimal amount of the debug logging in place; may come in
  handy for someone else.
- Updated wpad/kpad/hidpad to use the define constants

== TESTING
Did a test build and confirmed the gamepad responded.
2017-12-30 04:43:33 +01:00
gblues
0ae7ffe0d3 Clean up dumb compile warnings, fix crash bug
== DETAILS

- the free() method of the hid_driver_t interface needs its
  parameter defined as const in order for the compiler to stop
  complaining about losing const-ness.
- if a joypad list is created with <MAX_USERS slots in it, the
  destroy() function will crash because it assumes there are MAX_USERS
  entries.

  To do this, the allocate function creates n+1 slots, and gives the
  last slot a canary value that the destroy() method can then watch for
  when iterating through the list.
2017-12-30 04:43:27 +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
7954dab835 Progress on I/O handling
== DETAILS

Starting to implement the I/O handling on the HID driver.

The old implementation basically had a never-ending HIDRead() callback
set up, so that callback N would start the read process for invocation
N+1.

We will take the same approach here; but now that the I/O thread is
happenning on its own core, we should be able to let it run full-
throttle without impacting emulator performance.

Of course, this hinges on the callback actually running on the same
core as the syscall was initiated on.

== TESTING
Can confirm that the read_loop_callback gets invoked on the same core
that the HIDRead() was invoked on.
2017-12-30 04:41:25 +01:00
gblues
661e5bf50b Implement new functions in hid_driver_t in WiiU driver
== DETAILS

This implements the WiiU-specific functions.

Since the wiiu_hid_t data structure contains the handle and interface
index, the method signatures can be simplified quite a bit. And since
(at least for now) we want these to be synchronous, we don't need to
expose the callback parameters.
2017-12-30 04:41:19 +01:00
gblues
678c4093c1 Start adapting the dual shock 3 driver to use the new driver format.
== DETAILS

The handshake stuff is derived from the old HID2VPAD, just in knowing
what data goes in what report.

- Added the HID_REPORT_ flags to syshid.h
- Renamed the generic "REPORT_TYPE" flags to be meaningful
- also fixed incorrect parameter list for set_protocol
== TESTING
The functions aren't implemented in wiiu_hid.c just yet,
so this is gonna crash if you try to run it.
2017-12-30 04:41:12 +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
d0368124e6 Add OSFastMutex WiiU calls to list of imports 2017-12-30 04:40:10 +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
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
Ash
52fb8276d7
[WiiU] Exception handler: minor comment tweak 2017-12-01 11:03:09 +11:00
Ash
469662345f
[WiiU] Exception handler: remove opcodes; fix strcmp misuse
Thanks for @gblues for finding the strcmp bug.
I've removed the opcode display since it's a bit unsafe - if the
exception handler causes a DSI; Cafe OS will take over and freeze up the
console. This is obviously not a good thing. There are possible
situations where memory is executable and not readable; so this is just
about covering all bases until a better solution can be implemented.
Maybe we can experiment a bit more once this handler isn't being used so
often ;)
2017-12-01 10:56:54 +11:00
Ash
a79d3aa8aa
[WiiU] Exception handler: fix coreinit handles, add opcode to DSIs
Coreinit seems to get special handles, so adding a special case should
make its relative addresses actually become helpful again. Let's just
hope __PPCExit stays at 0x180!
Also added the violating opcode to the DSI message; may have to move it
in case it pushes stuff off the end of the screen.

Untested at time of commit. Hopefully this should make debugging #5357 a
bit easier...
2017-12-01 10:54:21 +11:00
Ash
5f00e2f6bb
[WiiU] Reformat fs_utils.c
Was getting warnings around misleading indentation when there
was none, so just redid the whole file.
2017-11-04 20:37:30 +11:00
Ash
0d38612f4a
[WiiU] Various warning/format string fixes
All things from unsigned comparisons to missing initializers; we got it
here.
2017-11-04 20:37:30 +11:00
Ash
b49268a9e9
[WiiU] Redo exception handler format strings
Deals with the infamous devkitPPC "int32_t = long int" thing, and
future-proofs in case they ever change it back.
2017-11-04 20:37:30 +11:00
Maschell
6fa80376e0 [Wii U]Added some more checks while parsing the configuration files for the HID controller
This hopefully fixes the crashes when starting retroarch with (faulty)
.ini files
2017-10-25 21:16:31 +02:00
Brad Parker
19af87214a wiiu: only one dash for gcc -std 2017-10-20 23:43:33 -04: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
Ash
6b5aef09a1
[WiiU] DRC touch support as pointer device
Allow using the Gamepad's touch screen as a RETRO_DEVICE_POINTER.
Methodology could use some work, had to add an extra axis to
joypad in order to get the data transferred into the input driver.
Feel free to change this.
Needs to emulate RETRO_DEVICE_LIGHTGUN to really be useful.
Potential for Wiimote IR in future.

Partially addresses libretro/RetroArch#5294
2017-08-19 17:40:56 +10:00
not6
10492c1ee7 Update imports.h
add additional imports  (semaphore)
2017-08-07 23:25:05 +02:00
Ash
40a4a5a733
[WiiU] Rewrite exception handler 2017-08-04 21:30:49 +10:00
Ash
2492f3d6b3 Add missing_libc_functions.c (for DOSBox) 2017-06-15 15:21:38 +10:00
Ash
7f5986e1d5 Rename Wii U log functions (conflict in DOSBox) 2017-06-15 15:20:58 +10:00
aliaspider
f589c50043 (WiiU) misc. 2017-05-28 12:42:19 +01:00
aliaspider
5a92ec15cf (WiiU) fix netplay. 2017-05-26 12:32:45 +01:00
aliaspider
934f7c58ba (WiiU) enable networking. 2017-05-23 10:24:23 +01:00
aliaspider
b17e76d8b7 (WiiU) add freetype and stb font support.
freetype disabled by default due to requiring an external library.
2017-05-21 04:22:32 +01:00
aliaspider
8dee95651f (WiiU) add a font driver. 2017-05-21 03:05:41 +01:00
Maschell
bd8d3d66d7 [Wii U] Using the controller_patcher lib files directly instead of including it as a submodule 2017-05-20 20:23:01 +02:00
Maschell
7a2c09e9ce [Wii U ] Proper order of the HID devices.
Added individual names for the HID devices.
2017-05-20 19:26:12 +02:00
Maschell
fa0d82b188 [Wii U] Fixing the .rpx build 2017-05-20 13:13:52 +02:00
Maschell
4393e17ea7 [Wii U] Using the HID Controller as a own controller. Currently the stick only work when it's bind manually. Mapping from controller to retroarch input port may change when you attach a new device. 2017-05-08 21:46:34 +02:00
Maschell
11a0610d13 [Wii U] Updating to new controller patcher. Removing debug stuff. 2017-05-08 12:32:02 +02:00
Maschell
e695d4e8ad [WiiU] Initial controller patcher support (HID via USB and network)
- Reading config from sd cards currently broken
- Not implemeted as a driver, currently all devices will be mapped to the WiiU Gamepad driver
2017-05-08 12:24:06 +02:00
Maschell
da0f3620bc [Wii U] Adding missing includes and defines 2017-05-08 12:18:28 +02:00
xhp-creations
4915f452f5 WiiU Initial Keyboard Support
WiiU Initial Keyboard Support
2017-02-09 12:34:12 -05:00