(GX) Move Wii-specific hack done to argc/argv to environment_get

function (platform_gx.c)
This commit is contained in:
twinaphex 2014-06-01 04:42:32 +02:00
parent 31f7c4e3fa
commit 6fa7e1894e
2 changed files with 18 additions and 21 deletions

View File

@ -286,10 +286,6 @@ void main_exit(args_type() args)
driver.frontend_ctx->shutdown(false);
}
#ifdef HW_RVL
static char wii_new_argv1[PATH_MAX];
#endif
returntype main_entry(signature())
{
declare_argc();
@ -336,23 +332,6 @@ returntype main_entry(signature())
#endif
}
#ifdef HW_RVL
// needed on Wii; loaders follow a dumb standard where the path and filename are separate in the argument list
if (argc > 2 && argv[1] != NULL && argv[2] != NULL)
{
int i;
fill_pathname_join(wii_new_argv1, argv[1], argv[2], sizeof(wii_new_argv1));
argv[1] = wii_new_argv1;
// shift over remaining args
for (i = 3; i < argc; i++)
{
argv[i - 1] = argv[i];
}
argc--;
argv[argc] = NULL;
}
#endif
{
int init_ret;
if ((init_ret = rarch_main_init(argc, argv))) return_var(init_ret);

View File

@ -250,6 +250,24 @@ static void frontend_gx_get_environment_settings(int argc, char *argv[], void *a
fill_pathname_join(gx_rom_path, argv[1], argv[2], sizeof(gx_rom_path));
else
gx_rom_path[0] = '\0';
#else
#ifdef HW_RVL
// needed on Wii; loaders follow a dumb standard where the path and filename are separate in the argument list
if (argc > 2 && argv[1] != NULL && argv[2] != NULL)
{
int i;
char wii_new_argv1[PATH_MAX];
fill_pathname_join(wii_new_argv1, argv[1], argv[2], sizeof(wii_new_argv1));
argv[1] = strdup(wii_new_argv1);
// shift over remaining args
for (i = 3; i < argc; i++)
{
argv[i - 1] = argv[i];
}
argc--;
argv[argc] = NULL;
}
#endif
#endif
}