(RARCH_CONSOLE) Build fixes + rarch_main_init_wrap needs to be
always compiled in and not ifndef HAVE_RARCH_MAIN_WRAP
This commit is contained in:
parent
d94dc34b17
commit
66dfceabe1
|
@ -1,49 +0,0 @@
|
||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
|
||||||
* Copyright (C) 2011-2013 - Daniel De Matteis
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#include "rarch_console_main_wrap.h"
|
|
||||||
|
|
||||||
bool rarch_startup (const char * config_file)
|
|
||||||
{
|
|
||||||
const char *config_path = g_extern.config_path;
|
|
||||||
|
|
||||||
if(g_extern.main_is_init)
|
|
||||||
rarch_main_deinit();
|
|
||||||
|
|
||||||
struct rarch_main_wrap args = {0};
|
|
||||||
|
|
||||||
args.verbose = g_extern.verbose;
|
|
||||||
args.config_path = config_file;
|
|
||||||
args.sram_path = g_extern.console.main_wrap.state.default_sram_dir.enable ? g_extern.console.main_wrap.paths.default_sram_dir : NULL,
|
|
||||||
args.state_path = g_extern.console.main_wrap.state.default_savestate_dir.enable ? g_extern.console.main_wrap.paths.default_savestate_dir : NULL,
|
|
||||||
args.rom_path = g_extern.file_state.rom_path;
|
|
||||||
args.libretro_path = g_settings.libretro;
|
|
||||||
|
|
||||||
int init_ret = rarch_main_init_wrap(&args);
|
|
||||||
|
|
||||||
if (init_ret == 0)
|
|
||||||
RARCH_LOG("rarch_main_init succeeded.\n");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RARCH_ERR("rarch_main_init failed.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
|
||||||
* Copyright (C) 2011-2013 - Daniel De Matteis
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef RARCH_CONSOLE_MAIN_WRAP_H__
|
|
||||||
#define RARCH_CONSOLE_MAIN_WRAP_H__
|
|
||||||
|
|
||||||
struct rarch_main_wrap
|
|
||||||
{
|
|
||||||
const char *rom_path;
|
|
||||||
const char *sram_path;
|
|
||||||
const char *state_path;
|
|
||||||
const char *config_path;
|
|
||||||
const char *libretro_path;
|
|
||||||
bool verbose;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool rarch_startup (void);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#include "../../console/rarch_console_exec.h"
|
#include "../../console/rarch_console_exec.h"
|
||||||
#include "../../console/rarch_console_input.h"
|
#include "../../console/rarch_console_input.h"
|
||||||
#include "../../console/rarch_console_main_wrap.h"
|
|
||||||
#include "../../console/rarch_console_settings.h"
|
#include "../../console/rarch_console_settings.h"
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|
@ -560,7 +559,7 @@ int main(int argc, char *argv[])
|
||||||
rarch_render_cached_frame();
|
rarch_render_cached_frame();
|
||||||
g_extern.draw_menu = false;
|
g_extern.draw_menu = false;
|
||||||
|
|
||||||
rarch_startup();
|
g_extern.console.rmenu.mode = MODE_INIT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_extern.console.external_launch.support = EXTERN_LAUNCHER_SALAMANDER;
|
g_extern.console.external_launch.support = EXTERN_LAUNCHER_SALAMANDER;
|
||||||
|
@ -578,13 +577,29 @@ begin_loop:
|
||||||
|
|
||||||
audio_stop_func();
|
audio_stop_func();
|
||||||
}
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if (g_extern.console.rmenu.mode == MODE_INIT)
|
||||||
{
|
{
|
||||||
rmenu_iterate();
|
if(g_extern.main_is_init)
|
||||||
|
rarch_main_deinit();
|
||||||
|
|
||||||
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
struct rarch_main_wrap args = {0};
|
||||||
rarch_startup();
|
|
||||||
|
args.verbose = g_extern.verbose;
|
||||||
|
args.config_path = g_extern.config_path;
|
||||||
|
args.sram_path = g_extern.console.main_wrap.state.default_sram_dir.enable ? g_extern.console.main_wrap.paths.default_sram_dir : NULL,
|
||||||
|
args.state_path = g_extern.console.main_wrap.state.default_savestate_dir.enable ? g_extern.console.main_wrap.paths.default_savestate_dir : NULL,
|
||||||
|
args.rom_path = g_extern.file_state.rom_path;
|
||||||
|
args.libretro_path = g_settings.libretro;
|
||||||
|
|
||||||
|
int init_ret = rarch_main_init_wrap(&args);
|
||||||
|
|
||||||
|
if (init_ret == 0)
|
||||||
|
RARCH_LOG("rarch_main_init succeeded.\n");
|
||||||
|
else
|
||||||
|
RARCH_ERR("rarch_main_init failed.\n");
|
||||||
}
|
}
|
||||||
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
|
rmenu_iterate();
|
||||||
else
|
else
|
||||||
goto begin_shutdown;
|
goto begin_shutdown;
|
||||||
goto begin_loop;
|
goto begin_loop;
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include "../../console/rarch_console_input.h"
|
#include "../../console/rarch_console_input.h"
|
||||||
#include "../../console/rarch_console_config.h"
|
#include "../../console/rarch_console_config.h"
|
||||||
#include "../../console/rarch_console_settings.h"
|
#include "../../console/rarch_console_settings.h"
|
||||||
#include "../../console/rarch_console_main_wrap.h"
|
|
||||||
#include "../../conf/config_file.h"
|
#include "../../conf/config_file.h"
|
||||||
#include "../../conf/config_file_macros.h"
|
#include "../../conf/config_file_macros.h"
|
||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
#include "../../console/rarch_console_input.h"
|
#include "../../console/rarch_console_input.h"
|
||||||
#include "../../console/rarch_console_config.h"
|
#include "../../console/rarch_console_config.h"
|
||||||
#include "../../console/rarch_console_settings.h"
|
#include "../../console/rarch_console_settings.h"
|
||||||
#include "../../console/rarch_console_main_wrap.h"
|
|
||||||
#include "../../console/rarch_console_video.h"
|
#include "../../console/rarch_console_video.h"
|
||||||
#include "../../conf/config_file.h"
|
#include "../../conf/config_file.h"
|
||||||
#include "../../conf/config_file_macros.h"
|
#include "../../conf/config_file_macros.h"
|
||||||
|
@ -350,7 +349,26 @@ begin_loop:
|
||||||
while(rarch_main_iterate());
|
while(rarch_main_iterate());
|
||||||
}
|
}
|
||||||
else if (g_extern.console.rmenu.mode == MODE_INIT)
|
else if (g_extern.console.rmenu.mode == MODE_INIT)
|
||||||
rarch_startup();
|
{
|
||||||
|
if(g_extern.main_is_init)
|
||||||
|
rarch_main_deinit();
|
||||||
|
|
||||||
|
struct rarch_main_wrap args = {0};
|
||||||
|
|
||||||
|
args.verbose = g_extern.verbose;
|
||||||
|
args.config_path = g_extern.config_path;
|
||||||
|
args.sram_path = g_extern.console.main_wrap.state.default_sram_dir.enable ? g_extern.console.main_wrap.paths.default_sram_dir : NULL,
|
||||||
|
args.state_path = g_extern.console.main_wrap.state.default_savestate_dir.enable ? g_extern.console.main_wrap.paths.default_savestate_dir : NULL,
|
||||||
|
args.rom_path = g_extern.file_state.rom_path;
|
||||||
|
args.libretro_path = g_settings.libretro;
|
||||||
|
|
||||||
|
int init_ret = rarch_main_init_wrap(&args);
|
||||||
|
|
||||||
|
if (init_ret == 0)
|
||||||
|
RARCH_LOG("rarch_main_init succeeded.\n");
|
||||||
|
else
|
||||||
|
RARCH_ERR("rarch_main_init failed.\n");
|
||||||
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
while(rmenu_iterate());
|
while(rmenu_iterate());
|
||||||
else
|
else
|
||||||
|
|
|
@ -158,33 +158,36 @@ int main(int argc, char *argv[])
|
||||||
menu_init();
|
menu_init();
|
||||||
|
|
||||||
begin_loop:
|
begin_loop:
|
||||||
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
if (g_extern.console.rmenu.mode == MODE_EMULATION)
|
||||||
{
|
{
|
||||||
|
|
||||||
RARCH_LOG("Gets to: #2.0\n");
|
|
||||||
|
|
||||||
input_psp.poll(NULL);
|
input_psp.poll(NULL);
|
||||||
|
|
||||||
RARCH_LOG("Gets to: #2.1\n");
|
|
||||||
|
|
||||||
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
||||||
|
|
||||||
RARCH_LOG("Gets to: #2.2\n");
|
while(rarch_main_iterate());
|
||||||
|
}
|
||||||
|
else if (g_extern.console.rmenu.mode == MODE_INIT)
|
||||||
|
{
|
||||||
|
if(g_extern.main_is_init)
|
||||||
|
rarch_main_deinit();
|
||||||
|
|
||||||
int count = 0;
|
struct rarch_main_wrap args = {0};
|
||||||
|
|
||||||
while(rarch_main_iterate())
|
args.verbose = g_extern.verbose;
|
||||||
{
|
args.config_path = g_extern.config_path;
|
||||||
RARCH_LOG("Iterate: %d\n", count++);
|
args.sram_path = g_extern.console.main_wrap.state.default_sram_dir.enable ? g_extern.console.main_wrap.paths.default_sram_dir : NULL,
|
||||||
}
|
args.state_path = g_extern.console.main_wrap.state.default_savestate_dir.enable ? g_extern.console.main_wrap.paths.default_savestate_dir : NULL,
|
||||||
|
args.rom_path = g_extern.file_state.rom_path;
|
||||||
|
args.libretro_path = g_settings.libretro;
|
||||||
|
|
||||||
|
int init_ret = rarch_main_init_wrap(&args);
|
||||||
|
|
||||||
|
if (init_ret == 0)
|
||||||
|
RARCH_LOG("rarch_main_init succeeded.\n");
|
||||||
|
else
|
||||||
|
RARCH_ERR("rarch_main_init failed.\n");
|
||||||
}
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
{
|
|
||||||
while(rmenu_iterate());
|
while(rmenu_iterate());
|
||||||
|
|
||||||
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
|
||||||
rarch_startup();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
goto begin_shutdown;
|
goto begin_shutdown;
|
||||||
|
|
||||||
|
|
39
retroarch.c
39
retroarch.c
|
@ -2890,25 +2890,6 @@ void rarch_main_deinit(void)
|
||||||
g_extern.main_is_init = false;
|
g_extern.main_is_init = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_RARCH_MAIN_WRAP
|
|
||||||
static bool rarch_main_idle_iterate(void)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_COMMAND
|
|
||||||
if (driver.command)
|
|
||||||
rarch_cmd_pre_frame(driver.command);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (input_key_pressed_func(RARCH_QUIT_KEY) ||
|
|
||||||
!video_alive_func())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
do_state_checks();
|
|
||||||
|
|
||||||
input_poll();
|
|
||||||
rarch_sleep(10);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MAX_ARGS 32
|
#define MAX_ARGS 32
|
||||||
int rarch_main_init_wrap(const struct rarch_main_wrap *args)
|
int rarch_main_init_wrap(const struct rarch_main_wrap *args)
|
||||||
{
|
{
|
||||||
|
@ -2978,6 +2959,26 @@ int rarch_main_init_wrap(const struct rarch_main_wrap *args)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_RARCH_MAIN_WRAP
|
||||||
|
static bool rarch_main_idle_iterate(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_COMMAND
|
||||||
|
if (driver.command)
|
||||||
|
rarch_cmd_pre_frame(driver.command);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (input_key_pressed_func(RARCH_QUIT_KEY) ||
|
||||||
|
!video_alive_func())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
do_state_checks();
|
||||||
|
|
||||||
|
input_poll();
|
||||||
|
rarch_sleep(10);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int rarch_main(int argc, char *argv[])
|
int rarch_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int init_ret;
|
int init_ret;
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
#include "../../console/rarch_console_exec.h"
|
#include "../../console/rarch_console_exec.h"
|
||||||
#include "../../console/rarch_console_libretro_mgmt.h"
|
#include "../../console/rarch_console_libretro_mgmt.h"
|
||||||
#include "../../console/rarch_console_config.h"
|
#include "../../console/rarch_console_config.h"
|
||||||
#include "../../console/rarch_console_main_wrap.h"
|
|
||||||
#include "../../conf/config_file.h"
|
#include "../../conf/config_file.h"
|
||||||
#include "../../conf/config_file_macros.h"
|
#include "../../conf/config_file_macros.h"
|
||||||
#include "../../file.h"
|
#include "../../file.h"
|
||||||
|
@ -191,13 +190,29 @@ begin_loop:
|
||||||
|
|
||||||
while(rarch_main_iterate());
|
while(rarch_main_iterate());
|
||||||
}
|
}
|
||||||
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
else if (g_extern.console.rmenu.mode == MODE_INIT)
|
||||||
{
|
{
|
||||||
while(rmenu_iterate());
|
if(g_extern.main_is_init)
|
||||||
|
rarch_main_deinit();
|
||||||
|
|
||||||
if (g_extern.console.rmenu.mode != MODE_EXIT)
|
struct rarch_main_wrap args = {0};
|
||||||
rarch_startup();
|
|
||||||
|
args.verbose = g_extern.verbose;
|
||||||
|
args.config_path = g_extern.config_path;
|
||||||
|
args.sram_path = g_extern.console.main_wrap.state.default_sram_dir.enable ? g_extern.console.main_wrap.paths.default_sram_dir : NULL,
|
||||||
|
args.state_path = g_extern.console.main_wrap.state.default_savestate_dir.enable ? g_extern.console.main_wrap.paths.default_savestate_dir : NULL,
|
||||||
|
args.rom_path = g_extern.file_state.rom_path;
|
||||||
|
args.libretro_path = g_settings.libretro;
|
||||||
|
|
||||||
|
int init_ret = rarch_main_init_wrap(&args);
|
||||||
|
|
||||||
|
if (init_ret == 0)
|
||||||
|
RARCH_LOG("rarch_main_init succeeded.\n");
|
||||||
|
else
|
||||||
|
RARCH_ERR("rarch_main_init failed.\n");
|
||||||
}
|
}
|
||||||
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
||||||
|
while(rmenu_iterate());
|
||||||
else
|
else
|
||||||
goto begin_shutdown;
|
goto begin_shutdown;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue