Dolphin, the GameCube and Wii emulator - Forums

Full Version: Implement IOCtlV 0x3 of /dev/net/ncd/manage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
As the topic says, this patch implements IOCtlV 0x3 of /dev/net/ncd/manage. Concerning the first output buffer, this IOCtlV basically just reads the contents of /shared2/sys/net/02/config.dat (network configuration) and stores the data in the buffer (no idea what it does with the second one). Since the name SETIFCONFIG3 is somewhat opposed to what the IOCtlV actually does, I renamed it to GETIFCONFIG.
With this code, trying to play Mario Kart Wii over NWC won't immediately spit out an error, but instead now even tries to connect with WTC (horribly failing of course, since we neither have any real network support nor have WC24 implemented).
The file layout of config.dat is taken from wiibrew and is included for readability (I could've hardcoded all the values of course, but who would understand such code?).

NOTE: This code will fall back to old "functionality" (i.e. just return 0 without doing anything at all) if /shared/sys/net/02/config.dat doesn't exist, so you should have a copy of that file. By the way, it would be helpful if some told me how to modify/delete some file on the NAND (since I don't know what the Wii does in case config.dat doesn't exist). (nevermind, found /dev/fs)
Furthermore, this code isn't tested on Windows, but it _should_ work fine, unless MSVC or MingW don't support #pragma pack(1). Just tried on Windows, compiles and runs MKWii fine.

So... I hope this patch is okay with the coding style and everything (any comments are welcome ofc), it would be cool if I gained SVN access since I'm planning to prepare some other network related patches in the future as well.

EDIT: Patch has been committed as of r5222, thanks to Sonic1 Wink
Very cool. PM me your gmail/google account name for SVN access.
NeoBrain's been added!
Welcome, Neobrain.