mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-20 01:43:37 +00:00
Move rarch_main_init_wrap to retroarch.c
This commit is contained in:
parent
76c392718f
commit
1ddf138860
55
general.c
55
general.c
@ -39,61 +39,6 @@ void rarch_playlist_load_content(content_playlist_t *playlist,
|
||||
rarch_main_command(RARCH_CMD_LOAD_CORE);
|
||||
}
|
||||
|
||||
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
||||
int *argc, char **argv)
|
||||
{
|
||||
*argc = 0;
|
||||
argv[(*argc)++] = strdup("retroarch");
|
||||
|
||||
if (!args->no_content)
|
||||
{
|
||||
if (args->content_path)
|
||||
{
|
||||
RARCH_LOG("Using content: %s.\n", args->content_path);
|
||||
argv[(*argc)++] = strdup(args->content_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_LOG("No content, starting dummy core.\n");
|
||||
argv[(*argc)++] = strdup("--menu");
|
||||
}
|
||||
}
|
||||
|
||||
if (args->sram_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-s");
|
||||
argv[(*argc)++] = strdup(args->sram_path);
|
||||
}
|
||||
|
||||
if (args->state_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-S");
|
||||
argv[(*argc)++] = strdup(args->state_path);
|
||||
}
|
||||
|
||||
if (args->config_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-c");
|
||||
argv[(*argc)++] = strdup(args->config_path);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
if (args->libretro_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-L");
|
||||
argv[(*argc)++] = strdup(args->libretro_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (args->verbose)
|
||||
argv[(*argc)++] = strdup("-v");
|
||||
|
||||
#ifdef HAVE_FILE_LOGGER
|
||||
for (i = 0; i < *argc; i++)
|
||||
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* When selection is presented back, returns 0.
|
||||
* If it can make a decision right now, returns -1. */
|
||||
|
||||
|
@ -841,11 +841,6 @@ int rarch_main(int argc, char *argv[]);
|
||||
|
||||
bool rarch_replace_config(const char *path);
|
||||
|
||||
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
||||
int *argc, char **argv);
|
||||
|
||||
int rarch_main_init(int argc, char *argv[]);
|
||||
|
||||
void rarch_playlist_load_content(content_playlist_t *playlist,
|
||||
unsigned index);
|
||||
|
||||
|
55
retroarch.c
55
retroarch.c
@ -1996,6 +1996,61 @@ error:
|
||||
return 1;
|
||||
}
|
||||
|
||||
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
||||
int *argc, char **argv)
|
||||
{
|
||||
*argc = 0;
|
||||
argv[(*argc)++] = strdup("retroarch");
|
||||
|
||||
if (!args->no_content)
|
||||
{
|
||||
if (args->content_path)
|
||||
{
|
||||
RARCH_LOG("Using content: %s.\n", args->content_path);
|
||||
argv[(*argc)++] = strdup(args->content_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_LOG("No content, starting dummy core.\n");
|
||||
argv[(*argc)++] = strdup("--menu");
|
||||
}
|
||||
}
|
||||
|
||||
if (args->sram_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-s");
|
||||
argv[(*argc)++] = strdup(args->sram_path);
|
||||
}
|
||||
|
||||
if (args->state_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-S");
|
||||
argv[(*argc)++] = strdup(args->state_path);
|
||||
}
|
||||
|
||||
if (args->config_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-c");
|
||||
argv[(*argc)++] = strdup(args->config_path);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
if (args->libretro_path)
|
||||
{
|
||||
argv[(*argc)++] = strdup("-L");
|
||||
argv[(*argc)++] = strdup(args->libretro_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (args->verbose)
|
||||
argv[(*argc)++] = strdup("-v");
|
||||
|
||||
#ifdef HAVE_FILE_LOGGER
|
||||
for (i = 0; i < *argc; i++)
|
||||
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
void rarch_main_set_state(unsigned cmd)
|
||||
{
|
||||
switch (cmd)
|
||||
|
@ -29,6 +29,11 @@ void rarch_main_set_state(unsigned action);
|
||||
|
||||
bool rarch_main_command(unsigned action);
|
||||
|
||||
int rarch_main_init(int argc, char *argv[]);
|
||||
|
||||
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
||||
int *argc, char **argv);
|
||||
|
||||
void rarch_main_deinit(void);
|
||||
|
||||
void rarch_render_cached_frame(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user