Add romfsInitFromFile()
This commit is contained in:
parent
43e1137148
commit
bf1f162549
@ -31,4 +31,5 @@ typedef struct
|
|||||||
} romfs_file;
|
} romfs_file;
|
||||||
|
|
||||||
Result romfsInit(void);
|
Result romfsInit(void);
|
||||||
|
Result romfsInitFromFile(Handle file, u32 offset);
|
||||||
Result romfsExit(void);
|
Result romfsExit(void);
|
||||||
|
@ -111,6 +111,8 @@ typedef struct
|
|||||||
u32 fsOffset;
|
u32 fsOffset;
|
||||||
} _3DSX_Header;
|
} _3DSX_Header;
|
||||||
|
|
||||||
|
static Result romfsInitCommon(void);
|
||||||
|
|
||||||
Result romfsInit(void)
|
Result romfsInit(void)
|
||||||
{
|
{
|
||||||
if (romFS_active) return 0;
|
if (romFS_active) return 0;
|
||||||
@ -159,6 +161,23 @@ Result romfsInit(void)
|
|||||||
if (rc) return rc;
|
if (rc) return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return romfsInitCommon();
|
||||||
|
|
||||||
|
_fail0:
|
||||||
|
FSFILE_Close(romFS_file);
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result romfsInitFromFile(Handle file, u32 offset)
|
||||||
|
{
|
||||||
|
if (romFS_active) return 0;
|
||||||
|
romFS_file = file;
|
||||||
|
romFS_offset = offset;
|
||||||
|
return romfsInitCommon();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result romfsInitCommon(void)
|
||||||
|
{
|
||||||
if (_romfs_read(0, &romFS_header, sizeof(romFS_header)) != sizeof(romFS_header))
|
if (_romfs_read(0, &romFS_header, sizeof(romFS_header)) != sizeof(romFS_header))
|
||||||
goto _fail0;
|
goto _fail0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user