diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index d1230b3227..95bdac54dc 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -26,6 +26,7 @@ #include #include "../../gfx/gl_common.h" +#include "../../performance.h" #include "../../gfx/video_thread_wrapper.h" #include @@ -36,7 +37,7 @@ #endif #ifndef XMB_DELAY -#define XMB_DELAY 0.02 +#define XMB_DELAY 10 #endif typedef struct @@ -1136,7 +1137,7 @@ static void xmb_frame(void) if (!gl) return; - menu_animation_update(menu->animation, menu->dt / 8000000.0); + menu_animation_update(menu->animation, menu->dt / IDEAL_DT); glViewport(0, 0, gl->win_width, gl->win_height); diff --git a/menu/menu.c b/menu/menu.c index 2537a1f560..8658d267ef 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -382,10 +382,10 @@ int menu_iterate(retro_input_t input, menu->cur_time = rarch_get_time_usec(); menu->dt = menu->cur_time - menu->old_time; - if (menu->dt > 30000) - menu->dt = 30000; - if (menu->dt < 4000) - menu->dt = 4000; + if (menu->dt >= IDEAL_DT * 2) + menu->dt = IDEAL_DT * 2; + if (menu->dt <= IDEAL_DT / 2) + menu->dt = IDEAL_DT / 2; menu->old_time = menu->cur_time; if (driver.menu_ctx) diff --git a/menu/menu_input.c b/menu/menu_input.c index 7de8bf1396..b7f415c6c4 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -497,7 +497,7 @@ unsigned menu_input_frame(retro_input_t input, retro_input_t trigger_input) menu->mouse.enable = g_settings.menu.mouse_enable; - menu->delay.count += menu->dt / 10000.0; + menu->delay.count += menu->dt / IDEAL_DT; if (driver.block_input) trigger_input = 0; diff --git a/performance.h b/performance.h index f47a87231b..a8734a3d7b 100644 --- a/performance.h +++ b/performance.h @@ -44,6 +44,10 @@ extern "C" { #define MAX_COUNTERS 64 #endif +#ifndef IDEAL_DT +#define IDEAL_DT (1.0 / 60.0 * 1000000.0) +#endif + extern const struct retro_perf_counter *perf_counters_rarch[MAX_COUNTERS]; extern const struct retro_perf_counter *perf_counters_libretro[MAX_COUNTERS]; extern unsigned perf_ptr_rarch;