Arduino Library
Using an Arduino I'd like to be able send the ps4 custom reports and be able to decide which buttons are pressed and which aren't using my Arduino code while only having the security checks proxied back and forth to the controller.
Is there any chance of you putting up an Arduino only library which is capable of the above that can just be added to an Arduino sketch that doesn't need to be compiled with python?
I'd like to make something a bit more "modular" but the Arduino dev environment does not make this easy. I'll see if I can factor out the proxy code in a library, but I'm busy on another project right now.
As far as I can tell the biggest blockage is that it is the Bytecode changing the report back to the PS4. How difficult would it be to change that byte code into code you could add yourself in the Arduino IDE?
I just pushed a new commit on master, adding the generated header files, so you should be able to build the code directly now. You should first uncomment the #define DISABLE_REMAPPING in Config.h; this will prevent the whole VM/configuration stuff from building.
If you want to hook you own code you should do so in Host.cpp around line 197; that's when a new report from the Dualshock is available. You can change it on the fly there, it will be forwarded to the PS4 at line 233.
At some point I'll refactor this so it's easier to hook custom code :)
Thank you so much! I've now gotten this to compile.
I haven't made any alteration to Host.cpp yet and when I upload dsremap.ino and plug it into the PS4, the controller has a slow yellow light and it doesn't appear that the PS4 recognises it.
Is this the expected behaviour?
You have to plug the Dualshock to the controller and press PS IIRC; nothing can happen before that.
Ah by "controller" you meant the Dualshock :) No, it should turn blue. Sometimes there are race conditions in the various responses to USB round-trips; try plugging the setup after plugging the DualShock to it ?
Brilliant! Thats working now! It doesn't ever turn blue though. It flashes yellow once and then once I hit the PS button it connects but the light on the DS stays off.
Mmmh, that's strange. It may be symptomatic of a problem on the OUT interrupt endpoint. We'll see I guess.