1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
//
// Generated By: dol2asm
// Translation Unit: J3DJoint
//
#include "JSystem/J3DGraphAnimator/J3DJoint.h"
#include "JSystem/J3DGraphAnimator/J3DMtxBuffer.h"
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "JSystem/JMath/JMath.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct J3DDrawBuffer {
static u8 entryNum[4 + 4 /* padding */];
};
//
// Forward References:
//
extern "C" void init__25J3DMtxCalcJ3DSysInitBasicFRC3VecRA3_A4_Cf();
extern "C" void init__24J3DMtxCalcJ3DSysInitMayaFRC3VecRA3_A4_Cf();
extern "C" void calcTransform__28J3DMtxCalcCalcTransformBasicFRC16J3DTransformInfo();
extern "C" void calcTransform__32J3DMtxCalcCalcTransformSoftimageFRC16J3DTransformInfo();
extern "C" void calcTransform__27J3DMtxCalcCalcTransformMayaFRC16J3DTransformInfo();
extern "C" void appendChild__8J3DJointFP8J3DJoint();
extern "C" void __ct__8J3DJointFv();
extern "C" void entryIn__8J3DJointFv();
extern "C" void recursiveCalc__8J3DJointFv();
extern "C" u8 mMtxBuffer__10J3DMtxCalc[4];
extern "C" u8 mJoint__10J3DMtxCalc[4];
extern "C" u8 mCurrentMtxCalc__8J3DJoint[4 + 4 /* padding */];
//
// External References:
//
extern "C" void
J3DGetTranslateRotateMtx__FRC16J3DTransformInfoPA4_f(J3DTransformInfo const& param_0,
f32 (*param_1)[4]);
extern "C" void J3DGetTranslateRotateMtx__FsssfffPA4_f();
extern "C" void setCurrentMtx__11J3DMaterialFv();
extern "C" void JMAMTXApplyScale__FPA4_CfPA4_ffff(const Mtx*, Mtx*, f32, f32, f32);
extern "C" void _savegpr_27();
extern "C" void _restgpr_27();
extern "C" u8 mCurrentMtx__6J3DSys[48];
extern "C" f32 mCurrentS__6J3DSys[3];
extern "C" f32 mParentS__6J3DSys[3];
extern "C" u8 entryNum__13J3DDrawBuffer[4 + 4 /* padding */];
//
// Declarations:
//
/* 8032EC28-8032ECAC 329568 0084+00 0/0 1/1 0/0 .text
* init__25J3DMtxCalcJ3DSysInitBasicFRC3VecRA3_A4_Cf */
void J3DMtxCalcJ3DSysInitBasic::init(Vec const& scale, Mtx const& mtx) {
J3DSys::mCurrentS = scale;
J3DSys::mParentS = (Vec){1.0f, 1.0f, 1.0f};
JMAMTXApplyScale(mtx, J3DSys::mCurrentMtx, J3DSys::mCurrentS.x, J3DSys::mCurrentS.y,
J3DSys::mCurrentS.z);
}
/* 8032ECAC-8032ED30 3295EC 0084+00 0/0 2/2 2/2 .text
* init__24J3DMtxCalcJ3DSysInitMayaFRC3VecRA3_A4_Cf */
void J3DMtxCalcJ3DSysInitMaya::init(Vec const& scale, Mtx const& mtx) {
J3DSys::mParentS = (Vec){1.0f, 1.0f, 1.0f};
J3DSys::mCurrentS = scale;
JMAMTXApplyScale(mtx, J3DSys::mCurrentMtx, J3DSys::mCurrentS.x, J3DSys::mCurrentS.y,
J3DSys::mCurrentS.z);
}
/* ############################################################################################## */
/* 804515F0-804515F4 000AF0 0004+00 3/3 1/1 0/0 .sbss mMtxBuffer__10J3DMtxCalc */
J3DMtxBuffer* J3DMtxCalc::mMtxBuffer;
/* 804515F4-804515F8 000AF4 0004+00 4/4 9/9 2/2 .sbss mJoint__10J3DMtxCalc */
J3DJoint* J3DMtxCalc::mJoint;
inline s32 checkScaleOne(const Vec& param_0) {
if (param_0.x == 1.0f && param_0.y == 1.0f && param_0.z == 1.0f) {
return true;
} else {
return false;
}
}
/* 8032ED30-8032EE50 329670 0120+00 0/0 1/1 0/0 .text
* calcTransform__28J3DMtxCalcCalcTransformBasicFRC16J3DTransformInfo */
void J3DMtxCalcCalcTransformBasic::calcTransform(J3DTransformInfo const& transInfo) {
J3DMtxBuffer* mtxBuf = J3DMtxCalc::getMtxBuffer();
u16 jntNo = J3DMtxCalc::getJoint()->getJntNo();
MtxP anmMtx = mtxBuf->getAnmMtx(jntNo);
J3DSys::mCurrentS.x *= transInfo.mScale.x;
J3DSys::mCurrentS.y *= transInfo.mScale.y;
J3DSys::mCurrentS.z *= transInfo.mScale.z;
J3DGetTranslateRotateMtx(transInfo, anmMtx);
if (!checkScaleOne(J3DSys::mCurrentS)) {
mtxBuf->setScaleFlag(jntNo, 0);
JMAMTXApplyScale(anmMtx, anmMtx, transInfo.mScale.x, transInfo.mScale.y,
transInfo.mScale.z);
} else {
mtxBuf->setScaleFlag(jntNo, 1);
}
PSMTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
PSMTXCopy(J3DSys::mCurrentMtx, anmMtx);
}
/* 8032EE50-8032EFBC 329790 016C+00 0/0 1/1 0/0 .text
* calcTransform__32J3DMtxCalcCalcTransformSoftimageFRC16J3DTransformInfo */
void J3DMtxCalcCalcTransformSoftimage::calcTransform(J3DTransformInfo const& transInfo) {
J3DMtxBuffer* mtxBuf = J3DMtxCalc::getMtxBuffer();
u16 jntNo = J3DMtxCalc::getJoint()->getJntNo();
MtxP anmMtx = mtxBuf->getAnmMtx(jntNo);
J3DGetTranslateRotateMtx(transInfo.mRotation.x, transInfo.mRotation.y, transInfo.mRotation.z,
transInfo.mTranslate.x * J3DSys::mCurrentS.x,
transInfo.mTranslate.y * J3DSys::mCurrentS.y,
transInfo.mTranslate.z * J3DSys::mCurrentS.z, anmMtx);
PSMTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
J3DSys::mCurrentS.x *= transInfo.mScale.x;
J3DSys::mCurrentS.y *= transInfo.mScale.y;
J3DSys::mCurrentS.z *= transInfo.mScale.z;
if (!checkScaleOne(J3DSys::mCurrentS)) {
mtxBuf->setScaleFlag(jntNo, 0);
JMAMTXApplyScale(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentS.x, J3DSys::mCurrentS.y,
J3DSys::mCurrentS.z);
anmMtx[0][3] = J3DSys::mCurrentMtx[0][3];
anmMtx[1][3] = J3DSys::mCurrentMtx[1][3];
anmMtx[2][3] = J3DSys::mCurrentMtx[2][3];
} else {
mtxBuf->setScaleFlag(jntNo, 1);
PSMTXCopy(J3DSys::mCurrentMtx, anmMtx);
}
}
/* 8032EFBC-8032F13C 3298FC 0180+00 0/0 6/6 2/2 .text
* calcTransform__27J3DMtxCalcCalcTransformMayaFRC16J3DTransformInfo */
void J3DMtxCalcCalcTransformMaya::calcTransform(J3DTransformInfo const& transInfo) {
J3DJoint* joint = J3DMtxCalc::getJoint();
J3DMtxBuffer* mtxBuf = J3DMtxCalc::getMtxBuffer();
u16 jntNo = joint->getJntNo();
MtxP anmMtx = mtxBuf->getAnmMtx(jntNo);
J3DGetTranslateRotateMtx(transInfo, anmMtx);
if (transInfo.mScale.x == 1.0f && transInfo.mScale.y == 1.0f && transInfo.mScale.z == 1.0f) {
mtxBuf->setScaleFlag(jntNo, 1);
} else {
mtxBuf->setScaleFlag(jntNo, 0);
JMAMTXApplyScale(anmMtx, anmMtx, transInfo.mScale.x, transInfo.mScale.y,
transInfo.mScale.z);
}
if (joint->getScaleCompensate() == 1) {
f32 invX = JMath::fastReciprocal(J3DSys::mParentS.x);
f32 invY = JMath::fastReciprocal(J3DSys::mParentS.y);
f32 invZ = JMath::fastReciprocal(J3DSys::mParentS.z);
anmMtx[0][0] *= invX;
anmMtx[0][1] *= invX;
anmMtx[0][2] *= invX;
anmMtx[1][0] *= invY;
anmMtx[1][1] *= invY;
anmMtx[1][2] *= invY;
anmMtx[2][0] *= invZ;
anmMtx[2][1] *= invZ;
anmMtx[2][2] *= invZ;
}
PSMTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
PSMTXCopy(J3DSys::mCurrentMtx, anmMtx);
J3DSys::mParentS.x = transInfo.mScale.x;
J3DSys::mParentS.y = transInfo.mScale.y;
J3DSys::mParentS.z = transInfo.mScale.z;
}
/* 8032F13C-8032F170 329A7C 0034+00 0/0 1/1 0/0 .text appendChild__8J3DJointFP8J3DJoint
*/
void J3DJoint::appendChild(J3DJoint* pChild) {
if (mChild == NULL) {
mChild = pChild;
} else {
J3DJoint* curChild = mChild;
while (curChild->getYounger() != NULL) {
curChild = curChild->getYounger();
}
curChild->setYounger(pChild);
}
}
/* ############################################################################################## */
/* 803A2080-803A208C 02E6E0 000C+00 1/1 0/0 0/0 .rodata @1257 */
SECTION_RODATA static u8 const lit_1257[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A2080, &lit_1257);
/* 803A208C-803A2098 02E6EC 000C+00 1/1 0/0 0/0 .rodata @1259 */
SECTION_RODATA static u8 const lit_1259[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A208C, &lit_1259);
/* 804564A4-804564A8 004AA4 0004+00 1/1 0/0 0/0 .sdata2 @1220 */
SECTION_SDATA2 static u8 lit_1220[4] = {
0x00,
0x00,
0x00,
0x00,
};
/* 8032F170-8032F254 329AB0 00E4+00 0/0 1/1 0/0 .text __ct__8J3DJointFv */
#ifdef NONMATCHING
J3DJoint::J3DJoint() {
mCallBackUserData = NULL;
mCallBack = NULL;
field_0x8 = NULL;
mChild = NULL;
mYounger = NULL;
mJntNo = 0;
mKind = 1;
mScaleCompensate = false;
mTransformInfo = j3dDefaultTransformInfo;
mBoundingSphereRadius = 0.0f;
mMtxCalc = NULL;
mMesh = NULL;
Vec init = {0.0f, 0.0f, 0.0f};
mMin = init;
mMax = init;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DJoint::J3DJoint() {
nofralloc
#include "asm/JSystem/J3DGraphAnimator/J3DJoint/__ct__8J3DJointFv.s"
}
#pragma pop
#endif
/* 8032F254-8032F3F8 329B94 01A4+00 0/0 1/1 0/0 .text entryIn__8J3DJointFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J3DJoint::entryIn() {
nofralloc
#include "asm/JSystem/J3DGraphAnimator/J3DJoint/entryIn__8J3DJointFv.s"
}
#pragma pop
/* ############################################################################################## */
/* 804515F8-80451600 000AF8 0004+04 1/1 1/1 0/0 .sbss mCurrentMtxCalc__8J3DJoint */
J3DMtxCalc* J3DJoint::mCurrentMtxCalc;
/* 8032F3F8-8032F5A8 329D38 01B0+00 0/0 1/1 0/0 .text recursiveCalc__8J3DJointFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J3DJoint::recursiveCalc() {
nofralloc
#include "asm/JSystem/J3DGraphAnimator/J3DJoint/recursiveCalc__8J3DJointFv.s"
}
#pragma pop
|