SSBM Decomp
Loading...
Searching...
No Matches
psstructs.h
Go to the documentation of this file.
1#ifndef SYSDOLPHIN_BASELIB_PSSTRUCTS_H
2#define SYSDOLPHIN_BASELIB_PSSTRUCTS_H
3
4#include <platform.h>
5
6#include "baselib/archive.h"
7
8#include "baselib/forward.h"
9
10#include "baselib/jobj.h"
11
12#include <dolphin/gx.h>
13#include <dolphin/gx/GXEnum.h>
14#include <dolphin/mtx.h>
15
16struct HSD_Fog;
17
19 Tornado = 1 << 2,
20 TexEdge = 1 << 3,
21 ComTLUT = 1 << 4,
22 MirrorS = 1 << 5,
23 MirrorT = 1 << 6,
24 PrimEnv = 1 << 7,
25 TexInterpNear = 1 << 9,
26 DispTexture = 1 << 10,
27 TexFlipS = 1 << 18,
28 TexFlipT = 1 << 19,
29 Trail = 1 << 20,
30 DirVec = 1 << 21,
31 DispFog = 1 << 24,
32 NoZComp = 1 << 28,
33 DispPoint = 1 << 30,
34 DispLighting = 1 << 31
35};
36
37/* size: 0x1C */
38typedef struct _HSD_PSTexGroup {
39 u32 num; /* 0x0 */
40
41 u32 fmt; /* 0x4 */
42 u32 tlutfmt; /* 0x8 */
43
44 u32 width; /* 0xC */
45 u32 height; /* 0x10 */
46
47 u16 palnum; /* 0x14 */
48 u16 palflag; /* 0x16 */
49
50 u8* texTable[1]; /* 0x18 */
52
53/* size: 0x8 */
54typedef struct _HSD_PSFormGroup {
55 u32 num; /* 0x0 */
56 u8* formTable[1]; /* 0x4 */
58
59/* size: 0x40 */
60typedef struct _HSD_PSCmdList {
61 u16 type; /* 0x0 */
62 u16 texGroup; /* 0x2 */
63
64 u16 genLife; /* 0x4 */
65 u16 life; /* 0x6 */
66
67 u32 kind; /* 0x8 */
68
69 float grav; /* 0xC */
70 float fric; /* 0x10 */
71
72 float vx; /* 0x14 */
73 float vy; /* 0x18 */
74 float vz; /* 0x1C */
75
76 float radius; /* 0x20 */
77 float angle; /* 0x24 */
78 float random; /* 0x28 */
79 float size; /* 0x2C */
80
81 float param1; /* 0x30 */
82 float param2; /* 0x34 */
83 float param3; /* 0x38 */
84
85 u8 cmdList[1]; /* 0x3C */
87
89 struct HSD_psAppSRT* next; /* 0x0 */
90
91 struct HSD_Generator* gp; /* 0x4 */
92
93 Vec3 translate; /* 0x8 */
94 Quaternion rot; /* 0x14 */
95 Vec3 scale; /* 0x24 */
96
97 u8 status; /* 0x30 */
98
99 u8 frameNum; /* 0x31 */
100 u16 usedCount; /* 0x32 */
101
102 Mtx mmtx; /* 0x34 */
103 float ssx; /* 0x64 */
104 float ssy; /* 0x68 */
105
106 void (*freefunc)(struct HSD_psAppSRT* appSrt); /* 0x6C */
107
108 u16 idnum; /* 0x70 */
109 u8 billboard; /* 0x72 */
110 u8 dummy; /* 0x73 */
111 u8 x31_fill[0xA2 - 0x74]; /* 0x74 */
112 s8 xA2; /* 0xA2 */ // This and preceding fill only added to match
113 // grLib_801C96F8
114};
115
116/* size: 0x98 */
118 HSD_Particle* next; /* 0x0 */
119
120 u32 kind; /* 0x4 */
121
122 u8 bank; /* 0x8 */
123 u8 texGroup; /* 0x9 */
124
125 u8 poseNum; /* 0xA */
126 u8 palNum; /* 0xB */
127
129
130 u16 primColCount; /* 0xE */
131 u16 envColCount; /* 0x10 */
132 GXColor primCol; /* 0x12 */
133 GXColor envCol; /* 0x16 */
134
136
138
139 u8 linkNo; /* 0x1D */
140
141 u16 idnum;
142
147
148 u16 life;
149
150 Vec3 vel; /* 0x2C */
151
152 float grav; /* 0x38 */
153 float fric; /* 0x3C */
154
155 Vec3 pos; /* 0x40 */
156
157 float size; /* 0x4C */
158 float rotate; /* 0x50 */
159
160 u16 aCmpCount; /* 0x54 */
161 u8 aCmpMode; /* 0x56 */
162 u8 aCmpParam1; /* 0x57 */
163 u8 aCmpParam2; /* 0x58 */
164
165 u8 pJObjOfs; /* 0x59 */
166
167 u16 matColCount; /* 0x5A */
168 u16 ambColCount; /* 0x5C */
170
173
174 u16 primColRemain; /* 0x68 */
175 u16 envColRemain; /* 0x6A */
176 GXColor primColTarget; /* 0x6C */
177 GXColor envColTarget; /* 0x70 */
178
179 u16 matColRemain; /* 0x74 */
180 u16 ambColRemain; /* 0x76 */
181
182 u16 aCmpRemain; /* 0x78 */
183 u8 aCmpParam1Target; /* 0x7A */
184 u8 aCmpParam2Target; /* 0x7B */
185
186 u8 matRGB; /* 0x7C */
187 u8 matA; /* 0x7D */
188
189 u8 ambRGB; /* 0x7E */
190 u8 ambA; /* 0x7F */
191
192 u8 matRGBTarget; /* 0x80 */
193 u8 matATarget; /* 0x81 */
194 u8 ambRGBTarget; /* 0x82 */
195 u8 ambATarget; /* 0x83 */
196
197 float trail; /* 0x84 */
198
199 struct HSD_Generator* gen; /* 0x88 */
200 struct HSD_psAppSRT* appsrt; /* 0x8C */
201 float* userdata; /* 0x90 */
202 int (*callback)(HSD_Particle* part); /* 0x94 */
203};
204
205/* size: 0xC */
206typedef struct _PSUserFunc {
207 int (*hookCreate)(HSD_Particle* part); /* 0x0 */
208 int (*hookDelete)(HSD_Particle* part); /* 0x4 */
209 int (*setUserData)(HSD_Particle* part, u8 unknown1,
210 float unknown2); /* 0x8 */
212
213typedef struct _auxDisc {
216} auxDisc;
217
218typedef struct _auxLine {
219 f32 x2;
220 f32 y2;
221 f32 z2;
222} auxLine;
223
224typedef struct _auxTornado {
225 f32 vel;
226} auxTornado;
227
228typedef struct _auxRect {
229 f32 x;
230 f32 y;
231 f32 z;
232 f32 xx;
233 f32 xy;
234 f32 xz;
235 f32 yx;
236 f32 yy;
237 f32 yz;
238 f32 zx;
239 f32 zy;
240 f32 zz;
241 u16 flag;
242} auxRect;
243
244typedef struct _auxCone {
248} auxCone;
249
250typedef struct _auxSphere {
251 f32 speed;
256} auxSphere;
257
260 u32 kind; // 0x4
261 f32 random; // 0x8
262 f32 count; // 0xC
263 HSD_JObj* jobj; // 0x10
264 u16 genLife; // 0x14
265 u16 type; // 0x16
266 u8 bank; // 0x18
267 u8 linkNo; // 0x19
268 u8 texGroup; // x1A
269 u8 dummy; // 0x1B
270 u16 idnum; // 0x1C
271 u16 life; // 0x1E
272 u8* cmdList; // 0x20
273 Vec3 pos; // 0x24
274 Vec3 vel; // 0x30
275 f32 grav; // 0x3C
276 f32 fric; // 0x40
277 f32 size; // 0x44
278 f32 radius; // 0x48
279 f32 angle; // 0x4C
280 u32 numChild; // 0x50
283 int (*callback)(HSD_Generator* part); // 0x5C
284 union {
291 } aux; // 0x60
292};
293
294extern u32* ptclref[64];
295
296extern int psNumTexGroup[64];
298
300
301extern int psNumCmdList[64];
302extern HSD_PSCmdList** psCmdListArray[64];
303
304extern u16 numActiveParticles;
305extern u16 numPeakParticles;
306
307extern int (**psCallback)(HSD_Particle* part);
308
309#define PS_TEXDIRECTION
310#ifdef PS_TEXDIRECTION
311extern int texc[4][4];
312extern int td;
313#endif
314
315#ifndef _NFUNCPROTO
316void psSetFog(struct HSD_Fog* fog);
317
318void psRemoveFog(void);
319#endif
320
321static inline void setBlendMode(int blendmode);
322
323static inline void setupChanCtrl(HSD_Particle* pp);
324static inline void setupChanReg(HSD_Particle* pp);
325static inline void getClrTrail(HSD_Particle* pp, GXColor* col);
326static inline void setupTevReg(HSD_Particle* pp);
327static inline void psSetCurrentMtx(GXPosNrmMtx idx);
330static inline void psDispSubMakePolygon(HSD_Particle* pp, u8* texform, float x,
331 float y, float z, float ppvx,
332 float ppvy, float ppvz, float x0,
333 float y0, float z0, float x1, float y1,
334 float z1);
335
336static inline void psDispSub(HSD_Particle* pp, u8* texform);
337
338void psInitDataBank(int bank, int* cmdBank, int* texBank, u32* ref,
339 int* formBank);
340
341void psInitParticle(int num);
342
344
346 u32 kind, u16 texGroup, u8* list, int life,
347 float x, float y, float z, float vx,
348 float vy, float vz, float size, float grav,
349 float fric, int palflag, HSD_Generator* gp,
350 int flgInterpret);
351
353 int id, int flgInterpret);
354
355HSD_Particle* psGenerateParticle(int linkNo, int bank, u32 kind, u16 texGroup,
356 u8* list, int life, float x, float y, float z,
357 float vx, float vy, float vz, float size,
358 float grav, float fric, int palflag,
359 HSD_Generator* gp);
360
361HSD_Particle* psGenerateParticleIDPV(int linkNo, int bank, int id, float px,
362 float py, float pz, float vx, float vy,
363 float vz);
364
365HSD_Particle* psGenerateParticleID(int linkNo, int bank, int id);
366HSD_Particle* psGenerateParticleIDN(int linkNo, int bank, int id);
367
370
371void psSetPointJObj(int no, HSD_JObj* jobj);
372void psSetPointJObjNodup(HSD_JObj* jobj, int no);
373
375
377
378void psKillFamily(u16 idnum, int linkNo);
380
381void psAddOffsetAll(float xofs, float yofs, float zofs);
382
383void psPauseFamily(u16 idnum, int linkNo);
384void psRestartFamily(u16 idnum, int linkNo);
385
387
389
390static inline void psRemoveBillboardCamera(void);
391
392#endif
u8 x0
Definition dbbonus.c:19
UnkFlagStruct x1
Definition dbbonus.c:20
static void callback(HSD_GObj *gobj)
Definition ftDk_SpecialLw.c:89
void psRemoveParticle(void)
void psRestartFamily(u16 idnum, int linkNo)
HSD_Particle * psGenerateParticleIDN(int linkNo, int bank, int id)
void psSetUserFunc(HSD_Generator *gp, HSD_PSUserFunc *userfunc)
int psNumTexGroup[64]
static void psDispSubMakePolygon(HSD_Particle *pp, u8 *texform, float x, float y, float z, float ppvx, float ppvy, float ppvz, float x0, float y0, float z0, float x1, float y1, float z1)
HSD_Particle * psGenerateParticle0(HSD_Particle *p, int linkNo, int bank, u32 kind, u16 texGroup, u8 *list, int life, float x, float y, float z, float vx, float vy, float vz, float size, float grav, float fric, int palflag, HSD_Generator *gp, int flgInterpret)
HSD_ParticleKind
Definition psstructs.h:18
@ TexEdge
Definition psstructs.h:20
@ DispLighting
Definition psstructs.h:34
@ DispFog
Definition psstructs.h:31
@ Tornado
Definition psstructs.h:19
@ DirVec
Definition psstructs.h:30
@ TexInterpNear
Definition psstructs.h:25
@ Trail
Definition psstructs.h:29
@ MirrorS
Definition psstructs.h:22
@ DispTexture
Definition psstructs.h:26
@ MirrorT
Definition psstructs.h:23
@ DispPoint
Definition psstructs.h:33
@ PrimEnv
Definition psstructs.h:24
@ TexFlipT
Definition psstructs.h:28
@ ComTLUT
Definition psstructs.h:21
@ NoZComp
Definition psstructs.h:32
@ TexFlipS
Definition psstructs.h:27
void psSetFog(struct HSD_Fog *fog)
void psInitDataBank(int bank, int *cmdBank, int *texBank, u32 *ref, int *formBank)
void psSetCallback(int(**callback)(HSD_Particle *part))
void psSetPointJObjNodup(HSD_JObj *jobj, int no)
void psKillParticle(HSD_Particle *pp)
static void psRemoveBillboardCamera(void)
u16 numActiveParticles
HSD_Particle * psGenerateParticleID(int linkNo, int bank, int id)
void psAddOffsetAll(float xofs, float yofs, float zofs)
void psKillGeneratorChild(HSD_Generator *gp)
int texc[4][4]
u16 numPeakParticles
HSD_PSFormGroup ** psFormGroupArray[64]
static void setupChanCtrl(HSD_Particle *pp)
HSD_PSTexGroup ** psTexGroupArray[64]
static void setupChanReg(HSD_Particle *pp)
static void setBlendMode(int blendmode)
HSD_Particle * psGenerateParticleID0(HSD_Particle *p, int linkNo, int bank, int id, int flgInterpret)
u32 * ptclref[64]
static void getClrTrail(HSD_Particle *pp, GXColor *col)
HSD_PSCmdList ** psCmdListArray[64]
static HSD_Particle * psDispSubPointTrail(HSD_Particle *pp)
void psSetPointJObj(int no, HSD_JObj *jobj)
void psPauseFamily(u16 idnum, int linkNo)
void psKillFamily(u16 idnum, int linkNo)
void psClearPointJObj(void)
static void psSetCurrentMtx(GXPosNrmMtx idx)
void psDeletePntJObjwithParticle(HSD_Particle *pp)
HSD_Particle * psGenerateParticle(int linkNo, int bank, u32 kind, u16 texGroup, u8 *list, int life, float x, float y, float z, float vx, float vy, float vz, float size, float grav, float fric, int palflag, HSD_Generator *gp)
void psInitParticle(int num)
void psRemoveFog(void)
int td
int(** psCallback)(HSD_Particle *part)
static void setupTevReg(HSD_Particle *pp)
HSD_Particle * psGenerateParticleIDPV(int linkNo, int bank, int id, float px, float py, float pz, float vx, float vy, float vz)
int psNumCmdList[64]
static void psDispSub(HSD_Particle *pp, u8 *texform)
void psKillAllParticle(void)
static HSD_Particle * psDispSubPoint(HSD_Particle *pp)
Definition fog.h:21
Definition psstructs.h:258
u8 dummy
Definition psstructs.h:269
Vec3 pos
Definition psstructs.h:273
u8 * cmdList
Definition psstructs.h:272
HSD_psAppSRT * appsrt
Definition psstructs.h:281
HSD_Generator * next
Definition psstructs.h:259
f32 fric
Definition psstructs.h:276
f32 size
Definition psstructs.h:277
u32 numChild
Definition psstructs.h:280
f32 count
Definition psstructs.h:262
u16 idnum
Definition psstructs.h:270
union HSD_Generator::@364 aux
u16 type
Definition psstructs.h:265
u8 bank
Definition psstructs.h:266
u8 linkNo
Definition psstructs.h:267
u8 texGroup
Definition psstructs.h:268
u16 genLife
Definition psstructs.h:264
f32 random
Definition psstructs.h:261
auxRect rect
Definition psstructs.h:288
f32 radius
Definition psstructs.h:278
u16 life
Definition psstructs.h:271
f32 grav
Definition psstructs.h:275
Vec3 vel
Definition psstructs.h:274
auxSphere sphere
Definition psstructs.h:290
auxCone cone
Definition psstructs.h:289
HSD_JObj * jobj
Definition psstructs.h:263
HSD_PSUserFunc * userfunc
Definition psstructs.h:282
auxLine line
Definition psstructs.h:286
f32 angle
Definition psstructs.h:279
u32 kind
Definition psstructs.h:260
auxTornado tornado
Definition psstructs.h:287
int(* callback)(HSD_Generator *part)
Definition psstructs.h:283
auxDisc disc
Definition psstructs.h:285
Definition jobj.h:107
Definition psstructs.h:60
u32 kind
Definition psstructs.h:67
float fric
Definition psstructs.h:70
u16 genLife
Definition psstructs.h:64
float vy
Definition psstructs.h:73
float param2
Definition psstructs.h:82
float param1
Definition psstructs.h:81
float size
Definition psstructs.h:79
float param3
Definition psstructs.h:83
u16 type
Definition psstructs.h:61
float vz
Definition psstructs.h:74
u16 life
Definition psstructs.h:65
float grav
Definition psstructs.h:69
float angle
Definition psstructs.h:77
float radius
Definition psstructs.h:76
u16 texGroup
Definition psstructs.h:62
float random
Definition psstructs.h:78
float vx
Definition psstructs.h:72
Definition psstructs.h:54
u32 num
Definition psstructs.h:55
Definition psstructs.h:38
u16 palnum
Definition psstructs.h:47
u32 num
Definition psstructs.h:39
u32 fmt
Definition psstructs.h:41
u32 width
Definition psstructs.h:44
u16 palflag
Definition psstructs.h:48
u32 height
Definition psstructs.h:45
u32 tlutfmt
Definition psstructs.h:42
Definition psstructs.h:206
Definition psstructs.h:117
u16 envColRemain
Definition psstructs.h:175
Vec3 pos
Definition psstructs.h:155
u16 ambColCount
Definition psstructs.h:168
u16 cmdLoopPtr
Definition psstructs.h:146
u8 ambRGBTarget
Definition psstructs.h:194
GXColor primCol
Definition psstructs.h:132
u16 ambColRemain
Definition psstructs.h:180
u8 aCmpParam1Target
Definition psstructs.h:183
float fric
Definition psstructs.h:153
u8 poseNum
Definition psstructs.h:125
struct HSD_Generator * gen
Definition psstructs.h:199
u8 ambRGB
Definition psstructs.h:189
u8 matRGB
Definition psstructs.h:186
u8 aCmpParam2Target
Definition psstructs.h:184
GXColor envCol
Definition psstructs.h:133
u8 bank
Definition psstructs.h:122
u16 primColCount
Definition psstructs.h:130
u16 idnum
Definition psstructs.h:141
u16 matColCount
Definition psstructs.h:167
float size
Definition psstructs.h:157
u8 ambATarget
Definition psstructs.h:195
u8 linkNo
Definition psstructs.h:139
GXColor primColTarget
Definition psstructs.h:176
Vec3 vel
Definition psstructs.h:150
float rotateTarget
Definition psstructs.h:172
int(* callback)(HSD_Particle *part)
Definition psstructs.h:202
u8 ambA
Definition psstructs.h:190
u16 cmdWait
Definition psstructs.h:135
u8 pJObjOfs
Definition psstructs.h:165
float grav
Definition psstructs.h:152
u16 cmdMarkPtr
Definition psstructs.h:145
u16 cmdPtr
Definition psstructs.h:144
float rotate
Definition psstructs.h:158
u8 matA
Definition psstructs.h:187
u16 matColRemain
Definition psstructs.h:179
float sizeTarget
Definition psstructs.h:171
u32 kind
Definition psstructs.h:120
u8 texGroup
Definition psstructs.h:123
HSD_Particle * next
Definition psstructs.h:118
u16 primColRemain
Definition psstructs.h:174
struct HSD_psAppSRT * appsrt
Definition psstructs.h:200
u8 aCmpMode
Definition psstructs.h:161
u16 aCmpCount
Definition psstructs.h:160
u8 * cmdList
Definition psstructs.h:143
u16 envColCount
Definition psstructs.h:131
GXColor envColTarget
Definition psstructs.h:177
float * userdata
Definition psstructs.h:201
u8 matATarget
Definition psstructs.h:193
u16 rotateCount
Definition psstructs.h:169
u8 palNum
Definition psstructs.h:126
u16 sizeCount
Definition psstructs.h:128
u8 matRGBTarget
Definition psstructs.h:192
u8 aCmpParam1
Definition psstructs.h:162
u16 aCmpRemain
Definition psstructs.h:182
u8 aCmpParam2
Definition psstructs.h:163
float trail
Definition psstructs.h:197
u16 life
Definition psstructs.h:148
u8 loopCount
Definition psstructs.h:137
Definition psstructs.h:88
Vec3 translate
Definition psstructs.h:93
float ssx
Definition psstructs.h:103
s8 xA2
Definition psstructs.h:112
u8 dummy
Definition psstructs.h:110
Vec3 scale
Definition psstructs.h:95
struct HSD_psAppSRT * next
Definition psstructs.h:89
u8 x31_fill[0xA2 - 0x74]
Definition psstructs.h:111
struct HSD_Generator * gp
Definition psstructs.h:91
u8 billboard
Definition psstructs.h:109
u8 status
Definition psstructs.h:97
u16 idnum
Definition psstructs.h:108
float ssy
Definition psstructs.h:104
u16 usedCount
Definition psstructs.h:100
Quaternion rot
Definition psstructs.h:94
u8 frameNum
Definition psstructs.h:99
void(* freefunc)(struct HSD_psAppSRT *appSrt)
Definition psstructs.h:106
Mtx mmtx
Definition psstructs.h:102
Definition psstructs.h:244
f32 maxAngle
Definition psstructs.h:246
f32 minAngle
Definition psstructs.h:245
f32 height
Definition psstructs.h:247
Definition psstructs.h:213
f32 maxAngle
Definition psstructs.h:215
f32 minAngle
Definition psstructs.h:214
Definition psstructs.h:218
f32 x2
Definition psstructs.h:219
f32 y2
Definition psstructs.h:220
f32 z2
Definition psstructs.h:221
Definition psstructs.h:228
f32 xz
Definition psstructs.h:234
f32 yz
Definition psstructs.h:237
f32 x
Definition psstructs.h:229
f32 yy
Definition psstructs.h:236
f32 xy
Definition psstructs.h:233
f32 zx
Definition psstructs.h:238
u16 flag
Definition psstructs.h:241
f32 y
Definition psstructs.h:230
f32 zy
Definition psstructs.h:239
f32 z
Definition psstructs.h:231
f32 yx
Definition psstructs.h:235
f32 xx
Definition psstructs.h:232
f32 zz
Definition psstructs.h:240
Definition psstructs.h:250
f32 lonMid
Definition psstructs.h:254
f32 lonRange
Definition psstructs.h:255
f32 latMid
Definition psstructs.h:252
f32 speed
Definition psstructs.h:251
f32 latRange
Definition psstructs.h:253
Definition psstructs.h:224
f32 vel
Definition psstructs.h:225