Compare commits

...

12 commits

Author SHA1 Message Date
Denis
c68ddd85b8
I have no idea... 2024-01-02 22:03:11 +01:00
Denis
9cf162681e
I do have no words to express how stupid I am 2024-01-02 21:58:21 +01:00
Denis
1c401c9dbf
debug 2024-01-02 21:51:41 +01:00
Denis
e85322e38c
debug 2024-01-02 21:47:35 +01:00
Denis
f3ac4dc285
I have finished messages 2024-01-02 21:35:54 +01:00
Denis
42832e0b0d
dafuq? 2024-01-02 21:30:49 +01:00
Denis
782865dbb6
no idea... 2024-01-02 21:24:12 +01:00
Denis
58d7d7c553
better? 2024-01-02 21:20:07 +01:00
Denis
c668a9406c
what about this? 2024-01-02 21:16:53 +01:00
Denis
922dd90831
let's exclude the other part of X too 2024-01-02 21:11:00 +01:00
Denis
c400ee7d22
let's fix X alone 2024-01-02 21:08:08 +01:00
Denis
a755e2a18c
default to touchpad button for m1 and m2 buttons 2024-01-02 21:04:09 +01:00
3 changed files with 12 additions and 18 deletions

View file

@ -5,4 +5,4 @@ default_gamepad = 1;
rumble_on_mode_switch = true;
gamepad_rumble_control = true;
gamepad_leds_control = true;
m1m2_mode = 0;
m1m2_mode = 1;

View file

@ -991,8 +991,8 @@ static int touchscreen_ev_map(
.gamepad_set = {
.element = GAMEPAD_TOUCHPAD_X,
.status = {
.touchpad_active = {
.status = e->ev[i].value,
.touchpad_x = {
.value = e->ev[i].value,
}
}
}
@ -1007,8 +1007,8 @@ static int touchscreen_ev_map(
.gamepad_set = {
.element = GAMEPAD_TOUCHPAD_Y,
.status = {
.touchpad_active = {
.status = e->ev[i].value,
.touchpad_y = {
.value = e->ev[i].value,
}
}
}

View file

@ -1324,9 +1324,9 @@ void virt_dualsense_compose(virt_dualsense_t *const gamepad, gamepad_status_t *c
// point of contact number 0
out_shifted_buf[33] = in_device_status->touchpad_touch_num == -1 ? 0x80 : 0x7F; //contact
out_shifted_buf[34] = in_device_status->touchpad_x & (int16_t)0x00FF; //x_lo
out_shifted_buf[35] = (((in_device_status->touchpad_x & (int16_t)0x0F00) >> (int16_t)8) | ((in_device_status->touchpad_y & (int16_t)0x000F) << (int16_t)4)); // x_hi:4 y_lo:4
out_shifted_buf[36] = ((in_device_status->touchpad_y & (int16_t)0x0FF0) >> (int16_t)4); //y_hi
out_shifted_buf[34] = 0x7F/*in_device_status->touchpad_x & (int16_t)0x00FF*/; //x_lo
out_shifted_buf[35] = (((in_device_status->touchpad_x & (int16_t)0x0F00) >> (int16_t)8) /*| ((in_device_status->touchpad_y & (int16_t)0x000F) << (int16_t)4)*/); // x_hi:4 y_lo:4
out_shifted_buf[36] = 0 /*((in_device_status->touchpad_y & (int16_t)0x0FF0) >> (int16_t)4)*/; //y_hi
// point of contact number 1
out_shifted_buf[37] = 0x80; //contact
@ -1334,21 +1334,15 @@ void virt_dualsense_compose(virt_dualsense_t *const gamepad, gamepad_status_t *c
out_shifted_buf[39] = 0x00; //x_hi:4 y_lo:4
out_shifted_buf[40] = 0x00; //y_hi
/*
buf[30] = 0x1b; // no headset attached
*/
out_shifted_buf[62] = 0x80; // IDK... it seems constant...
out_shifted_buf[57] = 0x80; // IDK... it seems constant...
out_shifted_buf[53] = 0x80; // IDK... it seems constant...
out_shifted_buf[48] = 0x80; // IDK... it seems constant...
out_shifted_buf[35] = 0x80; // IDK... it seems constant...
out_shifted_buf[44] = 0x80; // IDK... it seems constant...
if (gamepad->bluetooth) {
uint32_t crc = crc32_le(0xFFFFFFFFU, (const uint8_t*)&PS_FEATURE_CRC32_SEED, sizeof(PS_FEATURE_CRC32_SEED));
crc = ~crc32_le(crc, (const Bytef *)&out_shifted_buf[0], DS_INPUT_REPORT_BT_SIZE - 4);
memcpy(&out_shifted_buf[DS_INPUT_REPORT_BT_SIZE - sizeof(crc)], &crc, sizeof(crc));
}
if (in_device_status->touchpad_touch_num != -1) {
printf("%4x -> %2x @\n", (int)in_device_status->touchpad_x, (int)out_shifted_buf[35]);
}
}
int virt_dualsense_send(virt_dualsense_t *const gamepad, uint8_t *const out_shifted_buf) {