(Android) Set up rarch_main_init_wrap so that it can load dynamic

libretro cores if supported
This commit is contained in:
Twinaphex 2012-09-13 06:28:22 +02:00
parent a4262fd0d6
commit 42f2d068a7
6 changed files with 20 additions and 7 deletions

View File

@ -106,6 +106,8 @@ typedef struct
char shader_file[MAXIMUM_PATH];
char shader_dir[MAXIMUM_PATH];
#endif
char libretro_path[MAXIMUM_PATH]; /* set this to NULL if libretro cores
cannot be loaded dynamically. */
char salamander_file[MAXIMUM_PATH];
char sram_dir[MAXIMUM_PATH];
char system_dir[MAXIMUM_PATH];

View File

@ -49,6 +49,12 @@ static int rarch_main_init_wrap(const struct rarch_main_wrap *args)
argv[argc++] = strdup(args->config_path);
}
if (args->libretro_path)
{
argv[argc++] = strdup("-L");
argv[argc++] = strdup(args->libretro_path);
}
if (args->verbose)
argv[argc++] = strdup("-v");
@ -71,7 +77,7 @@ static int rarch_main_init_wrap(const struct rarch_main_wrap *args)
return ret;
}
bool rarch_startup (const char * config_path)
bool rarch_startup (const char * config_path, const char * libretro_path)
{
bool retval = false;
@ -84,6 +90,7 @@ bool rarch_startup (const char * config_path)
args.verbose = g_extern.verbose;
args.config_path = config_path;
args.libretro_path = libretro_path;
args.sram_path = g_console.default_sram_dir_enable ? g_console.default_sram_dir : NULL,
args.state_path = g_console.default_savestate_dir_enable ? g_console.default_savestate_dir : NULL,
args.rom_path = g_console.rom_path;

View File

@ -23,9 +23,10 @@ struct rarch_main_wrap
const char *sram_path;
const char *state_path;
const char *config_path;
const char *libretro_path;
bool verbose;
};
bool rarch_startup (const char * config_path);
bool rarch_startup (const char *config_path, const char *libretro_path);
#endif

View File

@ -433,6 +433,7 @@ static void get_environment_settings(void)
snprintf(default_paths.input_presets_dir, sizeof(default_paths.input_presets_dir), "%s/input", default_paths.port_dir);
strlcpy(default_paths.executable_extension, ".dol", sizeof(default_paths.executable_extension));
strlcpy(default_paths.salamander_file, "boot.dol", sizeof(default_paths.salamander_file));
default_paths.libretro_path = NULL:
}
#define MAKE_FILE(x) {\
@ -558,7 +559,7 @@ int main(int argc, char *argv[])
rarch_render_cached_frame();
gx->menu_render = false;
rarch_startup(default_paths.config_file);
rarch_startup(default_paths.config_file, default_paths.libretro_path);
}
else
{
@ -587,7 +588,7 @@ begin_loop:
menu_loop();
if (g_console.mode_switch != MODE_EXIT)
rarch_startup(default_paths.config_file);
rarch_startup(default_paths.config_file, default_paths.libretro_path);
}
else
goto begin_shutdown;

View File

@ -225,6 +225,7 @@ static void get_environment_settings(int argc, char *argv[])
#endif
snprintf(default_paths.config_file, sizeof(default_paths.config_file), "%s/retroarch.cfg", default_paths.port_dir);
snprintf(default_paths.salamander_file, sizeof(default_paths.salamander_file), "EBOOT.BIN");
default_paths.libretro_path = NULL:
}
g_extern.verbose = false;
@ -330,7 +331,7 @@ int main(int argc, char *argv[])
RARCH_LOG("Started from multiMAN, will auto-start game.\n");
strlcpy(g_console.rom_path, argv[1], sizeof(g_console.rom_path));
rarch_settings_change(S_START_RARCH);
rarch_startup(default_paths.config_file);
rarch_startup(default_paths.config_file, default_paths.libretro_path);
break;
#endif
default:
@ -355,7 +356,7 @@ begin_loop:
menu_loop();
if (g_console.mode_switch != MODE_EXIT)
rarch_startup(default_paths.config_file);
rarch_startup(default_paths.config_file, default_paths.libretro_path);
}
else
goto begin_shutdown;

View File

@ -127,6 +127,7 @@ static void get_environment_settings (void)
strlcpy(default_paths.filebrowser_startup_dir, "game:", sizeof(default_paths.filebrowser_startup_dir));
snprintf(default_paths.salamander_file, sizeof(default_paths.salamander_file), "default.xex");
#endif
default_paths.libretro_path = NULL;
}
static void system_init(void)
@ -201,7 +202,7 @@ begin_loop:
menu_loop();
if (g_console.mode_switch != MODE_EXIT)
rarch_startup(default_paths.config_file);
rarch_startup(default_paths.config_file, default_paths.libretro_path);
}
else
goto begin_shutdown;