summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristopher Early <1191258+MrPolymorph@users.noreply.github.com>2023-10-07 22:19:58 +0100
committerKristopher Early <1191258+MrPolymorph@users.noreply.github.com>2023-10-11 14:30:47 +0100
commit39b015ff68192e56784bc31ea66255b5e89dfde6 (patch)
treee8ce5f48b3a18263247503535bbeb0c5100fbaf9 /src
parent89b0b1eb0bf0d0475fe18ddb18202e9d747f77a9 (diff)
99.157% match
Diffstat (limited to 'src')
-rw-r--r--src/d/actor/d_a_tag_msg.cpp342
1 files changed, 285 insertions, 57 deletions
diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp
index 461f5ded..0b7cd53e 100644
--- a/src/d/actor/d_a_tag_msg.cpp
+++ b/src/d/actor/d_a_tag_msg.cpp
@@ -2,102 +2,330 @@
// Generated by dtk
// Translation Unit: d_a_tag_msg.cpp
//
+#include "JSystem/JKernel/JKRHeap.h"
+#include "d/actor/d_a_player_link.h"
+#include "d/d_procname.h"
-#include "d_a_tag_msg.h"
-#include "dolphin/types.h"
+struct daTag_Msg_c : public fopAc_ac_c {
+public:
+ u32 getEventNo();
+ u32 getSwbit();
+ u32 getSwbit2();
+ u32 getType2();
+ const char* myDemoName();
+ u16 getMessage();
+ u16 getEventFlag();
+ s32 arrivalTerms();
+ int rangeCheck();
+ int otherCheck();
-/* 00000078-00000084 .text getEventNo__11daTag_Msg_cFv */
-void daTag_Msg_c::getEventNo() {
- /* Nonmatching */
+ inline s32 execute();
+ inline s32 create();
+public:
+ /* 0x00 */ u8 mAction;
+ /* 0x01 */ u8 field_0x291;
+ /* 0x02 */ u8 field_0x292;
+ /* 0x03 */ u8 field_0x293;
+}; // Size = 0x294
+
+u8 bss_3569;
+u8 bss_1036;
+u8 bss_1034;
+u8 bss_1032;
+u8 bss_1031;
+u8 bss_1026;
+u8 bss_1024;
+u8 bss_1022;
+u8 bss_1021;
+u8 bss_984;
+u8 bss_982;
+u8 bss_980;
+u8 bss_979;
+u8 bss_941;
+u8 bss_939;
+u8 bss_937;
+u32 bss_936[15];
+u32 l_msgId;
+msg_class* l_msg;
+u8 msg_mode;
+
+u32 daTag_Msg_c::getEventNo() {
+ return mBase.mParameters >> 0x18;
}
-/* 00000084-00000090 .text getSwbit__11daTag_Msg_cFv */
-void daTag_Msg_c::getSwbit() {
- /* Nonmatching */
+u32 daTag_Msg_c::getSwbit() {
+ return mBase.mParameters >> 8 & 0xff;
}
-/* 00000090-0000009C .text getSwbit2__11daTag_Msg_cFv */
-void daTag_Msg_c::getSwbit2() {
- /* Nonmatching */
+u32 daTag_Msg_c::getSwbit2() {
+ return mBase.mParameters >> 0x10 & 0xff;
}
-/* 0000009C-000000A8 .text getType2__11daTag_Msg_cFv */
-void daTag_Msg_c::getType2() {
- /* Nonmatching */
+u32 daTag_Msg_c::getType2() {
+ return mBase.mParameters >> 6 & 3;
}
-/* 000000A8-0000015C .text myDemoName__11daTag_Msg_cFv */
-void daTag_Msg_c::myDemoName() {
- /* Nonmatching */
+const char* daTag_Msg_c::myDemoName() {
+ dStage_EventInfo_c *pEventInfo;
+ u32 eventNo;
+
+ pEventInfo = dComIfGp_getStageEventInfo();
+ eventNo = getEventNo() & 0xff;
+
+ if (getMessage() == 0x1902) {
+ return "RT_TALK";
+ }
+ if (pEventInfo == NULL || (int)eventNo == 0xff || pEventInfo->field_0x0 < (int)eventNo) {
+ return "DEFAULT_MSG";
+ }
+ return pEventInfo->mName + eventNo * 0x18 + 1;
}
-/* 0000015C-00000168 .text getMessage__11daTag_Msg_cFv */
-void daTag_Msg_c::getMessage() {
- /* Nonmatching */
+u16 daTag_Msg_c::getMessage() {
+ return orig.angle.x;
}
-/* 00000168-00000174 .text getEventFlag__11daTag_Msg_cFv */
-void daTag_Msg_c::getEventFlag() {
- /* Nonmatching */
+u16 daTag_Msg_c::getEventFlag() {
+ return orig.angle.z;
}
-/* 00000174-0000021C .text arrivalTerms__11daTag_Msg_cFv */
-void daTag_Msg_c::arrivalTerms() {
- /* Nonmatching */
+s32 daTag_Msg_c::arrivalTerms() {
+ int swBit;
+ u16 eventFlag;
+ swBit = (int)(getSwbit2() & 0xFF);
+ eventFlag = getEventFlag();
+ if ((s32)swBit != 0xff && dComIfGs_isSwitch(swBit, current.roomNo) == 0) {
+ return 0;
+ }
+ else if (eventFlag != 0xffff && dComIfGs_isEventBit(eventFlag) == 0) {
+ return 0;
+ }
+ else {
+ return 1;
+ }
}
/* 0000021C-000002FC .text rangeCheck__11daTag_Msg_cFv */
-void daTag_Msg_c::rangeCheck() {
- /* Nonmatching */
+int daTag_Msg_c::rangeCheck() {
+ daPy_lk_c* link;
+ cXyz diff;
+ cXyz local_38;
+
+ link = daPy_getPlayerLinkActorClass();
+ diff = link->current.pos - current.pos;
+
+ if (diff.y < 0.0f) {
+ local_38.y = -diff.y;
+ }
+ local_38.x = diff.x;
+ local_38.y = 0.0f;
+ local_38.z = diff.z;
+ if (PSVECSquareMag(&local_38) < mScale.x * mScale.x * 10000.0f) {
+ if(diff.y <= mScale.y * 100.0f) {
+ return 1;
+ }
+ }
+ return 0;
}
-/* 000002FC-0000041C .text otherCheck__11daTag_Msg_cFv */
-void daTag_Msg_c::otherCheck() {
- /* Nonmatching */
+int daTag_Msg_c::otherCheck() {
+ daPy_lk_c *player;
+ short diff;
+ short actorAngle;
+
+ actorAngle = fopAcM_searchActorAngleY(this, daPy_getPlayerActorClass());
+ player = daPy_getPlayerLinkActorClass();
+ if ((getType2() & 1) != 0) {
+ return 1;
+ }
+ JUT_ASSERT(0xC8, player);
+ if (getMessage() == 0x1902) {
+ diff = (short)(actorAngle - this->orig.angle.y);
+ if (diff < 0) {
+ diff = -diff;
+ }
+ if (0x3000 < diff) {
+ return 0;
+ }
+ }
+ actorAngle = (short)(actorAngle + 0x7fff) - player->current.angle.y;
+ if (actorAngle < 0) {
+ actorAngle = (short)-actorAngle;
+ }
+ if (actorAngle > 0x1000) {
+ return 0;
+ }
+
+ return 1;
}
-/* 0000041C-0000065C .text daTag_Msg_actionEvent__FP11daTag_Msg_c */
-void daTag_Msg_actionEvent(daTag_Msg_c*) {
- /* Nonmatching */
+static s32 daTag_Msg_actionEvent(daTag_Msg_c* a_this) {
+ int message = a_this->getMessage();
+ switch (msg_mode / 1) {
+ case 0:
+ if (dComIfGp_checkCameraAttentionStatus(dComIfGp_getPlayerCameraID(0), 4)) {
+ msg_mode++;
+ }
+ break;
+ case 1:
+ l_msgId = fopMsgM_messageSet(message, &a_this->mAttentionInfo.mPosition);
+ if (l_msgId != 0xffffffff) {
+ msg_mode++;
+ }
+ break;
+ case 2:
+ l_msg = fopMsgM_SearchByID(l_msgId);
+ if (l_msg != NULL) {
+ msg_mode++;
+ }
+ break;
+ case 3:
+ JUT_ASSERT(0x13F, l_msg);
+ if (l_msg->mMode == 6) {
+ msg_mode++;
+ }
+ break;
+ case 4:
+ JUT_ASSERT(0x145, l_msg);
+ if (l_msg->mMode == 0xe) {
+ msg_mode++;
+ l_msg->mMode = 0x10;
+ }
+ break;
+ }
+ if (l_msg != NULL && l_msg->mMode == 0x12) {
+ l_msg->mMode = 0x13;
+ dComIfGp_event_onEventFlag(8);
+ if (a_this->getMessage() == 0x1902) {
+ daPy_getPlayerLinkActorClass()->mNoResetFlg0 &= 0xf7ffffff;
+ }
+ if (a_this->getType2() & 1) {
+ a_this->mAction = 0;
+ } else {
+ a_this->mAction = 2;
+ }
+ }
+ return 1;
}
-/* 0000065C-00000754 .text daTag_Msg_actionHunt__FP11daTag_Msg_c */
-void daTag_Msg_actionHunt(daTag_Msg_c*) {
- /* Nonmatching */
+static s32 daTag_Msg_actionHunt(daTag_Msg_c* a_this) {
+ u8 swBit;
+
+ if (a_this->mEvtInfo.mCommand == dEvtCmd_INTALK_e) {
+ a_this->mAction = 3;
+ swBit = a_this->getSwbit();
+ if ((swBit & 0xff) != 0xff) {
+ dComIfGs_onSwitch(swBit,a_this->current.roomNo);
+ }
+ l_msgId = 0xffffffff;
+ l_msg = 0;
+ msg_mode = 0;
+ if ((u32)a_this->getMessage() == 0x1902) {
+ daPy_getPlayerLinkActorClass()->mNoResetFlg0 |= 0x8000000;
+ }
+ } else if (a_this->rangeCheck() != 0 && a_this->otherCheck() != 0) {
+ if ((a_this->getType2() & 1) != 0) {
+ fopAcM_orderSpeakEvent(a_this);
+ }
+ a_this->mEvtInfo.mCondition |= dEvtCnd_CANTALK_e;
+ }
+ return 1;
}
/* 00000754-000007B0 .text daTag_Msg_actionArrival__FP11daTag_Msg_c */
-void daTag_Msg_actionArrival(daTag_Msg_c*) {
- /* Nonmatching */
+static s32 daTag_Msg_actionArrival(daTag_Msg_c* a_this) {
+ char *cutsceneName;
+
+ if (a_this->arrivalTerms() != 0) {
+ cutsceneName = (char*)a_this->myDemoName();
+ a_this->mEvtInfo.setEventName(cutsceneName);
+ a_this->mAction = 2;
+ daTag_Msg_actionHunt(a_this);
+ }
+ return 1;
+}
+
+static s32 daTag_Msg_actionWait(daTag_Msg_c*) {
+ return true;
}
-/* 000007B0-000007B8 .text daTag_Msg_actionWait__FP11daTag_Msg_c */
-void daTag_Msg_actionWait(daTag_Msg_c*) {
- /* Nonmatching */
+static s32 daTag_Msg_Draw(daTag_Msg_c*) {
+ return true;
}
-/* 000007B8-000007C0 .text daTag_Msg_Draw__FP11daTag_Msg_c */
-void daTag_Msg_Draw(daTag_Msg_c*) {
- /* Nonmatching */
+s32 daTag_Msg_c::execute() {
+ static s32 (*l_action[4])(daTag_Msg_c*) = {
+ daTag_Msg_actionEvent,
+ daTag_Msg_actionHunt,
+ daTag_Msg_actionArrival,
+ daTag_Msg_actionWait
+ };
+ l_action[mAction](this);
+ return 1;
}
-/* 000007C0-000007FC .text daTag_Msg_Execute__FP11daTag_Msg_c */
-void daTag_Msg_Execute(daTag_Msg_c*) {
- /* Nonmatching */
+s32 daTag_Msg_c::create() {
+ int swBit;
+ fopAcM_SetupActor(this, daTag_Msg_c);
+ swBit = (int)(getSwbit() & 0xFF);
+ if ((getMessage() == 0x9c5) && dComIfGs_isEventBit(0x502)) {
+ mAction = 0;
+ } else if ((s32)swBit != 0xff && dComIfGs_isSwitch(swBit, current.roomNo) != 0) {
+ mAction = 0;
+ } else {
+ mAction = 1;
+ }
+ shape_angle.z = 0;
+ shape_angle.x = 0;
+ current.angle.z = 0;
+ current.angle.x = 0;
+ mAttentionInfo.mFlags = 0x20000008;
+ if (getMessage() != 0x836) {
+ mAttentionInfo.mPosition.y += 150;
+ mEyePos.y += 150.0f;
+ }
+ return 4;
}
-/* 000007FC-00000804 .text daTag_Msg_IsDelete__FP11daTag_Msg_c */
-void daTag_Msg_IsDelete(daTag_Msg_c*) {
- /* Nonmatching */
+static s32 daTag_Msg_Execute(daTag_Msg_c* a_this) {
+ return a_this->execute();
}
-/* 00000804-00000834 .text daTag_Msg_Delete__FP11daTag_Msg_c */
-void daTag_Msg_Delete(daTag_Msg_c*) {
- /* Nonmatching */
+static s32 daTag_Msg_IsDelete(daTag_Msg_c*) {
+ return true;
}
-/* 00000834-00000964 .text daTag_Msg_Create__FP10fopAc_ac_c */
-void daTag_Msg_Create(fopAc_ac_c*) {
- /* Nonmatching */
+static BOOL daTag_Msg_Delete(daTag_Msg_c* a_this) {
+ a_this->~daTag_Msg_c();
+ return true;
}
+static s32 daTag_Msg_Create(fopAc_ac_c* i_this) {
+ daTag_Msg_c* a_this = (daTag_Msg_c*)i_this;
+ return a_this->create();
+}
+
+static actor_method_class l_daTag_msg_Method = {
+ (process_method_func)daTag_Msg_Create,
+ (process_method_func)daTag_Msg_Delete,
+ (process_method_func)daTag_Msg_Execute,
+ (process_method_func)daTag_Msg_IsDelete,
+ (process_method_func)daTag_Msg_Draw,
+};
+
+extern actor_process_profile_definition g_profile_TAG_MSG = {
+ fpcLy_CURRENT_e,
+ 7,
+ fpcPi_CURRENT_e,
+ PROC_TAG_MSG,
+ &g_fpcLf_Method.mBase,
+ sizeof(daTag_Msg_c),
+ 0,
+ 0,
+ &g_fopAc_Method.base,
+ 0x0121,
+ &l_daTag_msg_Method,
+ fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
+ fopAc_ACTOR_e,
+ fopAc_CULLBOX_6_e,
+}; \ No newline at end of file