mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Create menu_input_frame_build
This commit is contained in:
parent
76f7114b47
commit
89f0c4211c
@ -1196,10 +1196,44 @@ static unsigned menu_input_frame_pointer(unsigned *data)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned menu_input_frame_build(retro_input_t trigger_input)
|
||||||
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
unsigned ret = MENU_ACTION_NOOP;
|
||||||
|
|
||||||
|
if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP))
|
||||||
|
ret = MENU_ACTION_UP;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||||
|
ret = MENU_ACTION_DOWN;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||||
|
ret = MENU_ACTION_LEFT;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||||
|
ret = MENU_ACTION_RIGHT;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << settings->menu_scroll_up_btn))
|
||||||
|
ret = MENU_ACTION_SCROLL_UP;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << settings->menu_scroll_down_btn))
|
||||||
|
ret = MENU_ACTION_SCROLL_DOWN;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << settings->menu_cancel_btn))
|
||||||
|
ret = MENU_ACTION_CANCEL;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << settings->menu_ok_btn))
|
||||||
|
ret = MENU_ACTION_OK;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << settings->menu_search_btn))
|
||||||
|
ret = MENU_ACTION_SEARCH;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y))
|
||||||
|
ret = MENU_ACTION_SCAN;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << settings->menu_default_btn))
|
||||||
|
ret = MENU_ACTION_START;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << settings->menu_info_btn))
|
||||||
|
ret = MENU_ACTION_INFO;
|
||||||
|
else if (trigger_input & (UINT64_C(1) << RARCH_MENU_TOGGLE))
|
||||||
|
ret = MENU_ACTION_TOGGLE;
|
||||||
|
|
||||||
|
return menu_input_frame_pointer(&ret);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned menu_input_frame_retropad(retro_input_t input, retro_input_t trigger_input)
|
unsigned menu_input_frame_retropad(retro_input_t input, retro_input_t trigger_input)
|
||||||
{
|
{
|
||||||
float delta_time;
|
float delta_time;
|
||||||
unsigned ret = MENU_ACTION_NOOP;
|
|
||||||
static bool initial_held = true;
|
static bool initial_held = true;
|
||||||
static bool first_held = false;
|
static bool first_held = false;
|
||||||
static const retro_input_t input_repeat =
|
static const retro_input_t input_repeat =
|
||||||
@ -1271,32 +1305,5 @@ unsigned menu_input_frame_retropad(retro_input_t input, retro_input_t trigger_in
|
|||||||
trigger_input = 0;
|
trigger_input = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP))
|
return menu_input_frame_build(trigger_input);
|
||||||
ret = MENU_ACTION_UP;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN))
|
|
||||||
ret = MENU_ACTION_DOWN;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT))
|
|
||||||
ret = MENU_ACTION_LEFT;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
|
||||||
ret = MENU_ACTION_RIGHT;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << settings->menu_scroll_up_btn))
|
|
||||||
ret = MENU_ACTION_SCROLL_UP;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << settings->menu_scroll_down_btn))
|
|
||||||
ret = MENU_ACTION_SCROLL_DOWN;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << settings->menu_cancel_btn))
|
|
||||||
ret = MENU_ACTION_CANCEL;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << settings->menu_ok_btn))
|
|
||||||
ret = MENU_ACTION_OK;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << settings->menu_search_btn))
|
|
||||||
ret = MENU_ACTION_SEARCH;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y))
|
|
||||||
ret = MENU_ACTION_SCAN;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << settings->menu_default_btn))
|
|
||||||
ret = MENU_ACTION_START;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << settings->menu_info_btn))
|
|
||||||
ret = MENU_ACTION_INFO;
|
|
||||||
else if (trigger_input & (UINT64_C(1) << RARCH_MENU_TOGGLE))
|
|
||||||
ret = MENU_ACTION_TOGGLE;
|
|
||||||
|
|
||||||
return menu_input_frame_pointer(&ret);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user