mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Merge branch 'master' of https://github.com/libretro/RetroArch
This commit is contained in:
commit
a1496c05a4
@ -10,6 +10,7 @@ HAVE_DYLIB = 1
|
||||
HAVE_D3D9 = 1
|
||||
HAVE_NETPLAY = 1
|
||||
HAVE_STDIN_CMD = 1
|
||||
HAVE_COMMAND = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_GLUI = 1
|
||||
|
@ -63,8 +63,6 @@
|
||||
|
||||
#define MAX_ARGS 32
|
||||
|
||||
int (*frontend_loop)(signature(), args_type() args);
|
||||
|
||||
static retro_keyboard_event_t key_event;
|
||||
|
||||
static int main_entry_iterate_shutdown(signature(), args_type() args)
|
||||
@ -82,29 +80,28 @@ static int main_entry_iterate_shutdown(signature(), args_type() args)
|
||||
|
||||
int main_entry_decide(signature(), args_type() args)
|
||||
{
|
||||
frontend_loop = NULL;
|
||||
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_CLEAR_INPUT))
|
||||
frontend_loop = main_entry_iterate_clear_input;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_LOAD_GAME))
|
||||
frontend_loop = main_entry_iterate_load_content;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_GAME))
|
||||
frontend_loop = main_entry_iterate_content;
|
||||
#ifdef HAVE_MENU
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU_PREINIT))
|
||||
frontend_loop = main_entry_iterate_menu_preinit;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU))
|
||||
frontend_loop = main_entry_iterate_menu;
|
||||
#endif
|
||||
if (g_extern.system.shutdown)
|
||||
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_CLEAR_INPUT))
|
||||
return main_entry_iterate_clear_input(signature_expand(), args);
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_LOAD_GAME))
|
||||
return main_entry_iterate_load_content(signature_expand(), args);
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_GAME))
|
||||
return main_entry_iterate_content(signature_expand(), args);
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_MENU_PREINIT))
|
||||
return main_entry_iterate_menu_preinit(signature_expand(), args);
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_MENU))
|
||||
return main_entry_iterate_menu(signature_expand(), args);
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
#else
|
||||
return main_entry_iterate_content_nomenu(signature_expand(), args);
|
||||
#endif
|
||||
}
|
||||
|
||||
int main_entry_iterate_content(signature(), args_type() args)
|
||||
{
|
||||
if (g_extern.system.shutdown)
|
||||
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||
|
||||
if (!rarch_main_iterate())
|
||||
{
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_RUNNING_FINISHED);
|
||||
@ -131,9 +128,6 @@ int main_entry_iterate_clear_input(signature(), args_type() args)
|
||||
{
|
||||
(void)args;
|
||||
|
||||
if (g_extern.system.shutdown)
|
||||
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||
|
||||
rarch_input_poll();
|
||||
#ifdef HAVE_MENU
|
||||
if (menu_input())
|
||||
@ -149,9 +143,6 @@ int main_entry_iterate_clear_input(signature(), args_type() args)
|
||||
|
||||
int main_entry_iterate_load_content(signature(), args_type() args)
|
||||
{
|
||||
if (g_extern.system.shutdown)
|
||||
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (!load_menu_content())
|
||||
{
|
||||
@ -172,9 +163,6 @@ int main_entry_iterate_menu_preinit(signature(), args_type() args)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (g_extern.system.shutdown)
|
||||
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||
|
||||
/* Menu should always run with vsync on. */
|
||||
rarch_main_command(RARCH_CMD_VIDEO_SET_BLOCKING_STATE);
|
||||
|
||||
@ -206,9 +194,6 @@ int main_entry_iterate_menu_preinit(signature(), args_type() args)
|
||||
|
||||
int main_entry_iterate_menu(signature(), args_type() args)
|
||||
{
|
||||
if (g_extern.system.shutdown)
|
||||
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||
|
||||
if (menu_iterate())
|
||||
{
|
||||
if (driver.frontend_ctx && driver.frontend_ctx->process_events)
|
||||
@ -395,12 +380,10 @@ returntype main_entry(signature())
|
||||
if (ret)
|
||||
#endif
|
||||
rarch_playlist_push(g_extern.history, g_extern.fullpath);
|
||||
#else
|
||||
frontend_loop = main_entry_iterate_content_nomenu;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MAIN_LOOP)
|
||||
while (frontend_loop && !frontend_loop(signature_expand(), args));
|
||||
while (!main_entry_decide(signature_expand(), args));
|
||||
|
||||
main_exit(args);
|
||||
#endif
|
||||
|
@ -86,9 +86,6 @@ int main_entry_iterate_menu_preinit(signature(), args_type() args);
|
||||
int main_entry_iterate_menu(signature(), args_type() args);
|
||||
#endif
|
||||
|
||||
extern int (*frontend_loop)(signature(), args_type() args);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1409,6 +1409,13 @@ static int menu_common_iterate(unsigned action)
|
||||
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->set_texture)
|
||||
driver.menu_ctx->set_texture(driver.menu);
|
||||
|
||||
if (action == MENU_ACTION_TOGGLE &&
|
||||
g_extern.main_is_init && !g_extern.libretro_dummy)
|
||||
{
|
||||
rarch_main_command(RARCH_CMD_RESUME);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!strcmp(menu_label, "help"))
|
||||
return menu_start_screen_iterate(action);
|
||||
else if (!strcmp(menu_label, "info_screen"))
|
||||
|
@ -316,14 +316,6 @@ static int glui_input_postprocess(uint64_t old_state)
|
||||
{
|
||||
(void)old_state;
|
||||
|
||||
if ((driver.menu->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
|
||||
g_extern.main_is_init &&
|
||||
!g_extern.libretro_dummy)
|
||||
{
|
||||
rarch_main_command(RARCH_CMD_RESUME);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1069,11 +1069,7 @@ static int lakka_input_postprocess(uint64_t old_state)
|
||||
& (1ULL << RARCH_MENU_TOGGLE)) &&
|
||||
g_extern.main_is_init &&
|
||||
!g_extern.libretro_dummy)
|
||||
{
|
||||
global_alpha = 0;
|
||||
rarch_main_command(RARCH_CMD_RESUME);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (! global_alpha)
|
||||
add_tween(LAKKA_DELAY, 1.0, &global_alpha, &inOutQuad, NULL);
|
||||
|
@ -454,16 +454,6 @@ static void rgui_free(void *data)
|
||||
|
||||
static int rgui_input_postprocess(uint64_t old_state)
|
||||
{
|
||||
(void)old_state;
|
||||
|
||||
if ((driver.menu->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
|
||||
g_extern.main_is_init &&
|
||||
!g_extern.libretro_dummy)
|
||||
{
|
||||
rarch_main_command(RARCH_CMD_RESUME);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -328,16 +328,7 @@ static void rmenu_free(void *data)
|
||||
|
||||
static int rmenu_input_postprocess(uint64_t old_state)
|
||||
{
|
||||
menu_handle_t *menu = (menu_handle_t*)driver.menu;
|
||||
|
||||
if ((menu->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
|
||||
g_extern.main_is_init &&
|
||||
!g_extern.libretro_dummy)
|
||||
{
|
||||
rarch_main_command(RARCH_CMD_RESUME);
|
||||
return -1;
|
||||
}
|
||||
|
||||
(void)old_state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -343,12 +343,7 @@ static void rmenu_xui_frame(void)
|
||||
|
||||
static int rmenu_xui_input_postprocess(uint64_t old_state)
|
||||
{
|
||||
if ((driver.menu->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
|
||||
g_extern.main_is_init)
|
||||
{
|
||||
rarch_main_command(RARCH_CMD_RESUME);
|
||||
return -1;
|
||||
}
|
||||
(void)old_state;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -295,6 +295,8 @@ static unsigned input_frame(uint64_t trigger_state)
|
||||
return MENU_ACTION_START;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
return MENU_ACTION_SELECT;
|
||||
if (trigger_state & (1ULL << RARCH_MENU_TOGGLE))
|
||||
return MENU_ACTION_TOGGLE;
|
||||
return MENU_ACTION_NOOP;
|
||||
}
|
||||
|
||||
@ -304,7 +306,6 @@ bool menu_iterate(void)
|
||||
static bool initial_held = true;
|
||||
static bool first_held = false;
|
||||
uint64_t input_state = 0;
|
||||
int32_t input_entry_ret = 0;
|
||||
int32_t ret = 0;
|
||||
|
||||
if (!driver.menu)
|
||||
@ -371,7 +372,7 @@ bool menu_iterate(void)
|
||||
|
||||
if (driver.menu_ctx && driver.menu_ctx->backend
|
||||
&& driver.menu_ctx->backend->iterate)
|
||||
input_entry_ret = driver.menu_ctx->backend->iterate(action);
|
||||
driver.menu_ctx->backend->iterate(action);
|
||||
|
||||
draw_frame(true);
|
||||
throttle_frame();
|
||||
@ -383,7 +384,7 @@ bool menu_iterate(void)
|
||||
if (ret < 0)
|
||||
menu_flush_stack_type(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
|
||||
if (ret || input_entry_ret)
|
||||
if (ret)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -94,6 +94,7 @@ typedef enum
|
||||
MENU_ACTION_MESSAGE,
|
||||
MENU_ACTION_SCROLL_DOWN,
|
||||
MENU_ACTION_SCROLL_UP,
|
||||
MENU_ACTION_TOGGLE,
|
||||
MENU_ACTION_NOOP
|
||||
} menu_action_t;
|
||||
|
||||
|
@ -31,7 +31,7 @@ static void do_iteration(void)
|
||||
if (!(g_extern.main_is_init && !g_extern.is_paused))
|
||||
return;
|
||||
|
||||
if (!frontend_loop || (frontend_loop && frontend_loop(0, NULL, NULL)))
|
||||
if (main_entry_decide(0, NULL, NULL))
|
||||
{
|
||||
main_exit(NULL);
|
||||
return;
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
static void emscripten_mainloop(void)
|
||||
{
|
||||
if (frontend_loop || (frontend_loop && frontend_loop(0, NULL, NULL)))
|
||||
if (main_entry_decide(0, NULL, NULL))
|
||||
{
|
||||
main_exit(NULL);
|
||||
exit(0);
|
||||
|
@ -563,8 +563,8 @@ static void gfx_ctx_input_driver(void *data, const input_driver_t **input, void
|
||||
{
|
||||
(void)data;
|
||||
dinput_wgl = input_dinput.init();
|
||||
*input = dinput ? &input_dinput : NULL;
|
||||
*input_data = dinput;
|
||||
*input = dinput_wgl ? &input_dinput : NULL;
|
||||
*input_data = dinput_wgl;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_has_focus(void *data)
|
||||
|
@ -3285,9 +3285,6 @@ static inline void limit_frame_time(void)
|
||||
|
||||
void rarch_main_set_state(unsigned cmd)
|
||||
{
|
||||
|
||||
frontend_loop = NULL;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case RARCH_ACTION_STATE_MENU_PREINIT:
|
||||
@ -3335,8 +3332,6 @@ void rarch_main_set_state(unsigned cmd)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
frontend_loop = main_entry_decide;
|
||||
}
|
||||
|
||||
void rarch_main_command(unsigned cmd)
|
||||
@ -3548,6 +3543,9 @@ void rarch_main_command(unsigned cmd)
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_FORCE_QUIT);
|
||||
break;
|
||||
case RARCH_CMD_RESUME:
|
||||
#ifdef HAVE_MENU
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED);
|
||||
#endif
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_RUNNING);
|
||||
break;
|
||||
case RARCH_CMD_RESTART_RETROARCH:
|
||||
|
Loading…
x
Reference in New Issue
Block a user