Added ncm docs.

This commit is contained in:
yellows8 2019-09-23 17:00:16 -04:00
parent 66a4db694b
commit c93fab39c8
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43

View File

@ -9,59 +9,68 @@
#include "../services/fs.h" #include "../services/fs.h"
#include "../services/sm.h" #include "../services/sm.h"
/// ContentType
typedef enum { typedef enum {
NcmContentType_CNMT = 0, NcmContentType_CNMT = 0, ///< CNMT
NcmContentType_Program = 1, NcmContentType_Program = 1, ///< Program
NcmContentType_Data = 2, NcmContentType_Data = 2, ///< Data
NcmContentType_Icon = 3, NcmContentType_Icon = 3, ///< Icon
NcmContentType_Doc = 4, NcmContentType_Doc = 4, ///< Doc
NcmContentType_Info = 5, NcmContentType_Info = 5, ///< Info
} NcmContentType; } NcmContentType;
/// ContentMetaType
typedef enum { typedef enum {
NcmContentMetaType_SystemProgram = 0x01, NcmContentMetaType_SystemProgram = 0x01, ///< SystemProgram
NcmContentMetaType_SystemData = 0x02, NcmContentMetaType_SystemData = 0x02, ///< SystemData
NcmContentMetaType_SystemUpdate = 0x03, NcmContentMetaType_SystemUpdate = 0x03, ///< SystemUpdate
NcmContentMetaType_BootImagePackage = 0x04, NcmContentMetaType_BootImagePackage = 0x04, ///< BootImagePackage
NcmContentMetaType_BootImagePackageSafe = 0x05, NcmContentMetaType_BootImagePackageSafe = 0x05, ///< BootImagePackageSafe
NcmContentMetaType_Application = 0x80, NcmContentMetaType_Application = 0x80, ///< Application
NcmContentMetaType_Patch = 0x81, NcmContentMetaType_Patch = 0x81, ///< Patch
NcmContentMetaType_AddOnContent = 0x82, NcmContentMetaType_AddOnContent = 0x82, ///< AddOnContent
NcmContentMetaType_Delta = 0x83, NcmContentMetaType_Delta = 0x83, ///< Delta
} NcmContentMetaType; } NcmContentMetaType;
/// ContentMetaAttribute
typedef enum { typedef enum {
NcmContentMetaAttribute_Exfat = (1 << 0), NcmContentMetaAttribute_Exfat = (1 << 0), ///< Exfat
NcmContentMetaAttribute_Rebootless = (1 << 1), NcmContentMetaAttribute_Rebootless = (1 << 1), ///< Rebootless
} NcmContentMetaAttribute; } NcmContentMetaAttribute;
/// NcmContentStorage
typedef struct { typedef struct {
Service s; Service s; ///< IContentStorage
} NcmContentStorage; } NcmContentStorage;
/// NcmContentMetaDatabase
typedef struct { typedef struct {
Service s; Service s; ///< IContentMetaDatabase
} NcmContentMetaDatabase; } NcmContentMetaDatabase;
/// NcaId
typedef struct { typedef struct {
u8 c[0x10]; u8 c[0x10]; ///< Id
} NcmNcaId; } NcmNcaId;
/// MetaRecord
typedef struct { typedef struct {
u64 titleId; u64 titleId; ///< titleID.
u32 version; u32 version; ///< Title version.
u8 type; u8 type; ///< Type.
u8 flags; u8 flags; ///< Flags.
u8 padding[2]; u8 padding[2]; ///< Padding.
} NcmMetaRecord; } NcmMetaRecord;
/// ContentRecord
typedef struct { typedef struct {
NcmNcaId ncaId; NcmNcaId ncaId; ///< \ref NcmNcaId
u8 size[0x6]; u8 size[0x6]; ///< Content size.
u8 type; u8 type; ///< Type.
u8 padding; u8 padding; ///< Padding.
} NcmContentRecord; } NcmContentRecord;
/// ContentMetaRecordsHeader
typedef struct { typedef struct {
u16 numExtraBytes; ///< Size of optional struct that comes after this one. u16 numExtraBytes; ///< Size of optional struct that comes after this one.
u16 numContentRecords; ///< Number of NcmContentRecord entries after the extra bytes. u16 numContentRecords; ///< Number of NcmContentRecord entries after the extra bytes.
@ -69,9 +78,10 @@ typedef struct {
u16 padding; ///< Always zero. u16 padding; ///< Always zero.
} NcmContentMetaRecordsHeader; } NcmContentMetaRecordsHeader;
/// ApplicationContentMetaKey
typedef struct { typedef struct {
NcmMetaRecord metaRecord; NcmMetaRecord metaRecord; ///< \ref NcmMetaRecord
u64 baseTitleId; u64 baseTitleId; ///< Base titleID.
} NcmApplicationContentMetaKey; } NcmApplicationContentMetaKey;
Result ncmInitialize(void); Result ncmInitialize(void);