Commit Graph

200 Commits

Author SHA1 Message Date
Nathan Strong
9b2d4236ad WIIU: Clean up a bunch of compiler warnings
== DETAILS
These changes fall into a few broad categories:

1. Explicitly undefine things we want to re-define due to conflicts with
   the version of devkitpro we're using
2. Clean up hex format specifiers to use `%lx` or `%lX` when working with
   long integers
3. Move variables inside the ifdef they're used in to squelch "unused variable"
   messages
4. Add parenthesis to make Wii U shader declarations stop complaining

And then there's a weird "misleading indent" warning that I fixed by just
rewriting a block of code to use a switch statement instead of if-then-else.

These changes work fine on Wii U, but we'll need to keep an eye on CI/CD to see
if other platform builds break.
2021-09-25 13:25:39 -07:00
gblues
ae617c0ee6
Update some Wii U development metadata (#13013)
== DETAILS
- add a `WiiU` IntelliSense configuration for vscode
- rewrite the `net_listen.sh` script in python because the
  shell script approach just isn't portable enough and doesn't handle
  things like multiple network adapters gracefully at all.
2021-09-19 01:22:59 +02:00
Ash Logan
d9157c5dc7 (WiiU) Read up to 128k on the no-CFW unaligned slowpath
it may be the slowpath, but 16k is a bit rich
2021-08-14 20:29:24 +10:00
Ash Logan
97db0291d2 (WiiU) Add ICInvalidateRange 2021-08-07 15:42:12 +10:00
Autechre
c007a81103
Merge pull request #12672 from QuarkTheAwesome/network-fixes
(Wii U) Network speed optimisations
2021-07-18 22:16:01 +02:00
Ash Logan
e43f07b85b wiiu: Add fastpath for already aligned buffers 2021-07-18 22:33:26 +10:00
Ash Logan
e5553bde4e wiiu: Network optimisations - WINSCALE, TCP sACK, large buffers
See code sample in https://github.com/devkitPro/wut/issues/169 and 
2430789406/src/net.c (L88)
2021-07-18 21:02:56 +10:00
twinaphex
2364fdd900 (Wiiu) Cleanups 2020-07-24 04:42:43 +02:00
twinaphex
ad30ffa085 Cleanups 2020-07-23 18:11:20 +02:00
twinaphex
a657ad7039 Cleanup 2020-06-29 05:41:25 +02:00
twinaphex
1ae20ea17c Style nits - turn macro names into upper-case - some while style nits 2020-06-26 20:00:19 +02:00
Ash Logan
f22af81e7d (WiiU/wpad) Allow hotplugging Gamepad, support >1 channel 2020-05-17 16:32:51 +10:00
twinaphex
ad7612eef3 (wiiu) Style nit cleanups 2020-05-07 20:23:14 +02:00
twinaphex
33cf0e160c Style nits 2020-05-07 20:13:02 +02:00
Roet-Ivar
ad34f4845b Added access to WiiU-formated storage to be browsed by RetroArch 2020-05-07 12:49:04 +02:00
Vladimir Serbinenko
1fcdddf579 Remove manual MSB_FIRST definitions and switch to retro_endianness.h 2020-04-21 04:16:55 +02:00
twinaphex
1f6b90a4f9 Prevent warnings 2020-02-10 20:45:17 +01:00
Tadek Kijkowski
4b73879369 Speed up elf2rpl by using maps 2019-09-29 17:36:39 +02:00
Tadek Kijkowski
c1504555ac Fixed WiiU compilation randomly failing
- Fixed elf2rpl referencing deleted symbols in relocations
- Added some diagnostics to elf2rpl (activated with -v switch)
2019-09-21 21:31:34 +02:00
twinaphex
5024b77492 Prevent more strlcats that are quite trivial 2019-09-17 02:43:40 +02:00
twinaphex
b179dde1e7 Cleanups 2019-09-15 07:46:24 +02:00
Twinaphex
2179c16f60
Update main.cpp 2019-09-08 04:41:03 +02:00
Twinaphex
fde7026ac2
Update Makefile 2019-09-08 04:19:58 +02:00
Twinaphex
8520a94b8f
Update Makefile 2019-09-08 04:17:43 +02:00
Ash Logan
f6e4361fc9 wiiu: Make libfat/libiosuhax optional 2019-05-29 18:21:56 +10:00
orbea
28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
hizzlekizzle
74526ca140
update slang blacklist for wiiu 2019-01-30 12:00:28 -06:00
Brad Parker
c455a86545 wiiu: fix include path to peglib for slang-parse 2019-01-28 14:43:42 -05: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
Nathan Strong
c5f9fc0a34 WiiU: fix network information
== DETAILS

For local netplay, it's useful to have your IP address easily
available. This commit makes the Information > Network Information
menu display the Wii U's IP address.

Change summary:
- Fix the logging init to be reentrant to avoid socket consumption
- Add implementation of POSIX `getifaddrs()` and `freeifaddrs()`
  to `missing_libc_functions.c`
- Remove compiler directives protecting the code paths that call
  `getifaddrs()` from being used in Wii U builds

== TESTING

Have tested locally, successfully get IP address information in
the Information > Network Information.

I think this may also fix NAT traversal. Will need to be tested.
2018-10-11 15:37:15 -07:00
Nathan Strong
d3f8d8a08d wiiu: small cleanup
== DETAILS
- remove extraneous '+' from a manually applied diff
- fix the net_listen.sh script so it works properly on
  Mac OSX

== TESTING
Works locally.
2018-10-10 11:38:03 -07:00
twinaphex
c2112c4cbf Commit this diff patch by gblues 2018-10-10 20:15:31 +02:00
Ash
9344391bfa WiiU: Fix missing "#include <sys/iosupport.h>" in sd_fat_devoptab 2018-09-09 18:22:48 +10:00
gblues
9ea16c0b3d Updates from PR feedback (ty @aliaspider) 2018-06-07 21:16:49 -07:00
gblues
8b87a53366 Replace hokey "hooks" struct with weak symbol annotations
- Did a test build to ensure RA built
- Copied over to my FTPservU sources and ensured no compile issues there

Looks solid. A lot cleaner, too.

@aliaspider
2018-06-07 18:41:16 -07:00
gblues
f22c337cfc WIIU: cleanup and build-out of wiiu bootstrap code
I used the code in `wiiu/` to bootstrap my own WiiU homebrew app; this
PR reflects some changes I needed to make, that might be useful upstream.

1. Clean up filesystem initialization

Filesystem driver initialization was lumped in with filesystem mounting;
and that was a problem in my project, because I needed to be able to remount
the SD card on the fly. So, now it's split up.

I've added a callback object named "hooks" that can be used by consuming
applications to handle filesystem mounting and unmounting. If these hooks are
not provided, then the existing default behavior occurs.

2. Expand socket handling

- add `SO_NONBLOCK` flag for non-blocking socket I/O
- add normal errno defines like `EWOULDBLOCK` `EAGAIN`.

3. Remove RetroArch dependencies

- the exception handler protects usage of version_git with
  `#ifdef HAVE_GIT_VERSION` but not the include, so I added that.

  It also technically depends on version.h, but I'm not touching that.
  It's easy enough to implement and I needed the same functionality. I'm
  not sure what the best solution for that dependency is.

- missing_libc_functions.c included features/features_cpu.h which is
  a libretro include. This appears to be a stale include though, because
  everything compiles and works without it.

- an ifdef referencing the RA "WIIU" define, rather than the devkitpro
  "__wiiu__" define
2018-06-05 00:06:40 -07:00
gblues
23f0a85446 Implement UDP broadcast network logging on Wii U
== DETAILS

The broadcast address is a standard part of TCP/IP that is used to
send messages to everyone on the subnet. This patch updates the
logging code to do the following:

1. Derive the broadcast address from the Wii U's own IP address
   and subnet mask. These can all be obtained at runtime, which
   means we can...
2. Remove the PC_DEVELOPMENT_IP_ADDRESS define from Wii U's
   Makefile, because compiling in an IP is no longer needed.
3. Rewrite the net_listen script to listen for broadcast packets
   and print them out with timestamps.

Since it's using the broadcast address, the only requirement is
that the PC be on the same network subnet as the Wii U.

Because of the low overhead of UDP, I've made logging on by
default. This will make it a ton easier to get useful bug
reports from users.
2018-05-06 14:39:48 -07: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
04cefd27d1 Cleanup of Wii U launcher code
== DETAILS

The Wii U main entrypoints were embedded in the frontend driver,
which isn't a great place for them. Also, the `main()` method was
pretty long and monolithic. Now it's (much) less so.

Changes:

- Refactor out the main entrypoints into their own source files
  (`wiiu/main.c` and `wiiu/main.h`)
- Optimize includes in both files, so only the minimum needed to
  compile are included.
- The `main()` method is a lot easier to understand now. It's no longer
a confusing mess of ifdefs.
- There's a small amount of changes in the headers for future work, which
  is switching kpad_driver to be callback-driven. The only change here is
  to import the function that will be used, and define some data types.

Testing:
- Did local builds and confirmed build is successful
- Successfully loaded a core and switched among a few games
2018-04-30 21:56:06 -07:00
Twinaphex
6ac4032735
Merge pull request #6580 from gblues/gblues/hid
Working HID driver for Wii U [TESTING NEEDED]
2018-04-25 23:10:39 +02:00
gblues
07864aebb4 Add fault-tolerance to kpad driver
== DETAILS

So, the KPadRead function will sometimes return 0, but this doesn't mean
the wiimote is actually disconnected. It's usually something transient, like
the BT chip has nothing to send or whatever. I don't know.

So, I added a buffer so that it won't disconnect the pad without 5
consecutive 0-reads.

This is a temporary hack; a proper solution will use the Wii U's callback
mechanisms to do wiimote detection. But that's a separate project. This at
least prevents OSD spam.

== TESTING

Tested locally. Verified that connecting/disconnecting nunchuk during play
still works properly.
2018-04-24 21:46:42 -07:00
gblues
f33fa3d566 Fix pad leak in kpad (wiimote) driver
== DETAILS

This is the wiimote version of the same bug I previously fixed in the HID
driver, where disconnected pads didn't actually invoke the unregister task.

This has an extra wrinkle, in that we *also* need to invoke the unregister
task when the wiimote device changes (e.g. user plugs in a nunchuk or
classic controller).

Now, there's still the problem of the "disconnect" detection being broken; so
a consequence of this commit is OSD spam. However, the actual wiimote input
is processed successfully and there's no noticeable issues in the pad
handling.

== TESTING

Using Mario 3, I played a level in which I started as bare wiimote, then
hot-plugged the nunchuk, and the input switched automatically. At  the
end of the level, I hot-unplugged the nunchuk and it automatically reverted
to horizontal layout; and the pad remained 100% responsive the entire time.
2018-04-24 21:20:08 -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
ef36744859 Start implementing fall-back to async read
== DETAILS

The Wii U GC adapter doesn't seem to like doing async reads if it is connected
via a USB hub. It seems to be device-specific, though, because my DS3 works
just fine through the same hub.

I tried creating a fallback to synchronous reads, but it resulted in a hard
lock of the system. So, for the time being, it's going to be a known
limitation. Might be solved by using a powered USB hub.

Learned that the cache alignment is 64, not 32, so the alignment math has
been updated. Thanks, @aliaspider for that info.
2018-04-20 21:58:45 -07:00
gblues
0c92fab0b9 Fix GameCube button detection
This should fix the issue where R/L buttons didn't register when doing
input detection.

This also brings the GC pad in line with the rest of the gamepads in
input_autodetect_builtin.c.

Also fixed a really stupid bug that was part of why analog inputs aren't
being read. Analog still isn't working, mind, but it's a lot closer to
working now that it's actually getting down into the pad driver level!
2018-04-20 00:00:33 -07:00
Ash
8e1437ad86
[WiiU] Add build information to exception handler 2018-04-15 17:19:39 +10:00
gblues
fb5b31faf3 Merge branch 'master' into gblues/hid 2018-04-14 14:18:03 -07:00