EloiStree / HelloInput

Collect of information about old project on Input in aim to do a workshop on the topic
0 stars 0 forks source link

Topic: Could we compress all the important data of a Xinput in a integer ? #298

Open EloiStree opened 4 days ago

EloiStree commented 4 days ago

The answer is "no". But kind of yes

// Frist byte is lost as it is the type so you have 24 bits to store it.
 //111 = 7 | -1 -0.8 -0.5 0 0.5 0.8 1  (if store an axis on 111 bits)
 //1111 = 15 |  1/7=0.15 |  -1 -0.85 -0.7 -0.55 -0.4 -0.25 -0.1 0 0.1 0.25 0.4 0.55 0.7 0.85 1
 //1111 11111 11111 11111 11111 11111
 //111111111 1111111111 1111111111 6 axis in 24 bits
 //111 111 111 111 111 111 6 axis in 18 bits
 //111,111,11 1,111,111,1 11,111111 Giving 6 bits as possible buttons
 //I suppose A X B Y SBL SBR

// A nice version if you don't want precision of the joystick
// But it is also required compression and uncompression with bit shit in sender and received
//11 = 3 -1 0 1   111 as arrow pad
//11,11,11,11 11,11|111|1 11111111
//LH LV RH RV JL,JR DPAD, Back A X B Y SBL SBR JBL JBR