Merge branch 'master' into joypad-autoconfig

This commit is contained in:
Themaister 2013-04-26 23:55:08 +02:00
commit d2b80f568f
5 changed files with 29 additions and 26 deletions

View File

@ -361,15 +361,6 @@ void init_drivers(void)
adjust_system_rates(); adjust_system_rates();
// Readjust timers first before resetting frame count.
for (unsigned i = 0; i < ARRAY_SIZE(g_extern.delay_timer); i++)
{
if (g_extern.delay_timer[i] > g_extern.frame_count)
g_extern.delay_timer[i] -= g_extern.frame_count;
else
g_extern.delay_timer[i] = 0;
}
g_extern.frame_count = 0; g_extern.frame_count = 0;
init_video_input(); init_video_input();

View File

@ -444,6 +444,7 @@ bool menu_iterate(void)
rgui->need_refresh = true; rgui->need_refresh = true;
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_PREINIT); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_PREINIT);
rgui->old_input_state |= 1ULL << DEVICE_NAV_MENU;
} }
rarch_input_poll(); rarch_input_poll();
@ -464,13 +465,14 @@ bool menu_iterate(void)
if (!first_held) if (!first_held)
{ {
first_held = true; first_held = true;
g_extern.delay_timer[1] = g_extern.frame_count + (initial_held ? 15 : 7); rgui->delay_timer = initial_held ? 12 : 6;
rgui->delay_count = 0;
} }
if (g_extern.frame_count >= g_extern.delay_timer[1]) if (rgui->delay_count >= rgui->delay_timer)
{ {
first_held = false; first_held = false;
rgui->trigger_state = input_state; //second input frame set as current frame rgui->trigger_state = input_state;
} }
initial_held = false; initial_held = false;
@ -481,6 +483,7 @@ bool menu_iterate(void)
initial_held = true; initial_held = true;
} }
rgui->delay_count++;
rgui->old_input_state = input_state; rgui->old_input_state = input_state;
input_entry_ret = rgui_iterate(rgui); input_entry_ret = rgui_iterate(rgui);

View File

@ -181,6 +181,9 @@ typedef struct
uint64_t trigger_state; uint64_t trigger_state;
bool do_held; bool do_held;
unsigned delay_timer;
unsigned delay_count;
uint16_t *frame_buf; uint16_t *frame_buf;
size_t frame_buf_pitch; size_t frame_buf_pitch;
bool frame_buf_show; bool frame_buf_show;

View File

@ -2071,7 +2071,6 @@ static const struct retro_keybind *menu_nav_binds[] = {
int rgui_input_postprocess(void *data, uint64_t old_state) int rgui_input_postprocess(void *data, uint64_t old_state)
{ {
(void)data; (void)data;
(void)old_state;
int ret = 0; int ret = 0;
@ -2084,16 +2083,15 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
ret = -1; ret = -1;
} }
if (g_extern.frame_count >= g_extern.delay_timer[0]) if ((rgui->trigger_state & (1ULL << DEVICE_NAV_MENU)) &&
g_extern.main_is_init &&
!g_extern.libretro_dummy)
{ {
if ((rgui->trigger_state & (1ULL << DEVICE_NAV_MENU)) && g_extern.main_is_init) if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME))
{ g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME))
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT); g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
ret = -1;
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
ret = -1;
}
} }
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME_EXIT) && if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME_EXIT) &&
@ -2146,8 +2144,14 @@ uint64_t rgui_input(void)
input_state |= input_key_pressed_func(RARCH_MENU_TOGGLE) ? (1ULL << DEVICE_NAV_MENU) : 0; input_state |= input_key_pressed_func(RARCH_MENU_TOGGLE) ? (1ULL << DEVICE_NAV_MENU) : 0;
#endif #endif
rgui->trigger_state = input_state & ~(rgui->old_input_state); rgui->trigger_state = input_state & ~rgui->old_input_state;
rgui->do_held = (input_state & ((1ULL << DEVICE_NAV_UP) | (1ULL << DEVICE_NAV_DOWN) | (1ULL << DEVICE_NAV_LEFT) | (1ULL << DEVICE_NAV_RIGHT))) && !(input_state & ((1ULL << DEVICE_NAV_MENU)));
rgui->do_held = (input_state & (
(1ULL << DEVICE_NAV_UP) |
(1ULL << DEVICE_NAV_DOWN) |
(1ULL << DEVICE_NAV_LEFT) |
(1ULL << DEVICE_NAV_RIGHT))) &&
!(input_state & DEVICE_NAV_MENU);
return input_state; return input_state;
} }

View File

@ -802,8 +802,11 @@ static void parse_input(int argc, char *argv[])
return; return;
} }
for (int i = 0; i < argc; i++)
fprintf(stderr, "\targv[%d] = %s\n", i, argv[i]);
// Make sure we can call parse_input several times ... // Make sure we can call parse_input several times ...
optind = 1; optind = 0;
int val = 0; int val = 0;
@ -2917,7 +2920,6 @@ static inline bool check_enter_rgui(void)
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME); g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU); g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
g_extern.delay_timer[0] = g_extern.frame_count + 30; // FIXME: Purge. Should do something similar in RGUI as well.
old_rmenu_toggle = true; old_rmenu_toggle = true;
return true; return true;
} }