Ryochan7 / DS4Windows

Like those other ds4tools, but sexier
https://ryochan7.github.io/ds4windows-site/
GNU General Public License v3.0
6.93k stars 804 forks source link

[TODO] Re-check Switch Pro and JoyCon rumble data #2560

Closed Ryochan7 closed 1 year ago

Ryochan7 commented 2 years ago

When I made my initial implementation, I think I might have messed up with a bit shift in the rumble frequency conversion. Although, I am wanting to think I might have changed a step intentionally compared to the steps used in the official reverse engineering docs and BetterJoy code. Too bad I have no comment docs to tell me what I was thinking then. Been busy messing with other tasks so I have not gotten around to it. Personally, I really like the way it feels currently especially when it comes to the JoyCon controllers.

Ryochan7 commented 2 years ago

Double checked it. It is just slightly different math but the outcome is still the same. Based on the example and the frequency table, it looks like the example swaps the byte order for HF before placing the bytes in the byte array. The DS4Windows code uses the hex value as written in the table and then changes when the bit shifts take place. I think I am going to keep the operations as they are.

https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md#frequency-table

Besides adding comments in that code, need to change the value used for LF. It is not correct for 320 Hz but I might change the frequency used anyway.

Ryochan7 commented 1 year ago

Increased the max amplitude used for Switch Pro rumble. The Switch Pro rumble seemed like it was a bit too quiet although the same amplitude felt fine for the smaller JoyCon. Now that this issue has been looked into, it is probably safe to close this issue.