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