mirror of
https://github.com/zeldaret/tp
synced 2026-08-30 01:20:14 -04:00
msg documentation
This commit is contained in:
+44
-8
@@ -4,6 +4,7 @@
|
||||
//
|
||||
|
||||
#include "f_op/f_op_msg.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include "d/msg/d_msg_class.h"
|
||||
#include "d/s/d_s_play.h"
|
||||
#include "dol2asm.h"
|
||||
@@ -42,7 +43,7 @@ extern "C" void fpcMtd_Create__FP20process_method_classPv();
|
||||
/* 8001F488-8001F4B0 019DC8 0028+00 1/0 0/0 0/0 .text fopMsg_Draw__FPv */
|
||||
static int fopMsg_Draw(void* msg) {
|
||||
msg_class* m = static_cast<msg_class*>(msg);
|
||||
return fpcLf_DrawMethod(m->field_0xd8, msg);
|
||||
return fpcLf_DrawMethod(m->mSubMtd, msg);
|
||||
}
|
||||
|
||||
/* 8001F4B0-8001F4E8 019DF0 0038+00 1/0 0/0 0/0 .text fopMsg_Execute__FPv */
|
||||
@@ -51,7 +52,7 @@ static int fopMsg_Execute(void* msg) {
|
||||
|
||||
int stat = 1;
|
||||
if (dScnPly_c::isPause()) {
|
||||
stat = fpcMtd_Execute(&m->field_0xd8->mBase, msg);
|
||||
stat = fpcMtd_Execute(&m->mSubMtd->mBase, msg);
|
||||
}
|
||||
|
||||
return stat;
|
||||
@@ -61,9 +62,9 @@ static int fopMsg_Execute(void* msg) {
|
||||
static int fopMsg_IsDelete(void* msg) {
|
||||
msg_class* m = static_cast<msg_class*>(msg);
|
||||
|
||||
int stat = fpcMtd_IsDelete(&m->field_0xd8->mBase, msg);
|
||||
int stat = fpcMtd_IsDelete(&m->mSubMtd->mBase, msg);
|
||||
if (stat == 1) {
|
||||
fopDwTg_DrawQTo(&m->field_0xc4);
|
||||
fopDwTg_DrawQTo(&m->mDwTg);
|
||||
}
|
||||
|
||||
return stat;
|
||||
@@ -73,8 +74,8 @@ static int fopMsg_IsDelete(void* msg) {
|
||||
static int fopMsg_Delete(void* msg) {
|
||||
msg_class* m = static_cast<msg_class*>(msg);
|
||||
|
||||
int stat = fpcMtd_Delete(&m->field_0xd8->mBase, msg);
|
||||
fopDwTg_DrawQTo(&m->field_0xc4);
|
||||
int stat = fpcMtd_Delete(&m->mSubMtd->mBase, msg);
|
||||
fopDwTg_DrawQTo(&m->mDwTg);
|
||||
|
||||
return stat;
|
||||
}
|
||||
@@ -84,6 +85,36 @@ static int fopMsg_Delete(void* msg) {
|
||||
static int fopMsg_MSG_TYPE;
|
||||
|
||||
/* 8001F588-8001F660 019EC8 00D8+00 1/0 0/0 0/0 .text fopMsg_Create__FPv */
|
||||
#if defined NON_MATCHING
|
||||
int fopMsg_Create(void* data) {
|
||||
// r31 / r30 swap
|
||||
msg_class *msg = (msg_class*)data;
|
||||
|
||||
if (fpcM_IsFirstCreating(msg)) {
|
||||
// TODO: This should be msg_process_profile_definition
|
||||
leaf_process_profile_definition* profile = (leaf_process_profile_definition*) fpcM_GetProfile(msg);
|
||||
msg->mMsgType = fpcBs_MakeOfType(&fopMsg_MSG_TYPE);
|
||||
msg->mSubMtd = profile->mMethods;
|
||||
fopDwTg_Init(&msg->mDwTg, msg);
|
||||
fopMsg_prm_class * prm = fopMsgM_GetAppend(msg);
|
||||
if (prm != NULL) {
|
||||
msg->mpActor = prm->mpActor;
|
||||
msg->mPos = prm->mPos;
|
||||
msg->mMsgID = prm->mMsgID;
|
||||
msg->field_0xf0 = prm->field_0x14;
|
||||
msg->field_0xf4 = prm->field_0x18;
|
||||
}
|
||||
}
|
||||
|
||||
int status = fpcMtd_Create(&msg->mSubMtd->mBase, msg);
|
||||
if (status == cPhs_COMPLEATE_e) {
|
||||
s32 priority = fpcLf_GetPriority(msg);
|
||||
fopDwTg_ToDrawQ(&msg->mDwTg, priority);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -92,9 +123,14 @@ static asm int fopMsg_Create(void* param_0) {
|
||||
#include "asm/f_op/f_op_msg/fopMsg_Create__FPv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803A3958-803A3970 -00001 0014+04 0/0 5/0 0/0 .data g_fopMsg_Method */
|
||||
SECTION_DATA extern leafdraw_method_class g_fopMsg_Method = {
|
||||
&fopMsg_Create, &fopMsg_Delete, &fopMsg_Execute, &fopMsg_IsDelete, &fopMsg_Draw,
|
||||
leafdraw_method_class g_fopMsg_Method = {
|
||||
(process_method_func) fopMsg_Create,
|
||||
(process_method_func) fopMsg_Delete,
|
||||
(process_method_func) fopMsg_Execute,
|
||||
(process_method_func) fopMsg_IsDelete,
|
||||
(process_method_func) fopMsg_Draw,
|
||||
};
|
||||
|
||||
+27
-27
@@ -65,7 +65,7 @@ SECTION_SDATA2 static u8 lit_3902[4] = {
|
||||
|
||||
/* 8001FA6C-8001FB50 01A3AC 00E4+00 1/1 0/0 0/0 .text createAppend__FP10fopAc_ac_cP4cXyzPUlPUlUi
|
||||
*/
|
||||
static fopMsg_prm_class* createAppend(fopAc_ac_c* param_0, cXyz* param_1, u32* param_2,
|
||||
static fopMsg_prm_class* createAppend(fopAc_ac_c* pActor, cXyz* pPos, u32* pMsgID,
|
||||
u32* param_3, unsigned int param_4) {
|
||||
fopMsg_prm_class* params =
|
||||
static_cast<fopMsg_prm_class*>(cMl::memalignB(-4, sizeof(fopMsg_prm_class)));
|
||||
@@ -74,23 +74,23 @@ static fopMsg_prm_class* createAppend(fopAc_ac_c* param_0, cXyz* param_1, u32* p
|
||||
return NULL;
|
||||
}
|
||||
|
||||
params->field_0x0 = param_0;
|
||||
dMsgObject_setTalkActor(param_0);
|
||||
params->mpActor = pActor;
|
||||
dMsgObject_setTalkActor(pActor);
|
||||
|
||||
if (param_2 != NULL) {
|
||||
params->field_0x10 = *param_2;
|
||||
if (pMsgID != NULL) {
|
||||
params->mMsgID = *pMsgID;
|
||||
}
|
||||
|
||||
if (param_3 != NULL) {
|
||||
params->field_0x14 = *param_3;
|
||||
}
|
||||
|
||||
if (param_1 != NULL) {
|
||||
params->field_0x4 = *param_1;
|
||||
if (pPos != NULL) {
|
||||
params->mPos = *pPos;
|
||||
} else {
|
||||
f32 tmp_0 = FLOAT_LABEL(lit_3902);
|
||||
cXyz tmp(tmp_0, tmp_0, tmp_0);
|
||||
params->field_0x4 = tmp;
|
||||
params->mPos = tmp;
|
||||
}
|
||||
|
||||
params->field_0x18 = param_4;
|
||||
@@ -188,11 +188,11 @@ int fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_actorP, u32 param_2) {
|
||||
|
||||
dMsgObject_c* msg = (dMsgObject_c*)fopMsgM_SearchByID(i_msgID);
|
||||
|
||||
if (msg && msg->field_0xf8 == 1) {
|
||||
msg->field_0xe0.set(pos);
|
||||
msg->field_0xec = i_msgIdx;
|
||||
if (msg && msg->mMode == 1) {
|
||||
msg->mPos.set(pos);
|
||||
msg->mMsgID = i_msgIdx;
|
||||
msg->field_0xf0 = param_2;
|
||||
msg->field_0xdc = i_actorP;
|
||||
msg->mpActor = i_actorP;
|
||||
msg->setMessageIndex(i_msgIdx,param_2,false);
|
||||
return i_msgID;
|
||||
} else {
|
||||
@@ -202,7 +202,7 @@ int fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_actorP, u32 param_2) {
|
||||
}
|
||||
|
||||
/* 8001FE84-8001FFC4 01A7C4 0140+00 0/0 6/6 4/4 .text fopMsgM_messageSet__FUlUl */
|
||||
int fopMsgM_messageSet(u32 param_0, u32 param_1) {
|
||||
int fopMsgM_messageSet(u32 msgIdx, u32 param_1) {
|
||||
if (dComIfGp_isHeapLockFlag() == 8) {
|
||||
dMeter2Info_getMeterClass()->emphasisButtonDelete();
|
||||
}
|
||||
@@ -223,21 +223,21 @@ int fopMsgM_messageSet(u32 param_0, u32 param_1) {
|
||||
dMsgObject_c* msg = (dMsgObject_c*)fopMsgM_SearchByID(i_msgID);
|
||||
|
||||
if (msg) {
|
||||
if (msg->field_0xf8 == 1) {
|
||||
msg->field_0xe0.set(pos);
|
||||
msg->field_0xec = param_0;
|
||||
if (msg->mMode == 1) {
|
||||
msg->mPos.set(pos);
|
||||
msg->mMsgID = msgIdx;
|
||||
msg->field_0xf0 = param_1;
|
||||
msg->field_0xdc = 0;
|
||||
msg->setTalkPartner(0);
|
||||
msg->setMessageIndex(param_0,param_1,false);
|
||||
msg->mpActor = NULL;
|
||||
msg->setTalkPartner(NULL);
|
||||
msg->setMessageIndex(msgIdx,param_1,false);
|
||||
return i_msgID;
|
||||
}
|
||||
|
||||
if (msg->field_0xf8 == 15) {
|
||||
msg->field_0xe0.set(pos);
|
||||
msg->field_0xec = param_0;
|
||||
if (msg->mMode == 15) {
|
||||
msg->mPos.set(pos);
|
||||
msg->mMsgID = msgIdx;
|
||||
msg->field_0xf0 = param_1;
|
||||
msg->field_0xdc = 0;
|
||||
msg->mpActor = NULL;
|
||||
return i_msgID;
|
||||
}
|
||||
}
|
||||
@@ -267,11 +267,11 @@ int fopMsgM_messageSetDemo(u32 param_0) {
|
||||
|
||||
dMsgObject_c* msg = (dMsgObject_c*)fopMsgM_SearchByID(i_msgID);
|
||||
|
||||
if (msg && msg->field_0xf8 == 1) {
|
||||
msg->field_0xe0.set(pos);
|
||||
msg->field_0xec = param_0;
|
||||
if (msg && msg->mMode == 1) {
|
||||
msg->mPos.set(pos);
|
||||
msg->mMsgID = param_0;
|
||||
msg->field_0xf0 = 1000;
|
||||
msg->field_0xdc = 0;
|
||||
msg->mpActor = NULL;
|
||||
msg->setMessageIndexDemo(param_0,false);
|
||||
return i_msgID;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user