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