Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
stb-data-parse.h
Go to the documentation of this file.
1#ifndef STB_DATA_PARSE_H
2#define STB_DATA_PARSE_H
3
6
7using namespace JGadget::binary;
8
9namespace JStudio {
10namespace stb {
11namespace data {
12
13// Parses a THeader
15public:
16 TParse_THeader(const void* p) : TParseData_aligned<4>(p) {}
17
18 const THeader* get() const { return (THeader*)getRaw(); }
19 const void* getContent() const { return ((THeader*)getRaw())->content; }
20 const char* get_signature() const { return get()->signature; }
21 u16 get_byteOrder() const { return get()->byte_order; }
22 u16 get_version() const { return get()->version; }
23 u32 get_blockNumber() const { return get()->block_number; }
24 const THeader::Target& get_target() const { return get()->target; }
25};
26
28public:
29 TParse_TBlock(const void* content) : TParseData_aligned<4>(content) {}
30
31 const TBlock* get() const { return (TBlock*)getRaw(); }
32 const TBlock* getNext() const { return (TBlock*)((u8*)getRaw() + get_size()); }
33
34 u32 get_size() const { return get()->size; }
35 u32 get_type() const { return get()->type; }
36 const void* getContent() const { return ((char*)getRaw()) + 8;}
37};
38
40public:
41 struct TData {
42 /* 0x00 */ u8 type;
43 /* 0x04 */ u32 param;
44 /* 0x08 */ const void* content;
45 /* 0x0C */ const void* next;
46 };
47
48 TParse_TSequence(const void* content) : TParseData_aligned<4>(content) {}
49 /* 802899BC */ void getData(TData*) const;
50
51 const void* get() const { return getRaw(); }
52 u32 get_head() const { return *(u32*)get(); }
53};
54
56public:
57 struct TData {
58 /* 0x00 */ u32 type;
59 /* 0x04 */ u32 param;
60 /* 0x08 */ const void* content;
61 /* 0x0C */ const void* next;
62 };
63
64 TParse_TParagraph(const void* content) : TParseData_aligned<4>(content) {}
65 /* 80289A08 */ void getData(TData*) const;
66};
67
69 struct TData {
70 /* 0x00 */ u8 status;
71 /* 0x04 */ u32 dataSize;
72 /* 0x08 */ u32 _8;
73 /* 0x0C */ const void* fileCount;
74 /* 0x10 */ const void* _10;
75 };
76
77 TParse_TParagraph_data(const void* content) : TParseData_aligned<4>(content) {}
78 /* 80289A80 */ void getData(TData* pData) const;
79};
80
81// Parses a TObject ("demo object")
83public:
84 TParse_TBlock_object(const void* content) : TParse_TBlock(content) {}
85
86 const TBlock_object* get() const { return (TBlock_object*)getRaw(); }
87 const void* getContent() const {
88 return ((TBlock_object*)getRaw())->id + align_roundUp(get_IDSize(), 4);
89 }
90
91 u16 get_flag() const { return get()->flag; }
92 u16 get_IDSize() const { return get()->id_size; }
93 u32 get_type() const { return get()->type; }
94 const void* get_ID() const { return get()->id; }
95};
96
98public:
99 TParse_TParagraph_dataID(const void* pContent) : TParseData_aligned<4>(pContent) {}
100
101 const TParagraph* get() const { return (TParagraph*)getRaw(); }
102 u16 get_IDSize() const { return get()->id_size; }
103 const void* get_ID() const { return get()->id; }
104 const void* getContent() const {
105 return ((TParagraph*)getRaw())->id + align_roundUp(get_IDSize(), 4);
106 }
107};
108
109} // namespace data
110} // namespace stb
111} // namespace JStudio
112
113#endif /* STB_DATA_PARSE_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition stb-data-parse.h:82
u16 get_IDSize() const
Definition stb-data-parse.h:92
TParse_TBlock_object(const void *content)
Definition stb-data-parse.h:84
const void * getContent() const
Definition stb-data-parse.h:87
const TBlock_object * get() const
Definition stb-data-parse.h:86
u16 get_flag() const
Definition stb-data-parse.h:91
const void * get_ID() const
Definition stb-data-parse.h:94
u32 get_type() const
Definition stb-data-parse.h:93
Definition stb-data-parse.h:27
const TBlock * get() const
Definition stb-data-parse.h:31
const void * getContent() const
Definition stb-data-parse.h:36
TParse_TBlock(const void *content)
Definition stb-data-parse.h:29
u32 get_size() const
Definition stb-data-parse.h:34
u32 get_type() const
Definition stb-data-parse.h:35
const TBlock * getNext() const
Definition stb-data-parse.h:32
Definition stb-data-parse.h:14
u16 get_byteOrder() const
Definition stb-data-parse.h:21
const THeader * get() const
Definition stb-data-parse.h:18
TParse_THeader(const void *p)
Definition stb-data-parse.h:16
const THeader::Target & get_target() const
Definition stb-data-parse.h:24
const void * getContent() const
Definition stb-data-parse.h:19
u32 get_blockNumber() const
Definition stb-data-parse.h:23
u16 get_version() const
Definition stb-data-parse.h:22
const char * get_signature() const
Definition stb-data-parse.h:20
Definition stb-data-parse.h:97
TParse_TParagraph_dataID(const void *pContent)
Definition stb-data-parse.h:99
const void * get_ID() const
Definition stb-data-parse.h:103
u16 get_IDSize() const
Definition stb-data-parse.h:102
const TParagraph * get() const
Definition stb-data-parse.h:101
const void * getContent() const
Definition stb-data-parse.h:104
Definition stb-data-parse.h:55
TParse_TParagraph(const void *content)
Definition stb-data-parse.h:64
void getData(TData *) const
Definition stb-data-parse.cpp:34
Definition stb-data-parse.h:39
const void * get() const
Definition stb-data-parse.h:51
TParse_TSequence(const void *content)
Definition stb-data-parse.h:48
void getData(TData *) const
Definition stb-data-parse.cpp:13
u32 get_head() const
Definition stb-data-parse.h:52
static u16 data[4]
Definition d_vibration.cpp:114
p
Definition e_acos.c:98
Definition binary.h:7
u32 align_roundUp(u32 arg0, u32 uAlign)
Definition binary.h:16
Definition functionvalue.cpp:318
const void * getRaw() const
Definition binary.h:23
Definition stb-data.h:52
u8 id[0]
Definition stb-data.h:55
u16 id_size
Definition stb-data.h:54
u16 flag
Definition stb-data.h:53
Definition stb-data.h:47
u32 type
Definition stb-data.h:49
u32 size
Definition stb-data.h:48
Definition stb-data.h:32
Definition stb-data.h:31
u32 block_number
Definition stb-data.h:42
u16 byte_order
Definition stb-data.h:39
u16 version
Definition stb-data.h:40
char signature[4]
Definition stb-data.h:38
Target target
Definition stb-data.h:43
Definition stb-data.h:59
u8 id[0]
Definition stb-data.h:62
u16 id_size
Definition stb-data.h:61
Definition stb-data-parse.h:57
u32 type
Definition stb-data-parse.h:58
const void * content
Definition stb-data-parse.h:60
const void * next
Definition stb-data-parse.h:61
u32 param
Definition stb-data-parse.h:59
const void * fileCount
Definition stb-data-parse.h:73
u32 _8
Definition stb-data-parse.h:72
u32 dataSize
Definition stb-data-parse.h:71
u8 status
Definition stb-data-parse.h:70
const void * _10
Definition stb-data-parse.h:74
Definition stb-data-parse.h:68
TParse_TParagraph_data(const void *content)
Definition stb-data-parse.h:77
void getData(TData *pData) const
Definition stb-data-parse.cpp:50
Definition stb-data-parse.h:41
u8 type
Definition stb-data-parse.h:42
const void * content
Definition stb-data-parse.h:44
const void * next
Definition stb-data-parse.h:45
u32 param
Definition stb-data-parse.h:43
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8