d_a_dmidna OK / f_op + misc cleanup (#276)

* some f_op / d_insect cleanup

* rename some vars according to tww

* d_a_dmidna OK

* remove asm
This commit is contained in:
TakaRikka
2023-02-10 09:07:47 -08:00
committed by GitHub
parent 68f5b6d05a
commit 67a2c83b9b
73 changed files with 5635 additions and 20433 deletions
+92 -89
View File
@@ -22,8 +22,8 @@ fopAc_ac_c::~fopAc_ac_c() {}
static int g_fopAc_type;
/* 80018CE0-80018D0C 013620 002C+00 0/0 12/12 391/391 .text fopAc_IsActor__FPv */
s32 fopAc_IsActor(void* actor) {
return fpcM_IsJustType(g_fopAc_type, ((fopAc_ac_c*)actor)->mAcType);
s32 fopAc_IsActor(void* i_this) {
return fpcM_IsJustType(g_fopAc_type, ((fopAc_ac_c*)i_this)->mAcType);
}
/* ############################################################################################## */
@@ -31,61 +31,64 @@ s32 fopAc_IsActor(void* actor) {
u32 fopAc_ac_c::stopStatus;
/* 80018D0C-80018DD8 01364C 00CC+00 1/0 0/0 0/0 .text fopAc_Draw__FPv */
static int fopAc_Draw(void* actor) {
fopAc_ac_c* ac = (fopAc_ac_c*)actor;
static int fopAc_Draw(void* i_this) {
fopAc_ac_c* _this = (fopAc_ac_c*)i_this;
int ret = 1;
if (!dComIfGp_isPauseFlag()) {
if ((dComIfGp_event_moveApproval(ac) == 2 ||
(!fopAcM_checkStatus(ac, fopAc_ac_c::stopStatus) &&
(!fopAcM_checkStatus(ac, 0x100) || !fopAcM_cullingCheck(ac)))) &&
!fopAcM_checkStatus(ac, 0x21000000))
if ((dComIfGp_event_moveApproval(_this) == 2 ||
(!fopAcM_checkStatus(_this, fopAc_ac_c::stopStatus) &&
(!fopAcM_checkStatus(_this, 0x100) || !fopAcM_cullingCheck(_this)))) &&
!fopAcM_checkStatus(_this, 0x21000000))
{
fopAcM_OffCondition(ac, 4);
ret = fpcLf_DrawMethod((leafdraw_method_class*)ac->mSubMtd, ac);
fopAcM_OffCondition(_this, 4);
ret = fpcLf_DrawMethod((leafdraw_method_class*)_this->mSubMtd, _this);
} else {
fopAcM_OnCondition(ac, 4);
fopAcM_OnCondition(_this, 4);
}
fopAcM_OffStatus(ac, 0x1000000);
fopAcM_OffStatus(_this, 0x1000000);
}
return ret;
}
/* 80018DD8-80018F78 013718 01A0+00 1/0 0/0 0/0 .text fopAc_Execute__FPv */
static int fopAc_Execute(void* actor) {
fopAc_ac_c* ac = (fopAc_ac_c*)actor;
static int fopAc_Execute(void* i_this) {
fopAc_ac_c* _this = (fopAc_ac_c*)i_this;
int ret = 1;
if (!dComIfGp_isPauseFlag() && dScnPly_c::isPause()) {
if (!dComIfA_PauseCheck()) {
daSus_c::check(ac);
ac->mEvtInfo.beforeProc();
s32 move = dComIfGp_event_moveApproval(actor);
fopAcM_OffStatus(ac, 0x40000000);
daSus_c::check(_this);
_this->mEvtInfo.beforeProc();
s32 move = dComIfGp_event_moveApproval(i_this);
fopAcM_OffStatus(_this, 0x40000000);
if (!fopAcM_checkStatus(ac, 0x20000000) &&
(move == 2 || (move != 0 && !fopAcM_checkStatus(ac, fopAc_ac_c::stopStatus) &&
(!fopAcM_checkStatus(ac, 0x80) || !fopAcM_CheckCondition(ac, 4)))))
if (!fopAcM_checkStatus(_this, 0x20000000) &&
(move == 2 ||
(move != 0 && !fopAcM_checkStatus(_this, fopAc_ac_c::stopStatus) &&
(!fopAcM_checkStatus(_this, 0x80) || !fopAcM_CheckCondition(_this, 4)))))
{
fopAcM_OffCondition(ac, 2);
ac->next = ac->current;
ret = fpcMtd_Execute((process_method_class*)ac->mSubMtd, ac);
fopAcM_OffCondition(_this, 2);
_this->next = _this->current;
ret = fpcMtd_Execute((process_method_class*)_this->mSubMtd, _this);
} else {
ac->mEvtInfo.suspendProc(ac);
fopAcM_OnCondition(ac, 2);
_this->mEvtInfo.suspendProc(_this);
fopAcM_OnCondition(_this, 2);
}
if (fopAcM_checkStatus(ac, 0x20) && ac->orig.pos.y - ac->current.pos.y > 5000.0f) {
fopAcM_delete(ac);
if (fopAcM_checkStatus(_this, 0x20) &&
_this->orig.pos.y - _this->current.pos.y > 5000.0f)
{
fopAcM_delete(_this);
}
if (ac->current.pos.y < FLOAT_MIN) {
ac->current.pos.y = FLOAT_MIN;
if (_this->current.pos.y < FLOAT_MIN) {
_this->current.pos.y = FLOAT_MIN;
}
dKy_depth_dist_set(ac);
dKy_depth_dist_set(_this);
}
}
@@ -93,28 +96,28 @@ static int fopAc_Execute(void* actor) {
}
/* 80018F78-80018FCC 0138B8 0054+00 1/0 0/0 0/0 .text fopAc_IsDelete__FPv */
static int fopAc_IsDelete(void* actor) {
fopAc_ac_c* ac = (fopAc_ac_c*)actor;
static int fopAc_IsDelete(void* i_this) {
fopAc_ac_c* _this = (fopAc_ac_c*)i_this;
int isDelete = fpcMtd_IsDelete((process_method_class*)ac->mSubMtd, ac);
int isDelete = fpcMtd_IsDelete((process_method_class*)_this->mSubMtd, _this);
if (isDelete == true) {
fopDwTg_DrawQTo(&ac->mDwTg);
fopDwTg_DrawQTo(&_this->mDwTg);
}
return isDelete;
}
/* 80018FCC-8001904C 01390C 0080+00 1/0 0/0 0/0 .text fopAc_Delete__FPv */
static int fopAc_Delete(void* actor) {
fopAc_ac_c* ac = (fopAc_ac_c*)actor;
static int fopAc_Delete(void* i_this) {
fopAc_ac_c* _this = (fopAc_ac_c*)i_this;
int deleted = fpcMtd_Delete((process_method_class*)ac->mSubMtd, ac);
int deleted = fpcMtd_Delete((process_method_class*)_this->mSubMtd, _this);
if (deleted == true) {
fopAcTg_ActorQTo(&ac->mAcTg);
fopDwTg_DrawQTo(&ac->mDwTg);
fopAcM_DeleteHeap(ac);
fopAcTg_ActorQTo(&_this->mAcTg);
fopDwTg_DrawQTo(&_this->mDwTg);
fopAcM_DeleteHeap(_this);
dDemo_actor_c* demoAc = dDemo_c::getActor(ac->mDemoActorId);
dDemo_actor_c* demoAc = dDemo_c::getActor(_this->mDemoActorId);
if (demoAc != NULL) {
demoAc->setActor(NULL);
}
@@ -124,53 +127,53 @@ static int fopAc_Delete(void* actor) {
}
/* 8001904C-800193FC 01398C 03B0+00 1/0 0/0 0/0 .text fopAc_Create__FPv */
static int fopAc_Create(void* actor) {
fopAc_ac_c* ac = (fopAc_ac_c*)actor;
static int fopAc_Create(void* i_this) {
fopAc_ac_c* _this = (fopAc_ac_c*)i_this;
if (fpcM_IsFirstCreating(actor)) {
if (fpcM_IsFirstCreating(i_this)) {
actor_process_profile_definition* profile =
(actor_process_profile_definition*)fpcM_GetProfile(actor);
ac->mAcType = fpcBs_MakeOfType(&g_fopAc_type);
ac->mSubMtd = (profile_method_class*)profile->mSubMtd;
(actor_process_profile_definition*)fpcM_GetProfile(i_this);
_this->mAcType = fpcBs_MakeOfType(&g_fopAc_type);
_this->mSubMtd = (profile_method_class*)profile->mSubMtd;
fopAcTg_Init(&ac->mAcTg, ac);
fopAcTg_ToActorQ(&ac->mAcTg);
fopDwTg_Init(&ac->mDwTg, ac);
fopAcTg_Init(&_this->mAcTg, _this);
fopAcTg_ToActorQ(&_this->mAcTg);
fopDwTg_Init(&_this->mDwTg, _this);
ac->mStatus = profile->mStatus;
ac->mGroup = profile->mActorType;
ac->mCullType = profile->mCullType;
_this->mStatus = profile->mStatus;
_this->mGroup = profile->mActorType;
_this->mCullType = profile->mCullType;
fopAcM_prm_class* append = fopAcM_GetAppend(ac);
fopAcM_prm_class* append = fopAcM_GetAppend(_this);
if (append != NULL) {
fopAcM_SetParam(ac, append->mParameter);
ac->orig.pos = append->mPos;
ac->orig.angle = append->mAngle;
ac->shape_angle = append->mAngle;
ac->mParentPcId = append->mParentPId;
ac->mSubtype = append->mSubtype;
ac->mScale.set(append->mScale[0] * 0.1f, append->mScale[1] * 0.1f,
append->mScale[2] * 0.1f);
ac->mSetID = append->mEnemyNo;
ac->orig.roomNo = append->mRoomNo;
fopAcM_SetParam(_this, append->mParameter);
_this->orig.pos = append->mPos;
_this->orig.angle = append->mAngle;
_this->shape_angle = append->mAngle;
_this->mParentPcId = append->mParentPId;
_this->mSubtype = append->mSubtype;
_this->mScale.set(append->mScale[0] * 0.1f, append->mScale[1] * 0.1f,
append->mScale[2] * 0.1f);
_this->mSetID = append->mEnemyNo;
_this->orig.roomNo = append->mRoomNo;
}
ac->next = ac->orig;
ac->current = ac->orig;
ac->mEyePos = ac->orig.pos;
ac->mMaxFallSpeed = -100.0f;
ac->mAttentionInfo.field_0x0[0] = 1;
ac->mAttentionInfo.field_0x0[1] = 2;
ac->mAttentionInfo.field_0x0[2] = 3;
ac->mAttentionInfo.field_0x0[3] = 5;
ac->mAttentionInfo.field_0x4[0] = 6;
ac->mAttentionInfo.field_0x4[3] = 14;
ac->mAttentionInfo.field_0x4[1] = 15;
ac->mAttentionInfo.field_0x4[2] = 15;
ac->mAttentionInfo.field_0x8[0] = 51;
ac->mAttentionInfo.mPosition = ac->orig.pos;
ac->mAttentionInfo.field_0xa = 30;
dKy_tevstr_init(&ac->mTevStr, ac->orig.roomNo, -1);
_this->next = _this->orig;
_this->current = _this->orig;
_this->mEyePos = _this->orig.pos;
_this->mMaxFallSpeed = -100.0f;
_this->mAttentionInfo.field_0x0[0] = 1;
_this->mAttentionInfo.field_0x0[1] = 2;
_this->mAttentionInfo.field_0x0[2] = 3;
_this->mAttentionInfo.field_0x0[3] = 5;
_this->mAttentionInfo.field_0x4[0] = 6;
_this->mAttentionInfo.field_0x4[3] = 14;
_this->mAttentionInfo.field_0x4[1] = 15;
_this->mAttentionInfo.field_0x4[2] = 15;
_this->mAttentionInfo.field_0x8[0] = 51;
_this->mAttentionInfo.mPosition = _this->orig.pos;
_this->mAttentionInfo.field_0xa = 30;
dKy_tevstr_init(&_this->mTevStr, _this->orig.roomNo, -1);
int roomNo = dComIfGp_roomControl_getStayNo();
if (roomNo >= 0) {
@@ -178,22 +181,22 @@ static int fopAc_Create(void* actor) {
}
dStage_FileList_dt_c* filelist = NULL;
if (ac->orig.roomNo >= 0) {
if (_this->orig.roomNo >= 0) {
filelist =
dComIfGp_roomControl_getStatusRoomDt(ac->orig.roomNo)->mRoomDt.getFileListInfo();
dComIfGp_roomControl_getStatusRoomDt(_this->orig.roomNo)->mRoomDt.getFileListInfo();
}
if (filelist != NULL) {
if (!dStage_FileList_dt_GetEnemyAppear1Flag(filelist)) {
u32 sw = dStage_FileList_dt_GetBitSw(filelist);
if (sw != 0xFF && dComIfGs_isSwitch(sw, ac->orig.roomNo) &&
if (sw != 0xFF && dComIfGs_isSwitch(sw, _this->orig.roomNo) &&
profile->mActorType == 2)
{
return cPhs_ERROR_e;
}
} else {
u32 sw = dStage_FileList_dt_GetBitSw(filelist);
if (sw != 0xFF && !dComIfGs_isSwitch(sw, ac->orig.roomNo) &&
if (sw != 0xFF && !dComIfGs_isSwitch(sw, _this->orig.roomNo) &&
profile->mActorType == 2)
{
return cPhs_ERROR_e;
@@ -202,12 +205,12 @@ static int fopAc_Create(void* actor) {
}
}
int ret = fpcMtd_Create((process_method_class*)ac->mSubMtd, ac);
int ret = fpcMtd_Create((process_method_class*)_this->mSubMtd, _this);
if (ret == cPhs_COMPLEATE_e) {
s32 priority = fpcLf_GetPriority(ac);
fopDwTg_ToDrawQ(&ac->mDwTg, priority);
s32 priority = fpcLf_GetPriority(_this);
fopDwTg_ToDrawQ(&_this->mDwTg, priority);
} else if (ret == cPhs_ERROR_e) {
fopAcM_OnCondition(ac, 0x10);
fopAcM_OnCondition(_this, 0x10);
}
return ret;