mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-07-05 20:42:08 -07:00
Fix feedback state position 0x1b when DualSense is connected.
The previous value of `0` caused the PS5 to expect a set of 'trigger status' values in the 0x19 and 0x1a position, which would have required reading raw values from the DualSense HID device, since these values are not reported by the SDL DualSense driver (code that does so can be checked out from the `trigger-feedback` branch on https://git.sr.ht/~jbaiter/chiaki). Fortunately this is not neccessary, simply setting the value to `1` seems to make the PS5 to rely on fallback logic (presumably based on the L2/R2 value) and games that would otherwise have relied on the trigger status (Astro's Playroom climbing levels) now work without any problems.
This commit is contained in:
parent
4c8209762c
commit
7a490b5aae
3 changed files with 8 additions and 4 deletions
|
@ -38,7 +38,7 @@ CHIAKI_EXPORT void chiaki_feedback_state_format_v9(uint8_t *buf, ChiakiFeedbackS
|
|||
/**
|
||||
* @param buf buffer of at least CHIAKI_FEEDBACK_STATE_BUF_SIZE_V12
|
||||
*/
|
||||
CHIAKI_EXPORT void chiaki_feedback_state_format_v12(uint8_t *buf, ChiakiFeedbackState *state, bool enable_dualsense);
|
||||
CHIAKI_EXPORT void chiaki_feedback_state_format_v12(uint8_t *buf, ChiakiFeedbackState *state);
|
||||
|
||||
#define CHIAKI_HISTORY_EVENT_SIZE_MAX 0x5
|
||||
|
||||
|
|
|
@ -76,12 +76,16 @@ CHIAKI_EXPORT void chiaki_feedback_state_format_v9(uint8_t *buf, ChiakiFeedbackS
|
|||
*((chiaki_unaligned_uint16_t *)(buf + 0x17)) = htons((uint16_t)state->right_y);
|
||||
}
|
||||
|
||||
CHIAKI_EXPORT void chiaki_feedback_state_format_v12(uint8_t *buf, ChiakiFeedbackState *state, bool enable_dualsense)
|
||||
CHIAKI_EXPORT void chiaki_feedback_state_format_v12(uint8_t *buf, ChiakiFeedbackState *state)
|
||||
{
|
||||
chiaki_feedback_state_format_v9(buf, state);
|
||||
buf[0x19] = 0x0;
|
||||
buf[0x1a] = 0x0;
|
||||
buf[0x1b] = enable_dualsense ? 0x0 : 0x1;
|
||||
|
||||
// 1 is classic DualShock, 0 is DualSense, but using 0 requires setting [0x19] and [0x1a] to
|
||||
// values taken from raw HID, which is generally not available. But setting 1 for both seems
|
||||
// to always work fine.
|
||||
buf[0x1b] = 0x1;
|
||||
}
|
||||
|
||||
CHIAKI_EXPORT ChiakiErrorCode chiaki_feedback_history_event_set_button(ChiakiFeedbackHistoryEvent *event, uint64_t button, uint8_t state)
|
||||
|
|
|
@ -558,7 +558,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_takion_send_feedback_state(ChiakiTakion *ta
|
|||
else
|
||||
{
|
||||
buf_sz = 0xc + CHIAKI_FEEDBACK_STATE_BUF_SIZE_V12;
|
||||
chiaki_feedback_state_format_v12(buf + 0xc, feedback_state, takion->enable_dualsense);
|
||||
chiaki_feedback_state_format_v12(buf + 0xc, feedback_state);
|
||||
}
|
||||
return takion_send_feedback_packet(takion, buf, buf_sz);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue