Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
stb.h
Go to the documentation of this file.
1#ifndef STB_H
2#define STB_H
3
7#include "dolphin/os.h"
8
9namespace JStudio {
10struct TObject;
11namespace stb {
12
13class TControl;
14
15class TParse : public TParse_header_block {
16public:
17 /* 80289640 */ TParse(TControl*);
18 /* 80289660 */ virtual ~TParse();
19 /* 802896C0 */ virtual bool parseHeader_next(void const**, u32*, u32);
20 /* 8028978C */ virtual bool parseBlock_next(void const**, u32*, u32);
21 /* 802897E0 */ virtual bool parseHeader(data::TParse_THeader const&, u32);
22 /* 802897E8 */ virtual bool parseBlock_block(data::TParse_TBlock const&, u32);
23 /* 80289820 */ virtual bool parseBlock_object(data::TParse_TBlock_object const&, u32);
24
25 TControl* getControl() const { return pControl; }
26
27private:
29};
30
32public:
33 enum TEStatus {
34 /* 0x0 */ STATUS_STILL = 0,
35 /* 0x1 */ STATUS_END = 1 << 0,
36 /* 0x2 */ STATUS_WAIT = 1 << 1,
37 /* 0x4 */ STATUS_SUSPEND = 1 << 2,
38 /* 0x8 */ STATUS_INACTIVE = 1 << 3,
39 };
40
41 /* 80288AC0 */ TObject(data::TParse_TBlock_object const&);
42 /* 80288A78 */ explicit TObject(u32, void const*, u32);
43 /* 80288B30 */ virtual ~TObject();
44
45 /* 80288B78 */ void setFlag_operation(u8, int);
46 /* 80288BD0 */ void reset(void const*);
47 /* 80288BE8 */ u8 forward(u32);
48 /* 80288E18 */ virtual void do_begin();
49 /* 80288E1C */ virtual void do_end();
50 /* 80288E20 */ virtual void do_paragraph(u32, void const*, u32);
51 /* 80288E24 */ virtual void do_wait(u32);
52 /* 80288E28 */ virtual void do_data(void const*, u32, void const*, u32);
53 /* 80288E2C */ void process_sequence_();
54 /* 80288F80 */ void process_paragraph_reserved_(u32, void const*, u32);
55
56 const char* toString_status(int status);
57
58 void on_begin() { do_begin(); }
59 void on_end() { do_end(); }
60 void on_paragraph(u32 arg1, const void* arg2, u32 arg3) { do_paragraph(arg1, arg2, arg3); }
61 void on_wait(u32 arg1) { do_wait(arg1); }
62 void on_data(const void* arg1, u32 arg2, const void* arg3, u32 arg4) {
63 do_data(arg1, arg2, arg3, arg4);
64 }
65
66 TControl* getControl() const { return pControl; }
67 void setControl_(TControl* control) { pControl = control; }
68 int getSuspend() const { return _20; }
69 void setSuspend(s32 val) { _20 = val; }
70 bool isSuspended() const { return getSuspend() > 0; }
71 void suspend(s32 val) { _20 += val; }
72 const void* getSequence() const { return pSequence; }
73 void setSequence_(const void* arg1) { pSequence = arg1; }
74 const void* getSequence_offset(s32 i_no) const {
75 int s32Val = (s32)getSequence();
76 return (const void*)(s32Val + i_no);
77 }
78 const void* getSequence_next() const { return pSequence_next; }
79 void setSequence_next(const void* seq) { pSequence_next = seq; }
80 u32 getWait() const { return u32Wait_; }
82 TEStatus getStatus() const { return mStatus; }
85 if (val & 0x800000) {
87 }
88 return val;
89 }
94
96
97private:
98 /* 0x14 */ TControl* pControl;
99 /* 0x18 */ u32 signature;
100 /* 0x1C */ u16 mFlag;
101 /* 0x1E */ u8 bSequence_;
102 /* 0x20 */ u32 _20; // "second per frame"?
103 /* 0x24 */ const void* pSequence;
104 /* 0x28 */ const void* pSequence_next;
105 /* 0x2C */ u32 u32Wait_;
106 /* 0x30 */ TEStatus mStatus;
107};
108
109class TFactory {
110public:
112
113 /* 802895B4 */ virtual ~TFactory();
114 /* 802895FC */ virtual JStudio::TObject* create(data::TParse_TBlock_object const&);
115 /* 80289604 */ virtual void destroy(TObject*);
116};
117
118class TObject_control : public TObject {
119public:
120 /* 80289068 */ TObject_control(void const*, u32);
121 /* 80289134 */ ~TObject_control() {}
122};
123
124// Manages TObjects
125class TControl {
126public:
127 /* 802890B4 */ TControl();
128 /* 80289194 */ virtual ~TControl();
129
130 /* 80289228 */ void appendObject(TObject*);
131 /* 80289278 */ void removeObject(TObject*);
132 /* 802892B0 */ void destroyObject(TObject*);
133 /* 80289300 */ void destroyObject_all();
134 /* 80289364 */ TObject* getObject(void const*, u32);
135 /* 80289404 */ void reset();
136 /* 802894B4 */ u8 forward(u32);
137
140 bool isSuspended() const { return _54 > 0; }
141 TFactory* getFactory() const { return pFactory; }
144 int getSuspend() const { return _54; }
148
149private:
150 /* 0x04 */ u32 _4;
151 /* 0x08 */ u32 _8;
152 /* 0x0C */ TFactory* pFactory;
154 /* 0x1C */ u32 mStatus;
156 /* 0x54 */ s32 _54;
157};
158
159template <int T>
161 TParseData(const void* pContent) {
162 data::TParse_TParagraph_data data(pContent);
163 set(data);
164 }
165
167 set(NULL);
168 }
169
171 data.getData(this);
172 }
173
174 bool isEnd() const {
175 return status == 0;
176 }
177
178 bool empty() const {
179 return fileCount == NULL;
180 }
181
182 bool isValid() const {
183 return !empty() && status == 50;
184 }
185
186 const void* getContent() const { return fileCount; }
187
188 u32 size() const { return dataSize; }
189};
190
191template <int T, class Iterator=JGadget::binary::TValueIterator_raw<u8> >
192struct TParseData_fixed : public TParseData<T> {
193 TParseData_fixed(const void* pContent) : TParseData<T>(pContent) {}
195
196 const void* getNext() const {
197 return _10;
198 }
199
200 bool isValid() const {
201 return TParseData::isValid() && getNext() != NULL;
202 }
203
205 return Iterator(fileCount);
206 }
207
210 i += size();
211 return i;
212 }
213};
214
215struct TParseData_string : public TParseData<0x60> {
216 TParseData_string(const void* pContent) : TParseData<0x60>(pContent) {}
218
219 const char* getData() const { return (const char*)getContent(); }
220};
221
222} // namespace stb
223} // namespace JStudio
224
225#endif /* STB_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition jstudio-object.h:104
Definition stb.h:125
void reset()
Definition stb.cpp:380
void appendObject(TObject *)
Definition stb.cpp:335
virtual ~TControl()
Definition stb.cpp:328
void destroyObject_all()
Definition stb.cpp:355
TObject_control & referObject_control()
Definition stb.h:143
TObject_control mObject_control
Definition stb.h:155
u32 _8
Definition stb.h:151
void resetStatus_()
Definition stb.h:139
u32 mStatus
Definition stb.h:154
int getSuspend() const
Definition stb.h:144
void destroyObject(TObject *)
Definition stb.cpp:347
bool isSuspended() const
Definition stb.h:140
void setFactory(TFactory *factory)
Definition stb.h:142
s32 _54
Definition stb.h:156
u8 forward(u32)
Definition stb.cpp:393
TFactory * pFactory
Definition stb.h:152
TFactory * getFactory() const
Definition stb.h:141
void suspend(s32 param_0)
Definition stb.h:146
JGadget::TLinkList< TObject, -12 > mObjectContainer
Definition stb.h:153
u32 _4
Definition stb.h:150
TObject * getObject(void const *, u32)
Definition stb.cpp:364
TControl()
Definition stb.cpp:321
void setSuspend(s32 suspend)
Definition stb.h:145
void unsuspend(s32 param_0)
Definition stb.h:147
void setStatus_(u32 status)
Definition stb.h:138
void removeObject(TObject *)
Definition stb.cpp:340
Definition stb.h:109
virtual ~TFactory()
Definition stb.cpp:420
virtual JStudio::TObject * create(data::TParse_TBlock_object const &)
Definition stb.cpp:422
TFactory()
Definition stb.h:111
virtual void destroy(TObject *)
Definition stb.cpp:426
Definition stb.h:118
~TObject_control()
Definition stb.h:121
Definition stb.h:31
void setSuspend(s32 val)
Definition stb.h:69
virtual ~TObject()
Definition stb.cpp:86
void on_paragraph(u32 arg1, const void *arg2, u32 arg3)
Definition stb.h:60
JGadget::TLinkListNode ocObject_
Definition stb.h:95
void setFlag_operation_(u32 u32Data)
Definition stb.h:90
u8 bSequence_
Definition stb.h:101
void suspend(s32 val)
Definition stb.h:71
const void * getSequence_next() const
Definition stb.h:78
virtual void do_begin()
Definition stb.cpp:203
virtual void do_wait(u32)
Definition stb.cpp:215
const void * getSequence() const
Definition stb.h:72
void on_wait(u32 arg1)
Definition stb.h:61
void reset(void const *)
Definition stb.cpp:108
void process_paragraph_reserved_(u32, void const *, u32)
Definition stb.cpp:286
void setFlag_operation(u8, int)
Definition stb.cpp:90
int getSuspend() const
Definition stb.h:68
u32 getWait() const
Definition stb.h:80
u32 signature
Definition stb.h:99
TControl * getControl() const
Definition stb.h:66
TEStatus mStatus
Definition stb.h:106
u8 forward(u32)
Definition stb.cpp:115
u32 toInt32FromUInt24_(u32 val)
Definition stb.h:84
void setSequence_next(const void *seq)
Definition stb.h:79
u16 mFlag
Definition stb.h:100
void setStatus_(TEStatus status)
Definition stb.h:83
void setWait(u32 wait)
Definition stb.h:81
const void * getSequence_offset(s32 i_no) const
Definition stb.h:74
const void * pSequence_next
Definition stb.h:104
virtual void do_data(void const *, u32, void const *, u32)
Definition stb.cpp:219
u32 _20
Definition stb.h:102
void on_begin()
Definition stb.h:58
const char * toString_status(int status)
Definition stb.cpp:51
void process_sequence_()
Definition stb.cpp:223
virtual void do_end()
Definition stb.cpp:207
void on_end()
Definition stb.h:59
virtual void do_paragraph(u32, void const *, u32)
Definition stb.cpp:211
TControl * pControl
Definition stb.h:98
u32 u32Wait_
Definition stb.h:105
void on_data(const void *arg1, u32 arg2, const void *arg3, u32 arg4)
Definition stb.h:62
void setSequence_(const void *arg1)
Definition stb.h:73
const void * pSequence
Definition stb.h:103
TEStatus getStatus() const
Definition stb.h:82
bool isSuspended() const
Definition stb.h:70
void setControl_(TControl *control)
Definition stb.h:67
TEStatus
Definition stb.h:33
@ STATUS_INACTIVE
Definition stb.h:38
@ STATUS_END
Definition stb.h:35
@ STATUS_SUSPEND
Definition stb.h:37
@ STATUS_STILL
Definition stb.h:34
@ STATUS_WAIT
Definition stb.h:36
Definition stb.h:15
virtual bool parseBlock_next(void const **, u32 *, u32)
Definition stb.cpp:469
virtual bool parseHeader(data::TParse_THeader const &, u32)
Definition stb.cpp:482
virtual bool parseHeader_next(void const **, u32 *, u32)
Definition stb.cpp:434
virtual ~TParse()
Definition stb.cpp:432
virtual bool parseBlock_object(data::TParse_TBlock_object const &, u32)
Definition stb.cpp:490
TControl * pControl
Definition stb.h:28
virtual bool parseBlock_block(data::TParse_TBlock const &, u32)
Definition stb.cpp:486
TControl * getControl() const
Definition stb.h:25
Definition stb-data-parse.h:82
Definition stb-data-parse.h:27
Definition stb-data-parse.h:14
static void wait(b_gos_class *i_this)
Definition d_a_b_gos.cpp:59
int i
Definition e_pow.c:165
static s32 status
Definition fstload.c:6
static const double T[]
Definition k_tan.c:106
const u32 gu32Mask_TSequence_value_signExpansion
Definition stb-data.h:23
const int guBit_TSequence_type
Definition stb-data.h:10
Definition functionvalue.cpp:318
Definition linklist.h:7
Definition object-id.h:27
Definition stb.h:192
const void * getNext() const
Definition stb.h:196
Iterator end()
Definition stb.h:208
Iterator begin()
Definition stb.h:204
bool isValid() const
Definition stb.h:200
TParseData_fixed(const void *pContent)
Definition stb.h:193
TParseData_fixed()
Definition stb.h:194
TParseData_string()
Definition stb.h:217
const char * getData() const
Definition stb.h:219
TParseData_string(const void *pContent)
Definition stb.h:216
Definition stb.h:160
void set(const data::TParse_TParagraph_data &data)
Definition stb.h:170
u32 size() const
Definition stb.h:188
bool isValid() const
Definition stb.h:182
bool empty() const
Definition stb.h:178
TParseData(const void *pContent)
Definition stb.h:161
bool isEnd() const
Definition stb.h:174
const void * getContent() const
Definition stb.h:186
TParseData()
Definition stb.h:166
const void * fileCount
Definition stb-data-parse.h:73
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
void getData(TData *pData) const
Definition stb-data-parse.cpp:50
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8