Commit Graph

73 Commits

Author SHA1 Message Date
Ash Logan
d6250fd58c (WiiU) Implement __clear_cache
This seems to maybe be a libgcc builtin and even explicit calls to it 
are removed.. so we have a Makefile workaround!
2022-06-07 01:07:01 +10:00
Ash Logan
148f5f7499 (WiiU) Implement sysconf()
_SC_PAGESIZE is used in some cores.
2022-06-07 01:02:53 +10:00
Ash Logan
7c34fd46e1 (WiiU) Add OS memory mapping imports
Used in some upcoming cores.
2022-05-30 11:50:58 +10:00
Ash Logan
97db0291d2 (WiiU) Add ICInvalidateRange 2021-08-07 15:42:12 +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
1ae20ea17c Style nits - turn macro names into upper-case - some while style nits 2020-06-26 20:00:19 +02:00
twinaphex
b179dde1e7 Cleanups 2019-09-15 07:46:24 +02:00
orbea
28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08: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
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
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
Ash
8e1437ad86
[WiiU] Add build information to exception handler 2018-04-15 17:19:39 +10:00
gblues
dca36ebaf8 Add small snippet for atomic value swapping
Fortunately, the gcc port implements the builtins and, from basic
testing, they seem to work.

This is only really useful on Wii U--other platforms have more
robust atomic operations, or aren't using gcc to build.
2018-04-14 01:26:26 -07:00
not6
af8559bc19
Update imports.h
add OSGetCurrentThread and OSExitThread.
2018-02-25 13:53:57 +00:00
twinaphex
4f7f237644 (Wiiu) uniquely name global variable 'pos' to prevent collissions with
variables in other cores (like freeintv)
2018-02-03 15:40:54 +01:00
Ash
af37d3780a
[WiiU] Fix indentation, for real this time
-_-
2018-01-30 17:43:45 +11:00
Ash
68f7aeadb2
[WiiU] Reformat line indents
Not sure what happened there. Do we need a squash merge now?
2018-01-30 17:38:16 +11:00
Ash
3a442af6be
[WiiU] Add missing time/clock libc functions
Add some timing functions so that we can know the time (woo-hoo?)
I use errno here, which worries me a bit. I wouldn't put it past
devkitPPC to have it as a null pointer or something.

Can confirm this makes XMB's clock work, much to @cucholix's delight;
I'm sure ;D
2018-01-30 17:14:58 +11:00
gblues
5894d0ef86 Remove all HID code from WiiU build via ifdef
== DETAILS
We're trying to track down the source of crashes when switching cores.
To rule out the HID code, this commit does the following:

- Wraps the library imports in an ifdef
- Wraps the object files in conditionals in Makefile.wiiu
- In wiiu_joypad, calls into the hidpad driver are wrapped in ifdef

== TESTING
This didn't solve the "System memory error" crash I've been experiencing.
But, maybe it will impact the other flavors of crashes others are seeing.
2018-01-07 20:26:24 -08:00
aliaspider
6b24663dd9 (WIIU) add more NULL check to *_free functions. 2018-01-07 03:45:41 +01:00
Alfredo Monclus
bbd9a6566c WiiU: C89 style comments 2018-01-06 09:44:03 -03:00
twinaphex
cf8e7cd362 (wiiu) small style nits; declare variables at top; C comments 2018-01-05 13:09:05 +01:00
aliaspider
a7632620da (WIIU) add a sprite shader. 2018-01-04 17:38:04 +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
d0368124e6 Add OSFastMutex WiiU calls to list of imports 2017-12-30 04:40:10 +01: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
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
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
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
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
aliaspider
8f88d8fb4d (WiiU) implement the missing requirement for core loading: exec,
exitspawn, set_fork and salamander.
2017-01-25 19:52:31 +01:00
aliaspider
021b510452 (WiiU) refactors/cleanups. 2017-01-23 16:14:05 +01:00
aliaspider
8cb692622a (WiiU) add support for bluetooth controllers (Wiimote, nunchuk, classic
controller, wiiu pro controller).
2017-01-16 18:52:39 +01:00
FIX94
c0b023a1cf (WiiU) added basic libiosuhax support 2016-12-17 18:42:04 +01:00
FIX94
df956efd43 (WiiU) properly set audio offset before starting playback 2016-11-30 02:37:42 +01:00