From 7e977648825c3112ded1d4a3c766388948ddce00 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 31 Mar 2015 21:42:43 +0200 Subject: [PATCH] (connect_ps4.c) Update --- input/connect/connect_ps4.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/input/connect/connect_ps4.c b/input/connect/connect_ps4.c index 3fbf84c04e..a5bc7fa625 100644 --- a/input/connect/connect_ps4.c +++ b/input/connect/connect_ps4.c @@ -129,22 +129,22 @@ static void hidpad_ps4_packet_handler(void *data, uint8_t *packet, uint16_t size device->have_led = true; } #endif - uint8_t *rpt_ptr = (uint8_t*)&packet[4]; + uint8_t *rpt_ptr = (uint8_t*)&packet[2]; device->buttonstate = 0; - buttons = rpt_ptr[2]; - buttons2 = rpt_ptr[3]; - buttons3 = rpt_ptr[4]; + buttons = rpt_ptr[4]; + buttons2 = rpt_ptr[5]; + buttons3 = rpt_ptr[6]; - //RARCH_LOG("Left stick X: %d\n", rpt_ptr[-2]); - //RARCH_LOG("Left stick Y: %d\n", rpt_ptr[-1]); - //RARCH_LOG("Right stick X: %d\n", rpt_ptr[0]); - //RARCH_LOG("Right stick Y: %d\n", rpt_ptr[1]); - //RARCH_LOG("Digital buttons: %d\n", rpt_ptr[2]); - //RARCH_LOG("Start/share: %d\n", rpt_ptr[3]); - //RARCH_LOG("Test: %d\n", rpt_ptr[4] & 0x01); - //RARCH_LOG("L2 button: %d\n", rpt_ptr[5]); - //RARCH_LOG("R2 button: %d\n", rpt_ptr[6]); + //RARCH_LOG("Left stick X: %d\n", rpt_ptr[0]); + //RARCH_LOG("Left stick Y: %d\n", rpt_ptr[1]); + //RARCH_LOG("Right stick X: %d\n", rpt_ptr[2]); + //RARCH_LOG("Right stick Y: %d\n", rpt_ptr[3]); + //RARCH_LOG("Digital buttons: %d\n", rpt_ptr[4]); + //RARCH_LOG("Start/share: %d\n", rpt_ptr[5]); + //RARCH_LOG("Test: %d\n", rpt_ptr[6] & 0x01); + //RARCH_LOG("L2 button: %d\n", rpt_ptr[7]); + //RARCH_LOG("R2 button: %d\n", rpt_ptr[8]); device->buttonstate |= ((buttons2 == 128)? (1ULL << RETRO_DEVICE_ID_JOYPAD_R3) : 0); device->buttonstate |= ((buttons2 == 64) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_L3) : 0); device->buttonstate |= ((buttons2 == 32) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_START) : 0);