Add fallback RomFS path for when argv isn't available (e.g. boot.3dsx)
This commit is contained in:
parent
818254c55e
commit
b364790a9a
@ -114,14 +114,19 @@ typedef struct
|
|||||||
|
|
||||||
static Result romfsInitCommon(void);
|
static Result romfsInitCommon(void);
|
||||||
|
|
||||||
|
__attribute__((weak)) const char* __romfs_path = NULL;
|
||||||
|
|
||||||
Result romfsInit(void)
|
Result romfsInit(void)
|
||||||
{
|
{
|
||||||
if (romFS_active) return 0;
|
if (romFS_active) return 0;
|
||||||
if (envIsHomebrew())
|
if (envIsHomebrew())
|
||||||
{
|
{
|
||||||
// RomFS appended to a 3DSX file
|
// RomFS appended to a 3DSX file
|
||||||
if (__system_argc == 0 || !__system_argv[0]) return 1;
|
const char* filename = __romfs_path;
|
||||||
const char* filename = __system_argv[0];
|
if (__system_argc > 0 && __system_argv[0])
|
||||||
|
filename = __system_argv[0];
|
||||||
|
if (!filename) return 1;
|
||||||
|
|
||||||
if (strncmp(filename, "sdmc:/", 6) == 0)
|
if (strncmp(filename, "sdmc:/", 6) == 0)
|
||||||
filename += 5;
|
filename += 5;
|
||||||
else if (strncmp(filename, "3dslink:/", 9) == 0)
|
else if (strncmp(filename, "3dslink:/", 9) == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user