(RARCH_CONSOLE) frontend_console cleanups

This commit is contained in:
twinaphex 2013-01-08 08:11:05 +01:00
parent 2ad74ead6c
commit bc4e010a96
2 changed files with 14 additions and 13 deletions

View File

@ -47,6 +47,12 @@ static void init_drivers_console(void)
init_audio();
}
static void uninit_drivers_console(void)
{
driver.input->free(NULL);
driver.video->stop();
}
int main(int argc, char *argv[])
{
system_init();
@ -115,9 +121,16 @@ begin_loop:
int init_ret = rarch_main_init_wrap(&args);
if (init_ret == 0)
{
RARCH_LOG("rarch_main_init succeeded.\n");
g_extern.console.rmenu.mode = MODE_EMULATION;
}
else
{
RARCH_ERR("rarch_main_init failed.\n");
g_extern.console.rmenu.mode = MODE_MENU;
rarch_settings_msg(S_MSG_ROM_LOADING_ERROR, S_DELAY_180);
}
}
else if(g_extern.console.rmenu.mode == MODE_MENU)
while(rmenu_iterate());
@ -134,9 +147,8 @@ begin_shutdown:
if(g_extern.main_is_init)
rarch_main_deinit();
driver.input->free(NULL);
driver.video->stop();
menu_free();
uninit_drivers_console();
#ifdef HAVE_LOGGER
logger_shutdown();

View File

@ -2944,17 +2944,6 @@ int rarch_main_init_wrap(const struct rarch_main_wrap *args)
int ret = rarch_main_init(argc, argv);
#ifdef RARCH_CONSOLE
if (ret == 0)
g_extern.console.rmenu.mode = MODE_EMULATION;
else
{
//failed to load the ROM for whatever reason
g_extern.console.rmenu.mode = MODE_MENU;
rarch_settings_msg(S_MSG_ROM_LOADING_ERROR, S_DELAY_180);
}
#endif
for (int i = 0; i < ARRAY_SIZE(argv_copy); i++)
free(argv_copy[i]);