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" // IWYU pragma: export
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 u8 x6C_fill[0x9C - 0x6C]; /* 0x6C */
107
108 void (*freefunc)(struct HSD_psAppSRT* appSrt); /* 0x9C */
109
110 u16 idnum; /* 0xA0 */
111 s8 xA2; /* 0xA2 */
112};
113
114/* size: 0x98 */
116 HSD_Particle* next; /* 0x0 */
117
118 u32 kind; /* 0x4 */
119
120 u8 bank; /* 0x8 */
121 u8 texGroup; /* 0x9 */
122
123 u8 poseNum; /* 0xA */
124 u8 palNum; /* 0xB */
125
127
128 u16 primColCount; /* 0xE */
129 u16 envColCount; /* 0x10 */
130 GXColor primCol; /* 0x12 */
131 GXColor envCol; /* 0x16 */
132
134
136
137 u8 linkNo; /* 0x1D */
138
139 u16 idnum;
140
145
146 u16 life;
147
148 Vec3 vel; /* 0x2C */
149
150 float grav; /* 0x38 */
151 float fric; /* 0x3C */
152
153 Vec3 pos; /* 0x40 */
154
155 float size; /* 0x4C */
156 float rotate; /* 0x50 */
157
158 u16 aCmpCount; /* 0x54 */
159 u8 aCmpMode; /* 0x56 */
160 u8 aCmpParam1; /* 0x57 */
161 u8 aCmpParam2; /* 0x58 */
162
163 u8 pJObjOfs; /* 0x59 */
164
165 u16 matColCount; /* 0x5A */
166 u16 ambColCount; /* 0x5C */
168
171
172 u16 primColRemain; /* 0x68 */
173 u16 envColRemain; /* 0x6A */
174 GXColor primColTarget; /* 0x6C */
175 GXColor envColTarget; /* 0x70 */
176
177 u16 matColRemain; /* 0x74 */
178 u16 ambColRemain; /* 0x76 */
179
180 u16 aCmpRemain; /* 0x78 */
183
184 u8 matRGB; /* 0x7C */
185 u8 matA; /* 0x7D */
186
187 u8 ambRGB; /* 0x7E */
188 u8 ambA; /* 0x7F */
189
190 u8 matRGBTarget; /* 0x80 */
191 u8 matATarget; /* 0x81 */
192 u8 ambRGBTarget; /* 0x82 */
193 u8 ambATarget; /* 0x83 */
194
195 float trail; /* 0x84 */
196
197 struct HSD_Generator* gen; /* 0x88 */
198 struct HSD_psAppSRT* appsrt; /* 0x8C */
199 float* userdata; /* 0x90 */
200 int (*callback)(HSD_Particle* part); /* 0x94 */
201};
202
203/* size: 0xC */
204typedef struct _PSUserFunc {
205 int (*hookCreate)(HSD_Particle* part); /* 0x0 */
206 int (*hookDelete)(HSD_Particle* part); /* 0x4 */
207 int (*setUserData)(HSD_Particle* part, u8 unknown1,
208 float unknown2); /* 0x8 */
210
211typedef struct _auxDisc {
214} auxDisc;
215
216typedef struct _auxLine {
217 f32 x2;
218 f32 y2;
219 f32 z2;
220} auxLine;
221
222typedef struct _auxTornado {
223 f32 vel;
224} auxTornado;
225
226typedef struct _auxRect {
227 f32 x;
228 f32 y;
229 f32 z;
230 f32 xx;
231 f32 xy;
232 f32 xz;
233 f32 yx;
234 f32 yy;
235 f32 yz;
236 f32 zx;
237 f32 zy;
238 f32 zz;
239 u16 flag;
240} auxRect;
241
242typedef struct _auxCone {
246} auxCone;
247
248typedef struct _auxSphere {
249 f32 speed;
254} auxSphere;
255
258 u32 kind; // 0x4
259 f32 random; // 0x8
260 f32 count; // 0xC
261 HSD_JObj* jobj; // 0x10
262 u16 genLife; // 0x14
263 u16 type; // 0x16
264 u8 bank; // 0x18
265 u8 linkNo; // 0x19
266 u8 texGroup; // x1A
267 u8 dummy; // 0x1B
268 u16 idnum; // 0x1C
269 u16 life; // 0x1E
270 u8* cmdList; // 0x20
271 Vec3 pos; // 0x24
272 Vec3 vel; // 0x30
273 f32 grav; // 0x3C
274 f32 fric; // 0x40
275 f32 size; // 0x44
276 f32 radius; // 0x48
277 f32 angle; // 0x4C
278 u32 numChild; // 0x50
281 int (*callback)(HSD_Generator* part); // 0x5C
282 union {
289 } aux; // 0x60
290};
291
292#define PS_TEXDIRECTION
293#ifdef PS_TEXDIRECTION
294extern int texc[4][4];
295extern int td;
296#endif
297
298#ifndef _NFUNCPROTO
299void psSetFog(struct HSD_Fog* fog);
300
301void psRemoveFog(void);
302#endif
303
304static inline void setBlendMode(int blendmode);
305
306static inline void setupChanCtrl(HSD_Particle* pp);
307static inline void setupChanReg(HSD_Particle* pp);
308static inline void getClrTrail(HSD_Particle* pp, GXColor* col);
309static inline void setupTevReg(HSD_Particle* pp);
310static inline void psSetCurrentMtx(GXPosNrmMtx idx);
313static inline void psDispSubMakePolygon(HSD_Particle* pp, u8* texform, float x,
314 float y, float z, float ppvx,
315 float ppvy, float ppvz, float x0,
316 float y0, float z0, float x1, float y1,
317 float z1);
318
319static inline void psDispSub(HSD_Particle* pp, u8* texform);
320
321void psInitDataBank(int bank, int* cmdBank, int* texBank, u32* ref,
322 int* formBank);
323
324void psInitParticle(int num);
325
327
329 u32 kind, u16 texGroup, u8* list, int life,
330 float x, float y, float z, float vx,
331 float vy, float vz, float size, float grav,
332 float fric, int palflag, HSD_Generator* gp,
333 int flgInterpret);
334
336 int id, int flgInterpret);
337
338HSD_Particle* psGenerateParticle(int linkNo, int bank, u32 kind, u16 texGroup,
339 u8* list, int life, float x, float y, float z,
340 float vx, float vy, float vz, float size,
341 float grav, float fric, int palflag,
342 HSD_Generator* gp);
343
344HSD_Particle* psGenerateParticleIDPV(int linkNo, int bank, int id, float px,
345 float py, float pz, float vx, float vy,
346 float vz);
347
348HSD_Particle* psGenerateParticleID(int linkNo, int bank, int id);
349HSD_Particle* psGenerateParticleIDN(int linkNo, int bank, int id);
350
353
354void psSetPointJObj(int no, HSD_JObj* jobj);
355void psSetPointJObjNodup(HSD_JObj* jobj, int no);
356
358
360
361void psKillFamily(u16 idnum, int linkNo);
363
364void psAddOffsetAll(float xofs, float yofs, float zofs);
365
366void psPauseFamily(u16 idnum, int linkNo);
367void psRestartFamily(u16 idnum, int linkNo);
368
370
372
373static inline void psRemoveBillboardCamera(void);
374
375#endif
u8 x0
Definition dbbonus.c:20
UnkFlagStruct x1
Definition dbbonus.c:21
static void callback(HSD_GObj *gobj)
Definition ftDk_SpecialLw.c:89
signed char s8
Definition hsd_3B2B.h:3
unsigned char u8
Definition hsd_3B2B.h:2
u32 idx
Definition lbheap.c:13
u32 size
Definition lbheap.c:16
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)
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)
Definition particle.c:4699
void psSetCallback(int(**callback)(HSD_Particle *part))
void psSetPointJObjNodup(HSD_JObj *jobj, int no)
void psKillParticle(HSD_Particle *pp)
static void psRemoveBillboardCamera(void)
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]
static void setupChanCtrl(HSD_Particle *pp)
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)
static void getClrTrail(HSD_Particle *pp, GXColor *col)
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
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)
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:256
u8 dummy
Definition psstructs.h:267
Vec3 pos
Definition psstructs.h:271
u8 * cmdList
Definition psstructs.h:270
HSD_psAppSRT * appsrt
Definition psstructs.h:279
HSD_Generator * next
Definition psstructs.h:257
f32 fric
Definition psstructs.h:274
f32 size
Definition psstructs.h:275
u32 numChild
Definition psstructs.h:278
f32 count
Definition psstructs.h:260
u16 idnum
Definition psstructs.h:268
u16 type
Definition psstructs.h:263
u8 bank
Definition psstructs.h:264
u8 linkNo
Definition psstructs.h:265
union HSD_Generator::@373 aux
u8 texGroup
Definition psstructs.h:266
u16 genLife
Definition psstructs.h:262
f32 random
Definition psstructs.h:259
auxRect rect
Definition psstructs.h:286
f32 radius
Definition psstructs.h:276
u16 life
Definition psstructs.h:269
f32 grav
Definition psstructs.h:273
Vec3 vel
Definition psstructs.h:272
auxSphere sphere
Definition psstructs.h:288
auxCone cone
Definition psstructs.h:287
HSD_JObj * jobj
Definition psstructs.h:261
HSD_PSUserFunc * userfunc
Definition psstructs.h:280
auxLine line
Definition psstructs.h:284
f32 angle
Definition psstructs.h:277
u32 kind
Definition psstructs.h:258
auxTornado tornado
Definition psstructs.h:285
int(* callback)(HSD_Generator *part)
Definition psstructs.h:281
auxDisc disc
Definition psstructs.h:283
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:204
Definition psstructs.h:115
u16 envColRemain
Definition psstructs.h:173
Vec3 pos
Definition psstructs.h:153
u16 ambColCount
Definition psstructs.h:166
u16 cmdLoopPtr
Definition psstructs.h:144
u8 ambRGBTarget
Definition psstructs.h:192
GXColor primCol
Definition psstructs.h:130
u16 ambColRemain
Definition psstructs.h:178
u8 aCmpParam1Target
Definition psstructs.h:181
float fric
Definition psstructs.h:151
u8 poseNum
Definition psstructs.h:123
struct HSD_Generator * gen
Definition psstructs.h:197
u8 ambRGB
Definition psstructs.h:187
u8 matRGB
Definition psstructs.h:184
u8 aCmpParam2Target
Definition psstructs.h:182
GXColor envCol
Definition psstructs.h:131
u8 bank
Definition psstructs.h:120
u16 primColCount
Definition psstructs.h:128
u16 idnum
Definition psstructs.h:139
u16 matColCount
Definition psstructs.h:165
float size
Definition psstructs.h:155
u8 ambATarget
Definition psstructs.h:193
u8 linkNo
Definition psstructs.h:137
GXColor primColTarget
Definition psstructs.h:174
Vec3 vel
Definition psstructs.h:148
float rotateTarget
Definition psstructs.h:170
int(* callback)(HSD_Particle *part)
Definition psstructs.h:200
u8 ambA
Definition psstructs.h:188
u16 cmdWait
Definition psstructs.h:133
u8 pJObjOfs
Definition psstructs.h:163
float grav
Definition psstructs.h:150
u16 cmdMarkPtr
Definition psstructs.h:143
u16 cmdPtr
Definition psstructs.h:142
float rotate
Definition psstructs.h:156
u8 matA
Definition psstructs.h:185
u16 matColRemain
Definition psstructs.h:177
float sizeTarget
Definition psstructs.h:169
u32 kind
Definition psstructs.h:118
u8 texGroup
Definition psstructs.h:121
HSD_Particle * next
Definition psstructs.h:116
u16 primColRemain
Definition psstructs.h:172
struct HSD_psAppSRT * appsrt
Definition psstructs.h:198
u8 aCmpMode
Definition psstructs.h:159
u16 aCmpCount
Definition psstructs.h:158
u8 * cmdList
Definition psstructs.h:141
u16 envColCount
Definition psstructs.h:129
GXColor envColTarget
Definition psstructs.h:175
float * userdata
Definition psstructs.h:199
u8 matATarget
Definition psstructs.h:191
u16 rotateCount
Definition psstructs.h:167
u8 palNum
Definition psstructs.h:124
u16 sizeCount
Definition psstructs.h:126
u8 matRGBTarget
Definition psstructs.h:190
u8 aCmpParam1
Definition psstructs.h:160
u16 aCmpRemain
Definition psstructs.h:180
u8 aCmpParam2
Definition psstructs.h:161
float trail
Definition psstructs.h:195
u16 life
Definition psstructs.h:146
u8 loopCount
Definition psstructs.h:135
Definition psstructs.h:88
Vec3 translate
Definition psstructs.h:93
float ssx
Definition psstructs.h:103
u8 x6C_fill[0x9C - 0x6C]
Definition psstructs.h:106
s8 xA2
Definition psstructs.h:111
Vec3 scale
Definition psstructs.h:95
struct HSD_psAppSRT * next
Definition psstructs.h:89
struct HSD_Generator * gp
Definition psstructs.h:91
u8 status
Definition psstructs.h:97
u16 idnum
Definition psstructs.h:110
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:108
Mtx mmtx
Definition psstructs.h:102
Definition psstructs.h:242
f32 maxAngle
Definition psstructs.h:244
f32 minAngle
Definition psstructs.h:243
f32 height
Definition psstructs.h:245
Definition psstructs.h:211
f32 maxAngle
Definition psstructs.h:213
f32 minAngle
Definition psstructs.h:212
Definition psstructs.h:216
f32 x2
Definition psstructs.h:217
f32 y2
Definition psstructs.h:218
f32 z2
Definition psstructs.h:219
Definition psstructs.h:226
f32 xz
Definition psstructs.h:232
f32 yz
Definition psstructs.h:235
f32 x
Definition psstructs.h:227
f32 yy
Definition psstructs.h:234
f32 xy
Definition psstructs.h:231
f32 zx
Definition psstructs.h:236
u16 flag
Definition psstructs.h:239
f32 y
Definition psstructs.h:228
f32 zy
Definition psstructs.h:237
f32 z
Definition psstructs.h:229
f32 yx
Definition psstructs.h:233
f32 xx
Definition psstructs.h:230
f32 zz
Definition psstructs.h:238
Definition psstructs.h:248
f32 lonMid
Definition psstructs.h:252
f32 lonRange
Definition psstructs.h:253
f32 latMid
Definition psstructs.h:250
f32 speed
Definition psstructs.h:249
f32 latRange
Definition psstructs.h:251
Definition psstructs.h:222
f32 vel
Definition psstructs.h:223