Skip to content

Commit 0579f4a

Browse files
authored
Fix d_a_ykgr retail regalloc and mostly match on debug (#2608)
* d_a_ykgr OK * Fix sqrtf for shield * Fix pch caps
1 parent a945ef4 commit 0579f4a

File tree

8 files changed

+123
-81
lines changed

8 files changed

+123
-81
lines changed

config/GZ2P01/symbols.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21794,9 +21794,9 @@ m_roomDzs__20dStage_roomControl_c = .sbss:0x80452D34; // type:object size:0x8 sc
2179421794
m_res__22dMap_HIO_prm_res_dst_s = .sbss:0x80452D40; // type:object size:0x4 scope:global align:4 data:4byte
2179521795
m_count__9daArrow_c = .sbss:0x80452D48; // type:object size:0x2 scope:global align:2
2179621796
mSetTop__7daSus_c = .sbss:0x80452D4A; // type:object size:0x2 scope:global align:2 data:2byte
21797-
lbl_80452D4C = .sbss:0x80452D4C; // type:object size:0x1 data:byte
21798-
lbl_80452D4D = .sbss:0x80452D4D; // type:object size:0x1 data:byte
21799-
lbl_80452D4E = .sbss:0x80452D4E; // type:object size:0x1 data:byte
21797+
m_flag__8daYkgr_c = .sbss:0x80452D4C; // type:object size:0x1 data:byte
21798+
m_alpha_flag__8daYkgr_c = .sbss:0x80452D4D; // type:object size:0x1 data:byte
21799+
m_alpha__8daYkgr_c = .sbss:0x80452D4E; // type:object size:0x1 data:byte
2180021800
m_aim_rate__8daYkgr_c = .sbss:0x80452D50; // type:object size:0x4 scope:global align:4
2180121801
m_path__8daYkgr_c = .sbss:0x80452D54; // type:object size:0x4 scope:global align:4
2180221802
m_emitter__8daYkgr_c = .sbss:0x80452D58; // type:object size:0x4 scope:global align:4 data:4byte
@@ -21808,8 +21808,8 @@ m_grass__9daGrass_c = .sbss:0x80452D70; // type:object size:0x4 scope:global ali
2180821808
m_flower__9daGrass_c = .sbss:0x80452D74; // type:object size:0x4 scope:global align:4 data:4byte
2180921809
m_myObj__6daMP_c = .sbss:0x80452D78; // type:object size:0x4 scope:global align:4 data:4byte
2181021810
mTagMagne__12daTagMagne_c = .sbss:0x80452D7C; // type:object size:0x4 scope:global align:4 data:4byte
21811-
lbl_80452D80 = .sbss:0x80452D80; // type:object size:0x1 data:byte
21812-
lbl_80452D81 = .sbss:0x80452D81; // type:object size:0x1 data:byte
21811+
mPlayerNo__11daTagMist_c = .sbss:0x80452D80; // type:object size:0x1 data:byte
21812+
mSaveFlag__12daObjCarry_c = .sbss:0x80452D81; // type:object size:0x1 data:byte
2181321813
mSttsFlag__12daObjCarry_c = .sbss:0x80452D84; // type:object size:0x5 scope:global align:4
2181421814
mRoomNo__12daObjCarry_c = .sbss:0x80452D8C; // type:object size:0x5 scope:global align:4
2181521815
m_diffTime__11dLib_time_c = .sbss:0x80452D98; // type:object size:0x8 scope:global align:4 data:4byte

config/ShieldD/symbols.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64323,9 +64323,9 @@ g_dComIfAc_gameInfo = .sbss:0x8074C5C0; // type:object size:0x8 scope:global has
6432364323
g_dComIfGoat_gameInfo = .sbss:0x8074C5C8; // type:object size:0x4 scope:global data:4byte hash:0xB039AA75
6432464324
m_count__9daArrow_c = .sbss:0x8074C5D0; // type:object size:0x2 scope:global hash:0xAFED360D dhash:0x0191FF94
6432564325
mSetTop__7daSus_c = .sbss:0x8074C5D2; // type:object size:0x2 scope:global data:2byte hash:0x3886CAFA dhash:0xADB8E62D
64326-
lbl_8074C5D4 = .sbss:0x8074C5D4; // type:object size:0x1 data:byte hash:0x89C78ABD dhash:0x1116DE05
64327-
lbl_8074C5D5 = .sbss:0x8074C5D5; // type:object size:0x1 data:byte hash:0x5FA2AFF6 dhash:0x5338112E
64328-
lbl_8074C5D6 = .sbss:0x8074C5D6; // type:object size:0x1 data:byte hash:0xB5EF2685 dhash:0x3355973D
64326+
m_flag__8daYkgr_c = .sbss:0x8074C5D4; // type:object size:0x1 data:byte hash:0x89C78ABD dhash:0x1116DE05
64327+
m_alpha_flag__8daYkgr_c = .sbss:0x8074C5D5; // type:object size:0x1 data:byte hash:0x5FA2AFF6 dhash:0x5338112E
64328+
m_alpha__8daYkgr_c = .sbss:0x8074C5D6; // type:object size:0x1 data:byte hash:0xB5EF2685 dhash:0x3355973D
6432964329
m_aim_rate__8daYkgr_c = .sbss:0x8074C5D8; // type:object size:0x4 scope:global hash:0xF2CCF169 dhash:0xBC891711
6433064330
m_path__8daYkgr_c = .sbss:0x8074C5DC; // type:object size:0x4 scope:global hash:0x10A168FC dhash:0x111A6F24
6433164331
m_emitter__8daYkgr_c = .sbss:0x8074C5E0; // type:object size:0x4 scope:global data:4byte hash:0x078BB187 dhash:0x7DAC84FF
@@ -64337,8 +64337,8 @@ m_grass__9daGrass_c = .sbss:0x8074C5FC; // type:object size:0x4 scope:global dat
6433764337
m_flower__9daGrass_c = .sbss:0x8074C600; // type:object size:0x4 scope:global data:4byte hash:0x24D76026 dhash:0x251474BF
6433864338
m_myObj__6daMP_c = .sbss:0x8074C604; // type:object size:0x4 scope:global data:4byte hash:0x2BC7D0F6 dhash:0x6336B9A0
6433964339
mTagMagne__12daTagMagne_c = .sbss:0x8074C608; // type:object size:0x4 scope:global data:4byte hash:0x413B5D52 dhash:0x0B5ED571
64340-
lbl_8074C60C = .sbss:0x8074C60C; // type:object size:0x1 data:byte hash:0x3A84AB81 dhash:0x97EA4041
64341-
lbl_8074C60D = .sbss:0x8074C60D; // type:object size:0x1 data:byte hash:0xA085CB0F dhash:0x5B969AEC
64340+
mPlayerNo__11daTagMist_c = .sbss:0x8074C60C; // type:object size:0x1 data:byte hash:0x3A84AB81 dhash:0x97EA4041
64341+
mSaveFlag__12daObjCarry_c = .sbss:0x8074C60D; // type:object size:0x1 data:byte hash:0xA085CB0F dhash:0x5B969AEC
6434264342
mSttsFlag__12daObjCarry_c = .sbss:0x8074C610; // type:object size:0x5 scope:global hash:0x2C3B0182 dhash:0x70F95521
6434364343
mRoomNo__12daObjCarry_c = .sbss:0x8074C618; // type:object size:0x5 scope:global hash:0x7A66BF30 dhash:0x986864D3
6434464344
m_diffTime__11dLib_time_c = .sbss:0x8074C620; // type:object size:0x8 scope:global data:4byte hash:0xFC753EFA dhash:0x51401BBA

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ def MatchingFor(*versions) -> bool:
16401640
ActorRel(MatchingFor("GZ2E01"), "d_a_tag_mstop"),
16411641
ActorRel(MatchingFor("GZ2E01"), "d_a_tag_spring"),
16421642
ActorRel(MatchingFor("GZ2E01"), "d_a_tag_statue_evt"),
1643-
ActorRel(NonMatching, "d_a_ykgr"),
1643+
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_ykgr"),
16441644
ActorRel(MatchingFor("GZ2E01"), "d_a_L7demo_dr"),
16451645
ActorRel(MatchingFor("GZ2E01"), "d_a_L7low_dr"),
16461646
ActorRel(MatchingFor("GZ2E01"), "d_a_L7op_demo_dr"),

include/JSystem/JParticle/JPAEmitter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class JPABaseEmitter {
120120
u8 getResourceManagerID() const { return mResMgrID; }
121121
u8 getGroupID() const { return mGroupID; }
122122
u8 getDrawTimes() const { return mDrawTimes; }
123+
f32 getRate() const { return mRate; }
123124
void setRate(f32 rate) { mRate = rate; }
124125
void setDirectionalSpeed(f32 i_speed) { mDirSpeed = i_speed; }
125126
void setRandomDirectionSpeed(f32 i_speed) { mRndmDirSpeed = i_speed; }

include/d/actor/d_a_ykgr.h

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,6 @@
88
#include "d/d_com_inf_game.h"
99
#include "d/d_particle.h"
1010

11-
struct daYkgr_HIO_c : public mDoHIO_entry_c {
12-
daYkgr_HIO_c();
13-
/* 805A8D98 */ virtual ~daYkgr_HIO_c();
14-
15-
void genMessage(JORMContext*);
16-
17-
/* 0x04 */ u8 field_0x4;
18-
/* 0x08 */ s32 field_0x8;
19-
/* 0x0C */ s32 field_0xc;
20-
/* 0x10 */ f32 field_0x10;
21-
/* 0x14 */ f32 field_0x14;
22-
/* 0x18 */ f32 field_0x18;
23-
/* 0x1C */ f32 field_0x1c;
24-
/* 0x20 */ f32 field_0x20;
25-
/* 0x24 */ f32 field_0x24;
26-
};
27-
2811
struct dPa_YkgrPcallBack : public JPAParticleCallBack {
2912
dPa_YkgrPcallBack();
3013
/* 805A8E3C */ ~dPa_YkgrPcallBack() {}
@@ -67,22 +50,10 @@ class daYkgr_c : public fopAc_ac_c {
6750
}
6851
}
6952

70-
void set_mtx() {
71-
camera_class* iVar1 = dComIfGp_getCamera(0);
72-
cXyz local_28;
73-
current.pos = *fopCamM_GetEye_p(iVar1);
74-
dKyr_get_vectle_calc(&iVar1->lookat.eye, &iVar1->lookat.center, &local_28);
75-
current.angle.y = cM_atan2s(local_28.x, local_28.z);
76-
current.angle.x = -cM_atan2s(
77-
local_28.y, JMAFastSqrt((local_28.x * local_28.x + local_28.z * local_28.z)));
78-
mDoMtx_stack_c::transS(current.pos.x, current.pos.y,
79-
current.pos.z);
80-
mDoMtx_stack_c::YrotM(current.angle.y);
81-
mDoMtx_stack_c::XrotM(current.angle.x);
82-
MTXCopy(mDoMtx_stack_c::get(), field_0x570);
83-
}
53+
inline void set_mtx();
8454

8555
int _create();
56+
int _delete();
8657
int _execute();
8758
int _draw();
8859

include/d/dolzel_base.pch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "d/d_com_inf_game.h" // IWYU pragma: export
1616
#include "d/d_bg_w.h" // IWYU pragma: export
1717
#include "m_Do/m_Do_graphic.h" // IWYU pragma: export
18-
#include "JSystem/J2DGraph/J2DOrthograph.h" // IWYU pragma: export
18+
#include "JSystem/J2DGraph/J2DOrthoGraph.h" // IWYU pragma: export
1919
#include "JSystem/J2DGraph/J2DPane.h" // IWYU pragma: export
2020
#include "JSystem/J2DGraph/J2DPictureEx.h" // IWYU pragma: export
2121
#include "JSystem/J2DGraph/J2DScreen.h" // IWYU pragma: export

src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef MSL_MATH_H_
22
#define MSL_MATH_H_
33

4+
#include "global.h"
45
#include "float.h"
56

67
#define NAN (*(float*) __float_nan)
@@ -68,6 +69,11 @@ double sqrt(double);
6869
double tan(double);
6970
float tanf(float);
7071

72+
#if PLATFORM_SHIELD
73+
inline float sqrtf(float mag) {
74+
return sqrt(mag);
75+
}
76+
#else
7177
inline float sqrtf(float mag) {
7278
static const double _half = 0.5;
7379
static const double _three = 3.0;
@@ -85,6 +91,7 @@ inline float sqrtf(float mag) {
8591
return mag;
8692
}
8793
}
94+
#endif
8895

8996
inline float atan2f(float y, float x) {
9097
return (float)atan2(y, x);

src/d/actor/d_a_ykgr.cpp

Lines changed: 101 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,38 @@
1111
#include "JSystem/JKernel/JKRHeap.h"
1212
#include "Z2AudioLib/Z2Instances.h"
1313

14+
struct daYkgr_HIO_c : public mDoHIO_entry_c {
15+
daYkgr_HIO_c();
16+
/* 805A8D98 */ virtual ~daYkgr_HIO_c() {}
17+
18+
void genMessage(JORMContext*);
19+
20+
/* 0x04 */ u8 field_0x4;
21+
/* 0x08 */ s32 field_0x8;
22+
/* 0x0C */ s32 field_0xc;
23+
/* 0x10 */ f32 field_0x10;
24+
/* 0x14 */ f32 field_0x14;
25+
/* 0x18 */ f32 field_0x18;
26+
/* 0x1C */ f32 field_0x1c;
27+
/* 0x20 */ f32 field_0x20;
28+
/* 0x24 */ f32 field_0x24;
29+
};
30+
31+
#ifdef DEBUG
32+
void daYkgr_HIO_c::genMessage(JORMContext* ctx) {
33+
ctx->genLabel("竜の山陽炎HIO", 0, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
34+
ctx->genSlider("アルファ速度", &field_0xc, 0, 255, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
35+
ctx->genCheckBox("アルファチェック", &field_0x4, 0x01, 0, NULL, 0xFFFF, 0xFFFF, 512, 24);
36+
ctx->genSlider("アルファ", &field_0x8, 0, 255, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
37+
ctx->genSlider("INDMTX PARAM", &field_0x10, -17.0f, 47.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
38+
ctx->genSlider("min_param", &field_0x14, -17.0f, 47.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
39+
ctx->genSlider("max_param", &field_0x18, -17.0f, 47.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
40+
ctx->genSlider("default_rate", &field_0x1c, 0.0f, 1.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
41+
ctx->genSlider("outside_range", &field_0x20, 0.0f, 10000.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
42+
ctx->genSlider("inside_range", &field_0x24, 0.0f, 10000.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
43+
}
44+
#endif
45+
1446
inline daYkgr_HIO_c::daYkgr_HIO_c() {
1547
field_0x4 = 0;
1648
field_0x8 = 0xff;
@@ -45,15 +77,11 @@ void dPa_YkgrPcallBack::setParam(f32 param_1) {
4577
if (param_1 <= -17.0f || param_1 >= 47.0f) return; {
4678
if (param_1 >= 0.0f) {
4779
field_0x1c = param_1;
48-
f32 fVar1 = (param_1 - field_0x1c) * 0.5f + 0.5f;
49-
field_0x4[1][1] = fVar1;
50-
field_0x4[0][0] = fVar1;
80+
field_0x4[0][0] = field_0x4[1][1] = (param_1 - field_0x1c) * 0.5f + 0.5f;
5181
} else {
52-
f32 x = param_1 - 1.0f;
53-
field_0x1c = x;
54-
f32 fVar1 = (x - field_0x1c) * 0.5f + 1.0f;
55-
field_0x4[1][1] = fVar1;
56-
field_0x4[0][0] = fVar1;
82+
param_1 = (param_1 - 1.0f);
83+
field_0x1c = param_1;
84+
field_0x4[0][0] = field_0x4[1][1] = (param_1 - field_0x1c) * 0.5f + 1.0f;
5785
}
5886
field_0x4[0][1] = 0.0f;
5987
field_0x4[0][2] = 0.0f;
@@ -69,7 +97,8 @@ static daYkgr_HIO_c l_HIO;
6997
f32 daYkgr_c::getPosRate() {
7098
if (m_path == NULL) {
7199
return 0.0f;
72-
}
100+
}
101+
f32 rate = 0.0f;
73102
f32 dVar11 = FLT_MAX;
74103
cXyz cStack_5c(dComIfGp_getPlayer(0)->current.pos);
75104
dPnt* iVar9 = m_path->m_points;
@@ -86,37 +115,36 @@ f32 daYkgr_c::getPosRate() {
86115
} else if (dVar11 < l_HIO.field_0x24) {
87116
dVar11 = l_HIO.field_0x24;
88117
}
89-
f32 y = (l_HIO.field_0x20);
90-
y = (dVar11 - l_HIO.field_0x24) / (y -l_HIO.field_0x24);
91-
return 1.0f - y;
118+
rate = (dVar11 - l_HIO.field_0x24) / (l_HIO.field_0x20 -l_HIO.field_0x24);
119+
rate = 1.0f - rate;
120+
return rate;
92121
}
93122

94123
/* 805A9138-805A9158 000088 0020+00 2/3 0/0 0/0 .bss YkgrCB */
95124
static dPa_YkgrPcallBack YkgrCB;
96125

97126
/* 805A882C-805A8A48 00048C 021C+00 1/0 0/0 0/0 .text daYkgrCreate__FPv */
98-
// NONMATCHING regalloc
99127
inline int daYkgr_c::_create() {
100-
dPath* path;
101-
s32 uVar1 = fopAcM_GetParam(this) ;
102-
uVar1 = (uVar1 >> 0x14) & 0xf;
128+
int uVar1 = u8((fopAcM_GetParam(this) & 0x00F00000) >> 0x14);
103129
fopAcM_SetupActor(this, daYkgr_c);
104-
u32 uVar4 = (fopAcM_GetParam(this) >> 8) & 0xff;
130+
u8 uVar4 = (fopAcM_GetParam(this) & 0x0000FF00) >> 8;
131+
OS_REPORT("pathNo = %d\n", uVar4);
105132
if (uVar4 != 0xff) {
106-
path = dPath_GetRoomPath(uVar4, fopAcM_GetRoomNo(this));
133+
m_path = dPath_GetRoomPath(uVar4, fopAcM_GetRoomNo(this));
107134
} else {
108-
path = NULL;
135+
m_path = NULL;
109136
}
110-
m_path = path;
111137

112138
if (m_emitter == NULL) {
113139
fopAc_ac_c* player = dComIfGp_getPlayer(0);
140+
OS_REPORT("##\n##\n## particle set Ykgr\n##\n##\n");
114141
this->current.pos = player->current.pos;
115142
m_emitter = dComIfGp_particle_set(0x80e2, &this->current.pos, NULL, NULL);
116143
if (m_emitter != NULL) {
117144
m_emitter->setParticleCallBackPtr(&YkgrCB);
118145
YkgrCB.setParam(-3.0f);
119146
} else {
147+
OS_REPORT("エミッターの生成に失敗しました!!\n");
120148
return cPhs_ERROR_e;
121149
}
122150
fopAcM_setStageLayer(this);
@@ -133,6 +161,9 @@ inline int daYkgr_c::_create() {
133161
field_0x5a8 = 0.0f;
134162
stop();
135163
}
164+
#ifdef DEBUG
165+
l_HIO.entryHIO("竜の山陽炎");
166+
#endif
136167
} else {
137168
if (uVar1 == 1) {
138169
start();
@@ -141,39 +172,51 @@ inline int daYkgr_c::_create() {
141172
}
142173
return cPhs_UNK3_e;
143174
}
175+
OS_REPORT(" alpha = %d\n", m_emitter->getGlobalAlpha());
176+
OS_REPORT(" rate = %3.3f\n", m_emitter->getRate());
177+
OS_REPORT("\n\nfopAcM_GetParam = %x\n\n\n", fopAcM_GetParam(this));
144178
return cPhs_COMPLEATE_e;
145179
}
146180

147181
static int daYkgrCreate(void* i_this) {
148182
return static_cast<daYkgr_c*>(i_this)->_create();
149183
}
150184

151-
/* 805A8A48-805A8A50 0006A8 0008+00 1/0 0/0 0/0 .text daYkgrDelete__FPv */
152-
static int daYkgrDelete(void* param_0) {
185+
inline int daYkgr_c::_delete() {
186+
#ifdef DEBUG
187+
l_HIO.removeHIO();
188+
#endif
153189
return 1;
154190
}
155191

192+
/* 805A8A48-805A8A50 0006A8 0008+00 1/0 0/0 0/0 .text daYkgrDelete__FPv */
193+
static int daYkgrDelete(void* i_this) {
194+
return static_cast<daYkgr_c*>(i_this)->_delete();
195+
}
196+
156197
/* 805A8A50-805A8BBC 0006B0 016C+00 1/0 0/0 0/0 .text daYkgrExecute__FPv */
157-
// NONMATCHING regalloc
158198
inline int daYkgr_c::_execute() {
159199
cLib_addCalc2(&field_0x5a4, m_aim_rate, 0.25f, 0.05f);
160200
cLib_addCalc2(&m_aim_rate, l_HIO.field_0x1c, 0.25f, 0.05f);
161201
cLib_addCalc2(&field_0x5a8, getPosRate(), 0.25f, 0.05f);
162-
f32 fVar4 = field_0x5a8 * 0.5f + field_0x5a4 * 0.5f;
163-
YkgrCB.setParam(fVar4 * l_HIO.field_0x18 + (1.0f - fVar4) * l_HIO.field_0x14);
202+
f32 fVar4 = field_0x5a4 * 0.5f + field_0x5a8 * 0.5f;
203+
f32 tmp = fVar4 * l_HIO.field_0x18 + (1.0f - fVar4) * l_HIO.field_0x14;
204+
YkgrCB.setParam(tmp);
164205
if (m_alpha_flag == 0) {
165-
if (m_alpha != 0) {
206+
if (m_alpha > 0) {
166207
if (m_alpha > l_HIO.field_0xc) {
167208
m_alpha = m_alpha - l_HIO.field_0xc;
168209
} else {
169210
m_alpha = 0;
170211
}
171212
}
172-
} else if (m_alpha < 0xff) {
173-
if (m_alpha < 0xff - l_HIO.field_0xc) {
174-
m_alpha = m_alpha + l_HIO.field_0xc;
175-
} else {
176-
m_alpha = 0xff;
213+
} else {
214+
if (m_alpha < 0xff) {
215+
if (m_alpha < 0xff - l_HIO.field_0xc) {
216+
m_alpha = m_alpha + l_HIO.field_0xc;
217+
} else {
218+
m_alpha = 0xff;
219+
}
177220
}
178221
}
179222
return 1;
@@ -183,11 +226,28 @@ static int daYkgrExecute(void* i_this) {
183226
return static_cast<daYkgr_c*>(i_this)->_execute();
184227
}
185228

229+
void daYkgr_c::set_mtx() {
230+
camera_class* iVar1 = dComIfGp_getCamera(0);
231+
cXyz local_28;
232+
cXyz* r29 = fopCamM_GetEye_p(iVar1);
233+
current.pos = *r29;
234+
dKyr_get_vectle_calc(&iVar1->lookat.eye, &iVar1->lookat.center, &local_28);
235+
current.angle.y = (s16)cM_atan2s(local_28.x, local_28.z);
236+
current.angle.x = -cM_atan2s(
237+
local_28.y, JMAFastSqrt((local_28.x * local_28.x + local_28.z * local_28.z)));
238+
mDoMtx_stack_c::transS(current.pos.x, current.pos.y,
239+
current.pos.z);
240+
mDoMtx_stack_c::YrotM(current.angle.y);
241+
mDoMtx_stack_c::XrotM(current.angle.x);
242+
MTXCopy(mDoMtx_stack_c::get(), field_0x570);
243+
}
244+
186245
/* 805A8BBC-805A8D90 00081C 01D4+00 1/0 0/0 0/0 .text daYkgrDraw__FPv */
187246
inline int daYkgr_c::_draw() {
188247
bool rv;
248+
f32 alpha = 255.0f;
189249
if (strcmp(dComIfGp_getStartStageName(), "D_MN04A") == 0) {
190-
f32 alpha = dComIfGs_BossLife_public_Get() / 100.0f;
250+
alpha = dComIfGs_BossLife_public_Get() / 100.0f;
191251
m_alpha = alpha * 255.0f;
192252
if (m_alpha == 0) {
193253
m_alpha++;
@@ -199,7 +259,15 @@ inline int daYkgr_c::_draw() {
199259
set_mtx();
200260
if (m_emitter != NULL) {
201261
m_emitter->setGlobalRTMatrix(field_0x570);
202-
m_emitter->setGlobalAlpha(m_alpha);
262+
#ifdef DEBUG
263+
if (l_HIO.field_0x4 != 0) {
264+
m_emitter->setGlobalAlpha(l_HIO.field_0x8);
265+
YkgrCB.setParam(l_HIO.field_0x10);
266+
} else
267+
#endif
268+
{
269+
m_emitter->setGlobalAlpha(m_alpha);
270+
}
203271
}
204272
rv = true;
205273
}
@@ -215,11 +283,6 @@ static int daYkgrIsDelete(void* param_0) {
215283
return 1;
216284
}
217285

218-
/* 805A8D98-805A8DF4 0009F8 005C+00 2/1 0/0 0/0 .text __dt__12daYkgr_HIO_cFv */
219-
daYkgr_HIO_c::~daYkgr_HIO_c() {
220-
/* empty function */
221-
}
222-
223286
/* 805A9020-805A9040 -00001 0020+00 1/0 0/0 0/0 .data daYkgrMethodTable */
224287
static actor_method_class daYkgrMethodTable = {
225288
daYkgrCreate,

0 commit comments

Comments
 (0)