diff --git a/config.cfg.default b/config.cfg.default index f6dd94b..2297cb6 100644 --- a/config.cfg.default +++ b/config.cfg.default @@ -5,4 +5,4 @@ default_gamepad = 1; rumble_on_mode_switch = true; gamepad_rumble_control = true; gamepad_leds_control = true; -m1m2_mode = 0; \ No newline at end of file +m1m2_mode = 1; \ No newline at end of file diff --git a/rog_ally.c b/rog_ally.c index 1357c3d..03d2e0a 100644 --- a/rog_ally.c +++ b/rog_ally.c @@ -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, } } } diff --git a/virt_ds5.c b/virt_ds5.c index aaad393..da896e6 100644 --- a/virt_ds5.c +++ b/virt_ds5.c @@ -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) {