Skip to content

Commit 79a627a

Browse files
authored
Fix overlay turbo fire (#18333)
1 parent 477cb70 commit 79a627a

1 file changed

Lines changed: 44 additions & 34 deletions

File tree

input/input_driver.c

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6017,40 +6017,6 @@ void input_driver_poll(void)
60176017
&& input_st->current_driver->poll)
60186018
input_st->current_driver->poll(input_st->current_data);
60196019

6020-
input_st->turbo_btns.count++;
6021-
6022-
if (input_st->flags & INP_FLAG_BLOCK_LIBRETRO_INPUT)
6023-
{
6024-
for (i = 0; i < max_users; i++)
6025-
input_st->turbo_btns.frame_enable[i] = 0;
6026-
return;
6027-
}
6028-
6029-
/* This rarch_joypad_info_t struct contains the device index + autoconfig binds for the
6030-
* controller to be queried, and also (for unknown reasons) the analog axis threshold
6031-
* when mapping analog stick to dpad input. */
6032-
for (i = 0; i < max_users; i++)
6033-
{
6034-
uint16_t button_id = RARCH_TURBO_ENABLE;
6035-
6036-
if (settings->ints.input_turbo_bind != -1)
6037-
button_id = settings->ints.input_turbo_bind;
6038-
6039-
joypad_info[i].axis_threshold = input_axis_threshold;
6040-
joypad_info[i].joy_idx = settings->uints.input_joypad_index[i];
6041-
joypad_info[i].auto_binds = input_autoconf_binds[joypad_info[i].joy_idx];
6042-
6043-
input_st->turbo_btns.frame_enable[i] =
6044-
(*input_st->libretro_input_binds[i])[button_id].valid
6045-
&& settings->bools.input_turbo_enable ?
6046-
input_state_wrap(input_st->current_driver, input_st->current_data,
6047-
joypad, sec_joypad, &joypad_info[i],
6048-
(*input_st->libretro_input_binds),
6049-
(input_st->flags & INP_FLAG_KB_MAPPING_BLOCKED) ? true : false,
6050-
(unsigned)i,
6051-
RETRO_DEVICE_JOYPAD, 0, button_id) : 0;
6052-
}
6053-
60546020
#ifdef HAVE_OVERLAY
60556021
if ( input_st->overlay_ptr
60566022
&& (input_st->overlay_ptr->flags & INPUT_OVERLAY_ALIVE))
@@ -6091,6 +6057,50 @@ void input_driver_poll(void)
60916057
}
60926058
#endif
60936059

6060+
input_st->turbo_btns.count++;
6061+
6062+
if (input_st->flags & INP_FLAG_BLOCK_LIBRETRO_INPUT)
6063+
{
6064+
for (i = 0; i < max_users; i++)
6065+
input_st->turbo_btns.frame_enable[i] = 0;
6066+
return;
6067+
}
6068+
6069+
/* This rarch_joypad_info_t struct contains the device index + autoconfig binds for the
6070+
* controller to be queried, and also (for unknown reasons) the analog axis threshold
6071+
* when mapping analog stick to dpad input. */
6072+
for (i = 0; i < max_users; i++)
6073+
{
6074+
uint16_t button_id = RARCH_TURBO_ENABLE;
6075+
bool turbo_enable = settings->bools.input_turbo_enable;
6076+
6077+
if (settings->ints.input_turbo_bind != -1)
6078+
button_id = settings->ints.input_turbo_bind;
6079+
6080+
joypad_info[i].axis_threshold = input_axis_threshold;
6081+
joypad_info[i].joy_idx = settings->uints.input_joypad_index[i];
6082+
joypad_info[i].auto_binds = input_autoconf_binds[joypad_info[i].joy_idx];
6083+
6084+
input_st->turbo_btns.frame_enable[i] =
6085+
(*input_st->libretro_input_binds[i])[button_id].valid
6086+
&& turbo_enable ?
6087+
input_state_wrap(input_st->current_driver, input_st->current_data,
6088+
joypad, sec_joypad, &joypad_info[i],
6089+
(*input_st->libretro_input_binds),
6090+
(input_st->flags & INP_FLAG_KB_MAPPING_BLOCKED) ? true : false,
6091+
(unsigned)i,
6092+
RETRO_DEVICE_JOYPAD, 0, button_id) : 0;
6093+
6094+
#ifdef HAVE_OVERLAY
6095+
if ( (i == 0)
6096+
&& turbo_enable
6097+
&& input_st->overlay_ptr
6098+
&& (input_st->overlay_ptr->flags & INPUT_OVERLAY_ALIVE)
6099+
&& BIT256_GET(input_st->overlay_ptr->overlay_state.buttons, button_id))
6100+
input_st->turbo_btns.frame_enable[i] = true;
6101+
#endif
6102+
}
6103+
60946104
#ifdef HAVE_MENU
60956105
if (!(menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE))
60966106
#endif

0 commit comments

Comments
 (0)