Skip to content

Commit

Permalink
Add another toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Sep 30, 2018
1 parent c8a7641 commit 4f2c108
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions input/input_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enum input_toggle_type
INPUT_TOGGLE_L3_R3,
INPUT_TOGGLE_L1_R1_START_SELECT,
INPUT_TOGGLE_START_SELECT,
INPUT_TOGGLE_L3_R,
INPUT_TOGGLE_LAST
};

Expand Down
5 changes: 4 additions & 1 deletion menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,9 @@ static void setting_get_string_representation_toggle_gamepad_combo(
case INPUT_TOGGLE_START_SELECT:
strlcpy(s, "Start + Select", len);
break;
case INPUT_TOGGLE_L3_R:
strlcpy(s, "L3 + R", len);
break;
}
}

Expand Down Expand Up @@ -6265,7 +6268,7 @@ static bool setting_append_list(
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_toggle_gamepad_combo;
menu_settings_list_current_add_range(list, list_info, 0, 4, 1, true, true);
menu_settings_list_current_add_range(list, list_info, 0, 5, 1, true, true);

CONFIG_BOOL(
list, list_info,
Expand Down
6 changes: 6 additions & 0 deletions retroarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2489,6 +2489,12 @@ static bool input_driver_toggle_button_combo(
if (!BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_SELECT))
return false;
break;
case INPUT_TOGGLE_L3_R:
if (!BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L3))
return false;
if (!BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R))
return false;
break;
default:
case INPUT_TOGGLE_NONE:
return false;
Expand Down

0 comments on commit 4f2c108

Please sign in to comment.