Move BIT256_CLEAR_ALL_PTR outside of function

This commit is contained in:
twinaphex 2018-04-09 00:34:07 +02:00
parent 7b5a0bf706
commit a5c7b79842
2 changed files with 3 additions and 3 deletions

View File

@ -1133,8 +1133,6 @@ void input_get_state_for_port(void *data, unsigned port, input_bits_t *p_new_sta
settings_t *settings = (settings_t*)data;
const input_device_driver_t *joypad_driver = input_driver_get_joypad_driver();
BIT256_CLEAR_ALL_PTR(p_new_state);
joypad_info.joy_idx = settings->uints.input_joypad_map[port];
joypad_info.auto_binds = input_autoconf_binds[joypad_info.joy_idx];
joypad_info.axis_threshold = input_driver_axis_threshold;
@ -1159,7 +1157,7 @@ void input_get_state_for_port(void *data, unsigned port, input_bits_t *p_new_sta
joypad_info, port, i, j, libretro_input_binds[port]);
if (val >= 0)
p_new_state->analogs[offset] = val;
p_new_state->analogs[offset] = val;
else
p_new_state->analogs[offset+1] = val;
}

View File

@ -106,6 +106,7 @@ void input_mapper_poll(input_mapper_t *handle)
{
/* keyboard to gamepad remapping */
case RETRO_DEVICE_KEYBOARD:
BIT256_CLEAR_ALL_PTR(&current_input);
input_get_state_for_port(settings, i, &current_input);
for (j = 0; j < RARCH_CUSTOM_BIND_LIST_END; j++)
{
@ -147,6 +148,7 @@ void input_mapper_poll(input_mapper_t *handle)
* the bit on the mapper input bitmap, later on the
* original input is cleared in input_state */
BIT256_CLEAR_ALL(handle->buttons[i]);
BIT256_CLEAR_ALL_PTR(&current_input);
for (j = 0; j < 8; j++)
handle->analog_value[i][j] = 0;