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