Added Nro prefix to Asset in nro.h + updated romfs_dev for this.

This commit is contained in:
yellows8 2018-02-24 15:39:30 -05:00
parent 4c1b09d6b9
commit e24c20f9e7
2 changed files with 10 additions and 10 deletions

View File

@ -8,8 +8,8 @@
#define NROHEADER_MAGICNUM 0x304f524e
#define ASSETHEADER_MAGICNUM 0x54455341
#define ASSETHEADER_VERSION 0
#define NROASSETHEADER_MAGICNUM 0x54455341
#define NROASSETHEADER_VERSION 0
/// Entry for each segment in the codebin.
typedef struct {
@ -41,14 +41,14 @@ typedef struct {
typedef struct {
u64 offset;
u64 size;
} AssetSection;
} NroAssetSection;
/// Custom asset header.
typedef struct {
u32 magic;
u32 version;
AssetSection icon;
AssetSection nacp;
AssetSection romfs;
} AssetHeader;
NroAssetSection icon;
NroAssetSection nacp;
NroAssetSection romfs;
} NroAssetHeader;

View File

@ -213,14 +213,14 @@ Result romfsMount(struct romfs_mount **p)
romfsInitMtime(mount);
NroHeader hdr;
AssetHeader asset_header;
NroAssetHeader asset_header;
if (!_romfs_read_chk(mount, sizeof(NroStart), &hdr, sizeof(hdr))) goto _fail0;
if (hdr.Magic != NROHEADER_MAGICNUM) goto _fail0;
if (!_romfs_read_chk(mount, hdr.size, &asset_header, sizeof(asset_header))) goto _fail0;
if (asset_header.magic != ASSETHEADER_MAGICNUM
|| asset_header.version > ASSETHEADER_VERSION
if (asset_header.magic != NROASSETHEADER_MAGICNUM
|| asset_header.version > NROASSETHEADER_VERSION
|| asset_header.romfs.offset == 0
|| asset_header.romfs.size == 0)
goto _fail0;