From d77c551aadbc2ff6d09d7c7301982f2819939863 Mon Sep 17 00:00:00 2001 From: Toad King Date: Sat, 31 May 2014 16:26:43 -0400 Subject: [PATCH] [WII] fix loaders/history/core detect --- frontend/frontend.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/frontend/frontend.c b/frontend/frontend.c index 401e78cf80..f4b8b1c37d 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -286,6 +286,10 @@ 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(); @@ -332,6 +336,23 @@ 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);