Skip to content

Commit

Permalink
Fix R3 button combo handling in general.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanvb committed Feb 11, 2024
1 parent 1c5cf6b commit bb85d2c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions input/input_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,13 @@ static int32_t input_state_wrap(
/* Drivers can overflow when sending too many keys at once.. */
if (id == RETRO_DEVICE_ID_JOYPAD_MASK && ret)
{
/* Deal with menu toggle combo buttons that won't stay inside +32767. */
if (ret == -0x8000) /* R3 */
ret = 0x8000;
else if (ret == -0x4000) /* LR+R3 */
ret = 0x8000 + 0x4000;
/* Deal with R3 + possible combo buttons that won't stay inside +32767. */
if (ret < 0 && ret >= -0x8000) /* R3 */
{
/* Undo the int16_t conversion effects to int32_t *
* Example: -32752 / 0xffff8010 to 32784 / 0x8010 */
ret += 0x10000;
}
else if (ret < 0)
ret = 0;
return ret;
Expand Down

0 comments on commit bb85d2c

Please sign in to comment.