Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
data.h
Go to the documentation of this file.
1#ifndef JMESSAGE_DATA_H
2#define JMESSAGE_DATA_H
3
5
6namespace JMessage {
7
12struct data {
13 // TParse_THeader handles parsing the BMG file header data
15 TParse_THeader(const void* pData) : TParseData_aligned(pData) {}
16
17 const void* getContent() const { return (char*)getRaw() + 0x20; }
18 char* get() const { return (char*)getRaw(); }
19
20 u32* get_signature() const { return (u32*)(get() + 0x0); }
21 u32 get_type() const { return *(u32*)(get() + 0x4); }
22 u32 get_blockNumber() const { return *(u32*)(get() + 0xC); }
23 u32 get_encoding() const { return *(u8*)(get() + 0x10); }
24 };
25
26 // TParse_TBlock handles parsing the generic section header data
28 TParse_TBlock(const void* pData) : TParseData_aligned(pData) {}
29
30 const char* get() const { return (char*)getRaw(); }
31 u32 get_size() const { return *(u32*)(get() + 0x4); }
32 const void* getNext() const { return (char*)getRaw() + get_size(); }
33 u32 get_type() const { return *(u32*)(get() + 0x0); }
34 };
35
36 // TParse_TBlock_info handles parsing INF1 section data
38 TParse_TBlock_info(const void* pData) : TParse_TBlock(pData) {}
39
40 char* get() const { return (char*)getRaw(); }
41
42 char* getContent() const { return (char*)getRaw() + 0x10; }
43
44 u32 get_messageEntrySize() const { return *(u16*)(get() + 0xA); }
45
46 u32 get_messageEntryNumber() const { return *(u16*)(get() + 0x8); }
47
48 u16 get_groupID() const { return *(u16*)(get() + 0xC); }
49 };
50
51 // TParse_TBlock_messageID handles parsing MID1 section data
53 TParse_TBlock_messageID(const void* pData) : TParse_TBlock(pData) {}
54
55 char* get() const { return (char*)getRaw(); }
56 u8 get_formSupplement() const { return *(u8*)(get() + 0xB); }
57 int get_number() const { return *(u16*)(get() + 0x8); }
58 u32* getContent() const { return (u32*)((u32)getRaw() + 0x10); }
59 u32 get_form() const { return *(u8*)(get() + 0xA) & 0xF; }
60 bool get_isOrdered() const { return *(u8*)(get() + 0xA) & 0xF0; }
61 };
62
64 TParse_TBlock_color(const void* pData) : TParse_TBlock(pData) {}
65 };
66
67 // TParse_TBlock_messageText handles parsing DAT1 section data
69 TParse_TBlock_messageText(const void* pData) : TParse_TBlock(pData) {}
70
71 char* getContent() const { return (char*)getRaw() + 0x8; }
72 };
73
74 // TParse_TBlock_stringAttribute handles parsing STR1 section data
76 TParse_TBlock_stringAttribute(const void* pData) : TParse_TBlock(pData) {}
77
78 char* getContent() const { return (char*)getRaw() + 0x8; }
79 };
80
81 static unsigned int getTagCode(u32 tag) { return tag & 0xFFFF; }
82 static u8 getTagGroup(u32 tag) { return tag >> 0x10; }
83
84 static const u32 ga4cSignature;
86
87 static const int gcTagBegin = '\x1A'; // All text Control Tags will begin with this character
88
89 enum {
92
95
98 };
99};
100}; // namespace JMessage
101
102#endif /* JMESSAGE_DATA_H */
unsigned long u32
Definition types.h:12
unsigned short int u16
Definition types.h:10
unsigned char u8
Definition types.h:8
Definition control.h:6
const void * getRaw() const
Definition binary.h:30
TParse_TBlock_color(const void *pData)
Definition data.h:64
char * get() const
Definition data.h:40
u32 get_messageEntryNumber() const
Definition data.h:46
u32 get_messageEntrySize() const
Definition data.h:44
TParse_TBlock_info(const void *pData)
Definition data.h:38
u16 get_groupID() const
Definition data.h:48
char * getContent() const
Definition data.h:42
TParse_TBlock_messageID(const void *pData)
Definition data.h:53
bool get_isOrdered() const
Definition data.h:60
u8 get_formSupplement() const
Definition data.h:56
u32 * getContent() const
Definition data.h:58
char * get() const
Definition data.h:55
u32 get_form() const
Definition data.h:59
int get_number() const
Definition data.h:57
char * getContent() const
Definition data.h:71
TParse_TBlock_messageText(const void *pData)
Definition data.h:69
TParse_TBlock_stringAttribute(const void *pData)
Definition data.h:76
char * getContent() const
Definition data.h:78
Definition data.h:27
const char * get() const
Definition data.h:30
TParse_TBlock(const void *pData)
Definition data.h:28
u32 get_type() const
Definition data.h:33
const void * getNext() const
Definition data.h:32
u32 get_size() const
Definition data.h:31
Definition data.h:14
char * get() const
Definition data.h:18
const void * getContent() const
Definition data.h:17
u32 get_encoding() const
Definition data.h:23
TParse_THeader(const void *pData)
Definition data.h:15
u32 get_type() const
Definition data.h:21
u32 get_blockNumber() const
Definition data.h:22
u32 * get_signature() const
Definition data.h:20
Definition data.h:12
static const int gcTagBegin
Definition data.h:87
@ MESSAGEINDEX_RESERVED_ENUM_MIN
Definition data.h:93
@ MESSAGEGROUPID_USER_ENUM_MAX
Definition data.h:97
@ MESSAGEINDEX_USER_ENUM_MAX
Definition data.h:91
@ MESSAGEINDEX_USER_ENUM_MIN
Definition data.h:90
@ MESSAGEINDEX_RESERVED_ENUM_MAX
Definition data.h:94
@ MESSAGEGROUPID_USER_ENUM_MIN
Definition data.h:96
static const u32 ga4cSignature
Definition data.h:84
static const u32 ga4cSignature_color
Definition data.h:85
static unsigned int getTagCode(u32 tag)
Definition data.h:81
static u8 getTagGroup(u32 tag)
Definition data.h:82