devkitPro / wut

Let's try to make a Wii U Toolchain / SDK for creating rpx/rpl.
zlib License
236 stars 52 forks source link

nn/dlp: Add initial headers #389

Closed DaniElectra closed 2 months ago

DaniElectra commented 2 months ago

This is an initial implementation of Download Play (nn_dlp) on the Wii U. Research has revealed that there aren't any Wii U games that used this feature nor there could have been any, because the IOSU requires system archives that aren't present on the Wii U in order to initialize.

Homebrew that want to use this library must use Aroma 22 or later, as it adds the necessary permission group to let homebrew access DLP, and applies the necessary patches to make DLP usable. Otherwise, the console would crash as it doesn't have permission to use DLP.

The name of the DLP child MUST be like this: 00040001XXXXXXYY.cia, where XXXXXX is the input uniqueId and YY is the childIndex from the Initialize functions.

It should be noted that while the DLP child that is distributed is intended to be stored at /vol/content/dlp/app/TITLE_ID.cia, the reading of the file is performed on IOSU land, so Aroma's content redirection doesn't work here. This is worked around in Aroma 22 or later, which tries to read the DLP child from the SD card instead, inside sd:/dlp/app/TITLE_ID.cia.

Most of the input parameters have been named using the print logging that was present on the IOSU.

The mangled symbols of DLP seem to have the static label on them. Because of that, it's very likely that Server and ServerPrivate are classes, so they have been classified that way. I'm not sure if ServerPrivate should inherit Server, so at the moment it doesn't.

Research note: the State functions output the state as a uint32_t. However, they are stored internally as a uint8_t

This PR has been tested successfully using the Download Play client from the 3DS. A working example can be found here: https://github.com/DaniElectra/dlp-wiiu-test

GaryOderNichts commented 2 months ago

Thanks!