devkitPro / wut

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

IR blaster not documented #106

Closed MrKev312 closed 1 year ago

MrKev312 commented 5 years ago

the Infrared blaster has many functions missing

ashquarky commented 5 years ago

Yup! Like most things of this nature, documenting the functions requires reverse-engineering effort and someone to sit down and write about what they've found. When you're dealing with an API as large and complex as Cafe's, one with zero documentation from Nintendo (except for the function names), we're kinda required to prioritize some things over others. You might also notice that the entire graphics and audio APIs have minimal documentation - argument names only. Honestly, the VPAD stuff is probably the best documented in wut right now. With that said, if you know a thing or two about these functions, you're more than welcome to tell us, or PR them in! Adding them to the headers should be enough to get apps linking, though full Doxygen is obviously preferred if you can put in that effort.

ashquarky commented 4 years ago

So, I did a quick search for applications that seem to use the infrared (or irda) stuff, and there's one hit - Wii Fit U. Indeed, it has a Pokéwalker type thing: screenshot from a Wii Fit U promo video, showing a small pedometer communicating with the Gamepad's IR blaster You can pretty clearly see on the Gamepad's screen that it's requesting you point it specifically at the IR blaster (this isn't NFC or the like).

Could be a point to start for anyone who'd like to reverse-engineer this. The only other particularly interesting imports from Wii Fit U would be VPADBASEClearIRCEvent and VPADBASEGetIRCStatus, which could be related?

ashquarky commented 4 years ago

After chatting to some folks from Pretendo, it seems that TVii also hits up the IR blaster, but instead of doing raw communication like we see in Wii Fit U, it abstracts it up to buttons on a TV remote. The nice thing there is that it exposes it via JavaScript, and the aforementioned folks already told me how to find the mapping between JS functions and the native implementation. Should be a very nice thing to RE, then!