(Menu) Do away with throttle_frame in menu_iterate - let rarch_main_iterate

do this
This commit is contained in:
twinaphex 2014-09-28 19:11:11 +02:00
parent 099b3f6fd7
commit 449cb9e9ed
3 changed files with 8 additions and 27 deletions

View File

@ -34,23 +34,6 @@ static void draw_frame(bool enable)
rarch_render_cached_frame();
}
static void throttle_frame(void)
{
if (!driver.menu)
return;
/* Throttle in case VSync is broken (avoid 1000+ FPS Menu). */
driver.menu->time = rarch_get_time_usec();
driver.menu->delta = (driver.menu->time - driver.menu->last_time) / 1000;
driver.menu->target_msec = 750 / g_settings.video.refresh_rate;
/* Try to sleep less, so we can hopefully rely on FPS logger. */
driver.menu->sleep_msec = driver.menu->target_msec - driver.menu->delta;
if (driver.menu->sleep_msec > 0)
rarch_sleep((unsigned int)driver.menu->sleep_msec);
driver.menu->last_time = rarch_get_time_usec();
}
/* Update menu state which depends on config. */
static void update_libretro_info(struct retro_system_info *info)
@ -364,7 +347,6 @@ bool menu_iterate(retro_input_t input,
ret = driver.menu_ctx->backend->iterate(action);
draw_frame(true);
throttle_frame();
draw_frame(false);
if (driver.menu_ctx && driver.menu_ctx->input_postprocess)

View File

@ -130,10 +130,6 @@ typedef struct
} keyboard;
bool bind_mode_keyboard;
int64_t time;
int64_t delta;
int64_t target_msec;
int64_t sleep_msec;
} menu_handle_t;
#ifdef __cplusplus

View File

@ -3201,6 +3201,9 @@ bool rarch_main_iterate(void)
!driver.video->alive(driver.video_data))
return false;
if (g_extern.system.frame_time.callback)
update_frame_time();
#ifdef HAVE_MENU
if (g_extern.is_menu)
{
@ -3219,7 +3222,7 @@ bool rarch_main_iterate(void)
/* Restore libretro keyboard callback. */
g_extern.system.key_event = g_extern.frontend_key_event;
}
return true;
goto end;
}
if (check_enter_menu_func(trigger_input) || (g_extern.libretro_dummy))
@ -3273,14 +3276,10 @@ bool rarch_main_iterate(void)
if ((g_settings.video.frame_delay > 0) && !driver.nonblock_state)
rarch_sleep(g_settings.video.frame_delay);
if (g_extern.system.frame_time.callback)
update_frame_time();
/* Run libretro for one frame. */
pretro_run();
if (g_settings.fastforward_ratio >= 0.0f)
limit_frame_time();
for (i = 0; i < MAX_PLAYERS; i++)
{
@ -3303,6 +3302,10 @@ bool rarch_main_iterate(void)
unlock_autosave();
#endif
end:
if (g_settings.fastforward_ratio >= 0.0f)
limit_frame_time();
return true;
}