shand OK, ship 99.8%, add some missing inlines

This commit is contained in:
LagoLunatic
2025-03-28 18:15:14 -04:00
parent d945c14cac
commit bf2a5b9808
11 changed files with 320 additions and 275 deletions
+1 -1
View File
@@ -1494,7 +1494,7 @@ config.libs = [
ActorRel(Equivalent, "d_a_pedestal", extra_cflags=['-pragma "nosyminline on"']), # weak func order
ActorRel(NonMatching, "d_a_saku"),
ActorRel(Matching, "d_a_seatag"),
ActorRel(NonMatching, "d_a_shand"),
ActorRel(Matching, "d_a_shand", extra_cflags=['-pragma "nosyminline on"']),
ActorRel(NonMatching, "d_a_ship"),
ActorRel(Equivalent, "d_a_shop_item"), # weak func order
ActorRel(NonMatching, "d_a_sie_flag"),
+3 -3
View File
@@ -22,11 +22,11 @@ public:
bool _draw();
public:
/* 0x0290 */ u8 m0290[0x2216 - 0x290];
/* 0x0290 */ u8 m0290[0x2200 - 0x290];
/* 0x2200 */ f32 m2200;
/* 0x2204 */ u8 m2219[0x2216 - 0x2204];
/* 0x2216 */ s16 m2216;
/* 0x2218 */ u8 m2218;
/* 0x2219 */ u8 m2219[0x2220 - 0x2219];
/* 0x2220 */ f32 m2220;
};
class daHo_HIO_c {
+3 -3
View File
@@ -81,7 +81,7 @@ public:
void getBeltSpeed() const {}
void getBodyMtx() {}
s16 getCannonAngleX() const { return shape_angle.x + m0396 - 0x4000; }
void getCannonAngleY() const {}
s16 getCannonAngleY() const { return shape_angle.y + m0394; }
void getCraneAngle() const {}
void getCraneBaseAngle() const {}
void getCraneHookAngleY() const {}
@@ -125,8 +125,8 @@ public:
void onShortHitFlg() {}
void onStateFlg(daSHIP_SFLG flag) { mStateFlag |= flag; }
void onTornadoFlg(u32 tornadoID) { mTornadoID = tornadoID; }
void onWhirlFlg(unsigned long, short) {}
void onWhirlFlgDirect(unsigned long, short) {}
void onWhirlFlg(u32, s16) {}
void onWhirlFlgDirect(u32, s16) {}
void setAtnPos(const cXyz*) {}
void setCannon() {}
void setCrane() {}
+1 -1
View File
@@ -2977,7 +2977,7 @@ inline s32 dComIfGp_demo_mode() {
}
inline dDemo_actor_c* dComIfGp_demo_getActor(u8 id) {
return g_dComIfG_gameInfo.play.getDemo()->mDemoObj.getActor(id);
return g_dComIfG_gameInfo.play.getDemo()->getObject()->getActor(id);
}
/**
+4
View File
@@ -241,6 +241,10 @@ public:
void remove();
bool update();
dDemo_system_c* getSystem() { return mSystem;}
JStudio::TControl* getControl() { return mControl; }
dMesg_tControl* getMesgControl() { return mMesgControl; }
dDemo_object_c* getObject() { return &mDemoObj; }
int getFrame() { return mFrame; }
u32 getFrameNoMsg() { return mFrameNoMsg; }
s32 getMode() { return mMode; }
+28 -1
View File
@@ -33,6 +33,7 @@ public:
f32 getEndFrame() { return mFrameCtrl->getEnd(); }
void setFrame(f32 frame) { mFrameCtrl->setFrame(frame); }
void setPlayMode(int i_mode) { mFrameCtrl->setAttribute(i_mode); }
f32 getLoopFrame() { return mFrameCtrl->getLoop(); }
void setLoopFrame(f32 i_frame) { mFrameCtrl->setLoop(i_frame); }
BOOL isStop() {
return mFrameCtrl->checkState(J3DFrameCtrl::STATE_STOP_E) || mFrameCtrl->getRate() == 0.0f;
@@ -52,6 +53,7 @@ public:
void entry(J3DModelData *i_modelData, f32 i_frame);
void entry(J3DModelData* i_modelData) { entry(i_modelData, getFrame()); }
void entry(J3DMaterialTable* i_matTable) { entry(i_matTable, getFrame()); }
int init(J3DModelData* i_modelData, J3DAnmTextureSRTKey* i_btk, BOOL i_anmPlay, int i_attribute,
f32 i_rate, s16 i_start, s16 i_end, bool i_modify, BOOL i_entry);
@@ -179,6 +181,9 @@ public:
int init(J3DModelData*, J3DAnmTransform*, int, int, f32, s16, s16, bool);
// TODO
void entry(J3DModel* i_model) {}
private:
/* 0x08 */ J3DAnmVisibilityFull* mpAnm;
/* 0x0C */ J3DVisibilityManager* field_0xc;
@@ -595,6 +600,9 @@ public:
void update(u16, GXColor&, dKy_tevstr_c*);
int getMaterialID();
cXyz* getPos(int i_idx) { return mpLines[i_idx].mpSegments; }
u8* getSize(int i_idx) { return mpLines[i_idx].mpSize; }
public:
/* 0x08 */ GXColor mColor;
/* 0x0C */ dKy_tevstr_c* mpTevStr;
@@ -614,6 +622,9 @@ public:
void update(u16, GXColor&, dKy_tevstr_c*);
int getMaterialID();
cXyz* getPos(int i_idx) { return mpLines[i_idx].mpSegments; }
u8* getSize(int i_idx) { return mpLines[i_idx].mpSize; }
public:
/* 0x08 */ GXTexObj mTexObj;
/* 0x28 */ GXColor mColor;
@@ -622,10 +633,26 @@ public:
/* 0x32 */ u16 mMaxSegments;
/* 0x34 */ u16 mNumSegments;
/* 0x36 */ u8 mCurArr;
/* 0x37 */ u8 m37[0x38 - 0x37];
/* 0x38 */ mDoExt_3Dline_c* mpLines;
};
// The following classes only appear in the debug maps and seem unused:
// mDoExt_ArrowPacket
// mDoExt_circlePacket
// mDoExt_cube8pPacket
// mDoExt_cubePacket
// mDoExt_cylinderMPacket
// mDoExt_cylinderPacket
// mDoExt_linePacket
// mDoExt_pointPacket
// mDoExt_quadPacket
// mDoExt_spherePacket
// mDoExt_trianglePacket
inline void mDoExt_bckAnmRemove(J3DModelData* i_modelData) {
i_modelData->getJointNodePointer(0)->setMtxCalc(NULL);
}
J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u32 i_differedDlistFlag);
void mDoExt_modelUpdate(J3DModel* i_model);
+1 -1
View File
@@ -759,7 +759,7 @@ bool daStandItem_c::_draw() {
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
g_env_light.setLightTevColorType(mpModel, &tevStr);
if (mItemNo == WIND_FLAG)
mpModel->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
mDoExt_bckAnmRemove(mpModel->getModelData());
else if (mpBckAnm != NULL)
mpBckAnm->entry(mpModel->getModelData());
+1 -1
View File
@@ -96,7 +96,7 @@ void daNpc_Nz_c::TailControl() {
int temp7;
cXyz* r19 = &field_0x974[1];
cXyz* r18 = &field_0x9EC[1];
cXyz* r17 = &field_0x934.mpLines->mpSegments[0];
cXyz* r17 = field_0x934.getPos(0);
dBgS_GndChk gndChk;
for(i = 1; i < 10; i++, r19++, r18++) {
f32 temp3 = 1.0f - (i-1) * 0.1f;
+46 -32
View File
@@ -177,16 +177,17 @@ void cut_control3(shand_class* i_this) {
/* 00000C30-00000FF0 .text normal__FP11shand_class */
void normal(shand_class* i_this) {
/* Nonmatching - regalloc */
fopAc_ac_c* actor = i_this;
cXyz unused;
unused.x = unused.y = 0;
if(i_this->field_318 != 0){
dBgS_LinChk local94;
cXyz chk_start = i_this->current.pos, chk_end = i_this->current.pos;
cXyz chk_start = actor->current.pos, chk_end = actor->current.pos;
chk_start.y += 50.0f;
chk_end.y += 4000.0f;
local94.Set(&chk_start, &chk_end, i_this);
local94.Set(&chk_start, &chk_end, actor);
if(dComIfG_Bgsp()->LineCross(&local94) != false)
i_this->field_31C[19].mPos = i_this->field_2D4 = i_this->field_2C8 = local94.GetCross();
i_this->field_318--;
@@ -198,11 +199,13 @@ void normal(shand_class* i_this) {
i_this->field_2BA = 1;
*i_this->field_314 = 2;
}
// Fall-through
case 1:
i_this->field_2D4 = i_this->field_2C8;
break;
}
float y_diff = std::abs(i_this->home.pos.y - i_this->field_2C8.y);
float y_diff = std::abs(actor->home.pos.y - i_this->field_2C8.y);
cLib_addCalc2(&i_this->field_2F4, y_diff * (REG14_F(11) + 0.05f), 0.1f, 1.0f);
cLib_addCalc2(&i_this->field_300, REG14_F(12) + 10.0f, 0.1f, 0.5f);
control1(i_this);
@@ -226,16 +229,17 @@ void cut(shand_class* i_this) {
/* 00001508-00001DAC .text hand_move__FP11shand_class */
void hand_move(shand_class* i_this) {
/* Nonmatching - regalloc */
fopAc_ac_c* actor = i_this;
shand_s* shand_i = i_this->field_31C;
i_this->field_30C = static_cast<shand_class*>(fopAcM_SearchByID(i_this->field_308));
if(i_this->field_30C != NULL){
i_this->current.pos = *i_this->field_310;
i_this->current.angle.y = i_this->home.angle.y + i_this->field_30C->shape_angle.y + REG14_S(3);
actor->current.pos = *i_this->field_310;
actor->current.angle.y = actor->home.angle.y + i_this->field_30C->shape_angle.y + REG14_S(3);
switch(i_this->mState){
case 0:
normal(i_this);
i_this->attention_info.flags = fopAc_Attn_LOCKON_MISC_e;
actor->attention_info.flags = fopAc_Attn_LOCKON_MISC_e;
if(i_this->field_30C->health == 0){
i_this->mState = 1;
i_this->field_2BA = 0;
@@ -243,15 +247,15 @@ void hand_move(shand_class* i_this) {
break;
case 1:
if((fopAcM_GetParam(i_this) & 0xFF) != 1){
if((fopAcM_GetParam(actor) & 0xFF) != 1){
dBgS_GndChk local_ac;
float chk_pos_x = i_this->current.pos.x, chk_pos_y = i_this->current.pos.y, chk_pos_z = i_this->current.pos.z;
float chk_pos_x = actor->current.pos.x, chk_pos_y = actor->current.pos.y, chk_pos_z = actor->current.pos.z;
chk_pos_y -= 100.0f;
local_ac.GetPointP()->set(chk_pos_x, chk_pos_y, chk_pos_z);
i_this->ground_y = dComIfG_Bgsp()->GroundCross(&local_ac);
dBgS_ObjGndChk_Spl local_100;
chk_pos_x = i_this->current.pos.x, chk_pos_y = i_this->current.pos.y, chk_pos_z = i_this->current.pos.z;
chk_pos_x = actor->current.pos.x, chk_pos_y = actor->current.pos.y, chk_pos_z = actor->current.pos.z;
chk_pos_y += 200.0f;
local_100.GetPointP()->set(chk_pos_x, chk_pos_y, chk_pos_z);
float spl_ground_y = dComIfG_Bgsp()->GroundCross(&local_100) + 10.0f;
@@ -264,16 +268,17 @@ void hand_move(shand_class* i_this) {
}
i_this->mState = 2;
// Fall-through
case 2:
cut(i_this);
fopAcM_OffStatus(i_this, 0);
i_this->attention_info.flags = 0;
fopAcM_OffStatus(actor, 0);
actor->attention_info.flags = 0;
break;
}
}
cXyz* line_data = i_this->mLineMat.mpLines->mpSegments;
u8* line_size = i_this->mLineMat.mpLines->mpSize;
cXyz* line_data = i_this->mLineMat.getPos(0);
u8* line_size = i_this->mLineMat.getSize(0);
for(int i = 20; i != 0; i--){
*line_data = shand_i->mPos;
*line_size = shand_i->field_18;
@@ -281,17 +286,18 @@ void hand_move(shand_class* i_this) {
shand_i++; line_data++; line_size++;
}
cXyz* line_segments = i_this->mLineMat.mpLines->mpSegments;
i_this->eyePos = (line_segments + l_HIO.field_6)[10]; // Have not found any "clean" way to write that
i_this->attention_info.position = i_this->eyePos;
cXyz* line_segments = i_this->mLineMat.getPos(0);
actor->eyePos = (line_segments + l_HIO.field_6)[10]; // Have not found any "clean" way to write that
actor->attention_info.position = actor->eyePos;
bool is_hit = false;
CcAtInfo hit_atInfo;
hit_atInfo.pParticlePos = NULL;
cXyz center;
int seg_idx;
if(i_this->field_2BC[1] == 0 && i_this->mState == 0){
i_this->mSph.SetC(i_this->eyePos);
i_this->mCylArr[0].SetC(i_this->current.pos);
i_this->mSph.SetC(actor->eyePos);
i_this->mCylArr[0].SetC(actor->current.pos);
for(int i = 0; i < 5; i++){
if(i_this->field_2C4 == 0 && i_this->mCylArr[i].ChkTgHit() != 0){
hit_atInfo.mpObj = i_this->mCylArr[i].GetTgHitObj();
@@ -301,7 +307,9 @@ void hand_move(shand_class* i_this) {
}
if(i > 0){
center = line_segments[((i_this->mExecuteCount & 0b11) + (i * 4)) % 20];
seg_idx = ((i_this->mExecuteCount & 0b11) + (i * 4));
seg_idx %= 20;
center = line_segments[seg_idx];
center.y -= 200.0f;
i_this->mCylArr[i].SetC(center);
}
@@ -328,7 +336,7 @@ void hand_move(shand_class* i_this) {
hit_atInfo.mpActor = at_power_check(&hit_atInfo);
i_this->field_2C4 = 10;
if(hit_atInfo.mpActor != NULL){
def_se_set(i_this, hit_atInfo.mpObj, 33);
def_se_set(actor, hit_atInfo.mpObj, 33);
if(i_this->field_30C != NULL){
i_this->mState = 1;
i_this->field_2BA = 0;
@@ -382,10 +390,15 @@ static BOOL daShand_Delete(shand_class* i_this) {
/* 000022D4-00002360 .text useHeapInit__FP11shand_class */
static BOOL useHeapInit(shand_class* i_this) {
const int res_index = ((fopAcM_GetParam(i_this) & 0xff) == 53) ? SHAND_BTI_VHLIF_VINE : SHAND_BTI_SHAND;
ResTIMG* res = static_cast<ResTIMG*>(dComIfG_getObjectRes("Shand", res_index));
int bti_idx;
if ((fopAcM_GetParam(i_this) & 0xff) == 53) {
bti_idx = SHAND_BTI_VHLIF_VINE;
} else {
bti_idx = SHAND_BTI_SHAND;
}
ResTIMG* img = static_cast<ResTIMG*>(dComIfG_getObjectRes("Shand", bti_idx));
if(i_this->mLineMat.init(1, 20, res, 1) == FALSE){
if(i_this->mLineMat.init(1, 20, img, TRUE) == FALSE){
return FALSE;
}
else{
@@ -407,7 +420,7 @@ static cPhs_State daShand_Create(fopAc_ac_c* i_this) {
/* SrcObjAt Type */ 0,
/* SrcObjAt Atp */ 0,
/* SrcObjAt SPrm */ 0,
/* SrcObjTg Type */ ~(AT_TYPE_WATER | AT_TYPE_UNK20000 | AT_TYPE_WIND | AT_TYPE_UNK400000 | AT_TYPE_LIGHT), // 0xff1dfeff
/* SrcObjTg Type */ ~(AT_TYPE_WATER | AT_TYPE_UNK20000 | AT_TYPE_WIND | AT_TYPE_UNK400000 | AT_TYPE_LIGHT),
/* SrcObjTg SPrm */ cCcD_TgSPrm_Set_e | cCcD_TgSPrm_IsEnemy_e,
/* SrcObjCo SPrm */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsPlayer_e | cCcD_CoSPrm_VsGrpAll_e,
/* SrcGObjAt Se */ 0,
@@ -459,21 +472,22 @@ static cPhs_State daShand_Create(fopAc_ac_c* i_this) {
},
};
fopAcM_SetupActor(i_this, shand_class);
shand_class* s_this = static_cast<shand_class*>(i_this);
int ret = dComIfG_resLoad(&s_this->mPhs, "Shand");
fopAcM_SetupActor(i_this, shand_class);
cPhs_State ret = dComIfG_resLoad(&s_this->mPhs, "Shand");
if(ret == cPhs_COMPLEATE_e){
if(fopAcM_entrySolidHeap(s_this, daShand_solidHeapCB, 0x1040) != false){
s_this->health = 2;
if(fopAcM_entrySolidHeap(i_this, daShand_solidHeapCB, 0x1040) != false){
i_this->health = 2;
s_this->mExecuteCount = cM_rndF(10000.0f);
s_this->field_318 = 10;
s_this->field_2BA = 1;
s_this->field_2F0 = 1.0f;
if((fopAcM_GetParam(s_this) & 0xff) == 1)
if((fopAcM_GetParam(i_this) & 0xff) == 1)
s_this->field_304 = 15.75f;
else
s_this->field_304 = 10.5f;
s_this->mStts.Init(0xff, 0xff, s_this);
s_this->mStts.Init(0xff, 0xff, i_this);
for(int i = 0; i < 5; i++){
s_this->mCylArr[i].Set(tg_cyl_src);
s_this->mCylArr[i].SetStts(&s_this->mStts);
+231 -231
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -25,7 +25,7 @@ void dMat_ice_c::create(J3DMaterialTable* param_1, J3DAnmTextureSRTKey* param_2)
mMaterialTable = param_1;
int rt = mBtkAnm.init(mMaterialTable, param_2, TRUE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0);
JUT_ASSERT(98, rt != FALSE);
mBtkAnm.entry(mMaterialTable, mBtkAnm.getFrameCtrl()->getFrame());
mBtkAnm.entry(mMaterialTable);
}
/* 8006F740-8006F780 .text play__10dMat_ice_cFv */