cemu-project / Cemu

Cemu - Wii U emulator
https://cemu.info
Mozilla Public License 2.0
6.6k stars 506 forks source link

TV button, Home button, Sync button support #1242

Open TcpLink-2024 opened 1 week ago

TcpLink-2024 commented 1 week ago

Your suggestion

Support for buttons TV, Home, Sync on GamePad controller. Yes, games do not uses those buttons, but CafeOS or homebrew, or asm patches could use it. And it's very handy for cheats in patches because those buttons do not mess with buttons used in game itself.

Exzap commented 1 week ago

Those buttons don't act like real buttons on console in that they trigger signals not readable by the controller libraries, with the exception of the Home button. But even that one has a reserved use and shouldn't be used as a generic button.

Maybe you can just work with button combos instead? What is your exact use case?

I think what you are asking for is close to #1199, just maybe instead of toggling the whole graphic pack there should be a way of mapping extra buttons to be able to send signals to graphic packs somehow. But such a feature would be hard to do because it ties together completely unrelated systems and UI. The Gfx pack settings would have to be made controller aware somehow and thats not an easy undertaking.

TcpLink-2024 commented 1 week ago

Well, I developed some homebrew for WiiU ( Botw_Spawn for WUPS ) and at least TV button on real gamepad totally readable by VPADRead. I didn't test Home button ( expect it could be intercepted by CafeOS ) and Sync button ( expect it could be intercepted even by some HW ). But TV button would be very handy, cause it's not messing with button combinations in BOTW. Now I ported ( 99% ) this homebrew to Cemu ( and publish it on gamebanana ) and of course I use A + X + Y button combination to enable / disable this patch instead of TV button I used on hardware Wii U. Btw this mod one of the biggest assembly patches I saw ( except shader patches ), at least for BOTW, and quite remarkable that it work in Cemu ( meaning great job to develop such a solid project, very appreciated ). Also development despite mostly in assembler was quite smooth thanks to great debugger.

Of course there's problem that TV button not available on typical PC gamepad, but my possible workflow would try to use Home button on Xbox 360 / Xbox One ( or a like ) controller to send TV button signal and disable/enable some patch ( internally in assembler not through some interface on Cemu as suggested in #1199 ). Of course there's could be all sort of problems because home button often intercepted by Game Overlay in Windows or Steam Overlay but ther solvable.

Also, absense of this buttons, make some holes in almost perfect bitmask of a ControllerVPADMapping2 VPAD_TV = 0x00010000, // no such line VPAD_STICK_R = 0x00020000, VPAD_STICK_L = 0x00040000

and of course

VPAD_PLUS = 0x0008,
VPAD_MINUS = 0x0004,
VPAD_HOME = 0x0002,
    VPAD_SYNC = 0x0001    // one bit !!!