summaryrefslogtreecommitdiff
path: root/rel
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2024-04-15 17:39:47 -0700
committerGitHub <noreply@github.com>2024-04-15 18:39:47 -0600
commita0a5d6b00a6fb0e0b88c5176b3ae307d194acff2 (patch)
treec7032a9f2ca3db0b8db2f4fcc2f8be6b9fe1c78f /rel
parentae4ef8e69d9d0029010b432a7e3040be55fd5351 (diff)
d_a_tag_event / d_a_tag_chkpoint done (#2133)
* cleanup evtarea * d_a_tag_chkpoint done * d_a_tag_event done * remove asm
Diffstat (limited to 'rel')
-rw-r--r--rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint.cpp271
-rw-r--r--rel/d/a/tag/d_a_tag_event/d_a_tag_event.cpp640
-rw-r--r--rel/d/a/tag/d_a_tag_evtarea/d_a_tag_evtarea.cpp277
3 files changed, 491 insertions, 697 deletions
diff --git a/rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint.cpp b/rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint.cpp
index d798bf3c77..1b531c123b 100644
--- a/rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint.cpp
+++ b/rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint.cpp
@@ -1,262 +1,113 @@
/**
* d_a_tag_chkpoint.cpp
- *
+ *
*/
#include "rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint.h"
-#include "dol2asm.h"
+#include "cmath.h"
#include "d/a/d_a_player.h"
-//
-// Forward References:
-//
-
-extern "C" void execute__11daTag_Chk_cFv();
-extern "C" static bool daTag_Chk_Draw__FP11daTag_Chk_c();
-extern "C" static void daTag_Chk_Execute__FP11daTag_Chk_c();
-extern "C" static bool daTag_Chk_IsDelete__FP11daTag_Chk_c();
-extern "C" static void daTag_Chk_Delete__FP11daTag_Chk_c();
-extern "C" static void daTag_Chk_Create__FP10fopAc_ac_c();
-// extern "C" extern void* g_profile_TAG_CHKPOINT[12];
-
-//
-// External References:
-//
-
-extern "C" void __ct__10fopAc_ac_cFv();
-extern "C" void __dt__10fopAc_ac_cFv();
-extern "C" void isSwitch__10dSv_info_cCFii();
-extern "C" void setLookPos__9daPy_py_cFP4cXyz();
-extern "C" void _savegpr_29();
-extern "C" void _restgpr_29();
-
-//
-// Declarations:
-//
-
-/* ############################################################################################## */
-/* 8048AC28-8048AC34 000000 0009+03 2/2 0/0 0/0 .rodata @3769 */
-SECTION_RODATA static u8 const lit_3769[9 + 3 /* padding */] = {
- 0x01,
- 0x01,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x01,
- 0x01,
- 0x00,
- /* padding */
- 0x00,
- 0x00,
- 0x00,
-};
-COMPILER_STRIP_GATE(0x8048AC28, &lit_3769);
-
-/* 8048AC34-8048AC38 00000C 0004+00 0/2 0/0 0/0 .rodata @3843 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_3843[4] = {
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-};
-COMPILER_STRIP_GATE(0x8048AC34, &lit_3843);
-#pragma pop
-
-/* 8048AC38-8048AC40 000010 0008+00 0/1 0/0 0/0 .rodata @3844 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_3844[8] = {
- 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x8048AC38, &lit_3844);
-#pragma pop
+/* 8048A6F8-8048A9EC 000078 02F4+00 1/1 0/0 0/0 .text execute__11daTag_Chk_cFv */
+int daTag_Chk_c::execute() {
+ if (fopAcM_GetRoomNo(this) != dComIfGp_roomControl_getStayNo()) {
+ return 0;
+ }
-/* 8048AC40-8048AC48 000018 0008+00 0/1 0/0 0/0 .rodata @3845 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_3845[8] = {
- 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x8048AC40, &lit_3845);
-#pragma pop
+ u8 sp64[3][3] = {
+ {1, 1, 0},
+ {0, 0, 0},
+ {1, 1, 0},
+ };
+
+ int var_r27;
+ int var_r26;
+
+ u8 swbit = getSwBit();
+ if (swbit == 0xFF) {
+ var_r27 = 0;
+ } else if (dComIfGs_isSwitch(swbit, fopAcM_GetRoomNo(this))) {
+ var_r27 = 1;
+ } else {
+ var_r27 = 2;
+ }
-/* 8048AC48-8048AC50 000020 0008+00 0/1 0/0 0/0 .rodata @3846 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_3846[8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x8048AC48, &lit_3846);
-#pragma pop
+ u8 swbit2 = getSwBit2();
+ if (swbit2 == 0xFF) {
+ var_r26 = 0;
+ } else if (dComIfGs_isSwitch(swbit2, fopAcM_GetRoomNo(this))) {
+ var_r26 = 1;
+ } else {
+ var_r26 = 2;
+ }
-/* 8048A6F8-8048A9EC 000078 02F4+00 1/1 0/0 0/0 .text execute__11daTag_Chk_cFv */
-#ifdef NONMATCHING
-// still lots wrong here
-s32 daTag_Chk_c::execute() {
- int iVar12;
- bool bVar6;
- u32 local_64;
- u32 local_60;
- u32 local_5c;
+ bool set_attention = false;
- s32 l_roomNo = fopAcM_GetRoomNo(this);
- s32 l_stayNo = dComIfGp_roomControl_getStayNo();
+ if (sp64[var_r27][var_r26] != 0) {
+ cXyz& player_pos = dComIfGp_getLinkPlayer()->current.pos;
- if (l_roomNo == l_stayNo) {
- local_64 = 0x1010000;
- local_60 = 0x101;
- local_5c = 0;
-
- u8 l_swBit = getSwBit();
- if (l_swBit == -1) {
- l_stayNo = 0;
- } else {
- l_roomNo = fopAcM_GetRoomNo(this);
- l_stayNo = dComIfGs_isSwitch(l_swBit,l_roomNo);
-
- if (l_stayNo == 0) {
- l_stayNo = 2;
- } else {
- l_stayNo = 1;
+ if (getAreaType() == 0) {
+ if (mVtxA.x <= player_pos.x && player_pos.x <= mVtxB.x && mVtxA.y <= player_pos.y &&
+ player_pos.y <= mVtxB.y && mVtxA.z <= player_pos.z && player_pos.z <= mVtxB.z)
+ {
+ set_attention = true;
}
- }
-
- l_swBit = getSwBit2();
-
- if (l_swBit == -1) {
- iVar12 = 0;
} else {
- l_roomNo = fopAcM_GetRoomNo(this);
- l_stayNo = dComIfGs_isSwitch(l_swBit,l_roomNo);
+ f32 x_dist = current.pos.x - player_pos.x;
+ f32 z_dist = current.pos.z - player_pos.z;
- if (l_stayNo == 0) {
- l_stayNo = 2;
- } else {
- l_stayNo = 1;
+ if (std::sqrt(x_dist * x_dist + z_dist * z_dist) < scale.x && mVtxA.y <= player_pos.y &&
+ player_pos.y <= mVtxB.y)
+ {
+ set_attention = true;
}
}
+ }
- bVar6 = false;
-
- if (true) {
- daPy_py_c* link = dComIfGp_getLinkPlayer();
- u16 areaType = getAreaType();
- }
-
- attention_info.flags = 0;
+ attention_info.flags = 0;
- if (bVar6) {
- daPy_py_c::setLookPos(&attention_info.position);
- attention_info.flags = 0x1000;
- }
-
- return 1;
+ if (set_attention) {
+ daPy_getPlayerActorClass()->setLookPos(&attention_info.position);
+ attention_info.flags = 0x100;
}
- return 0;
-}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm s32 daTag_Chk_c::execute() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint/execute__11daTag_Chk_cFv.s"
+
+ return 1;
}
-#pragma pop
-#endif
/* 8048A9EC-8048A9F4 00036C 0008+00 1/0 0/0 0/0 .text daTag_Chk_Draw__FP11daTag_Chk_c */
-static s32 daTag_Chk_Draw(daTag_Chk_c* i_this) {
+static int daTag_Chk_Draw(daTag_Chk_c* i_this) {
return 1;
}
/* 8048A9F4-8048AA18 000374 0024+00 1/0 0/0 0/0 .text daTag_Chk_Execute__FP11daTag_Chk_c
*/
-static s32 daTag_Chk_Execute(daTag_Chk_c* i_this) {
+static int daTag_Chk_Execute(daTag_Chk_c* i_this) {
i_this->execute();
return 1;
}
/* 8048AA18-8048AA20 000398 0008+00 1/0 0/0 0/0 .text daTag_Chk_IsDelete__FP11daTag_Chk_c
*/
-static s32 daTag_Chk_IsDelete(daTag_Chk_c* i_this) {
+static int daTag_Chk_IsDelete(daTag_Chk_c* i_this) {
return 1;
}
/* 8048AA20-8048AA50 0003A0 0030+00 1/0 0/0 0/0 .text daTag_Chk_Delete__FP11daTag_Chk_c
*/
-static s32 daTag_Chk_Delete(daTag_Chk_c* i_this) {
+static int daTag_Chk_Delete(daTag_Chk_c* i_this) {
i_this->~daTag_Chk_c();
return 1;
}
-/* ############################################################################################## */
-/* 8048AC50-8048AC54 000028 0004+00 0/1 0/0 0/0 .rodata @3925 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3925 = 50.0f;
-COMPILER_STRIP_GATE(0x8048AC50, &lit_3925);
-#pragma pop
-
-/* 8048AC54-8048AC58 00002C 0004+00 0/1 0/0 0/0 .rodata @3926 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3926 = 100.0f;
-COMPILER_STRIP_GATE(0x8048AC54, &lit_3926);
-#pragma pop
-
-/* 8048AC58-8048AC5C 000030 0004+00 0/1 0/0 0/0 .rodata @3927 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3927 = 10.0f;
-COMPILER_STRIP_GATE(0x8048AC58, &lit_3927);
-#pragma pop
-
-/* 8048AC5C-8048AC60 000034 0004+00 0/1 0/0 0/0 .rodata @3928 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3928 = 0.5f;
-COMPILER_STRIP_GATE(0x8048AC5C, &lit_3928);
-#pragma pop
-
-/* 8048AC60-8048AC68 000038 0008+00 0/1 0/0 0/0 .rodata @3930 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_3930[8] = {
- 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x8048AC60, &lit_3930);
-#pragma pop
-
/* 8048AA50-8048AC20 0003D0 01D0+00 1/0 0/0 0/0 .text daTag_Chk_Create__FP10fopAc_ac_c */
-#ifdef NONMATCHING
-// literals
-static s32 daTag_Chk_Create(fopAc_ac_c* i_this) {
+static int daTag_Chk_Create(fopAc_ac_c* i_this) {
return static_cast<daTag_Chk_c*>(i_this)->create();
}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm s32 daTag_Chk_Create(fopAc_ac_c* i_this) {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_chkpoint/d_a_tag_chkpoint/daTag_Chk_Create__FP10fopAc_ac_c.s"
-}
-#pragma pop
-#endif
-/* ############################################################################################## */
/* 8048AC68-8048AC88 -00001 0020+00 1/0 0/0 0/0 .data l_daTag_Chk_Method */
static actor_method_class l_daTag_Chk_Method = {
- (process_method_func)daTag_Chk_Create,
- (process_method_func)daTag_Chk_Delete,
- (process_method_func)daTag_Chk_Execute,
- (process_method_func)daTag_Chk_IsDelete,
- (process_method_func)daTag_Chk_Draw
-};
+ (process_method_func)daTag_Chk_Create, (process_method_func)daTag_Chk_Delete,
+ (process_method_func)daTag_Chk_Execute, (process_method_func)daTag_Chk_IsDelete,
+ (process_method_func)daTag_Chk_Draw};
/* 8048AC88-8048ACB8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_TAG_CHKPOINT */
extern actor_process_profile_definition g_profile_TAG_CHKPOINT = {
diff --git a/rel/d/a/tag/d_a_tag_event/d_a_tag_event.cpp b/rel/d/a/tag/d_a_tag_event/d_a_tag_event.cpp
index 74fcf5aae8..0889a2815a 100644
--- a/rel/d/a/tag/d_a_tag_event/d_a_tag_event.cpp
+++ b/rel/d/a/tag/d_a_tag_event/d_a_tag_event.cpp
@@ -4,455 +4,381 @@
//
#include "rel/d/a/tag/d_a_tag_event/d_a_tag_event.h"
+#include "d/com/d_com_inf_game.h"
#include "dol2asm.h"
-
-//
-// Types:
-//
-
-struct fopAc_ac_c {
- /* 80018B64 */ fopAc_ac_c();
- /* 80018C8C */ ~fopAc_ac_c();
-};
-
-struct daTag_Event_c {
- /* 8048AD68 */ void getEventNo();
- /* 8048AD74 */ void getSwbit();
- /* 8048AD80 */ void getSwbit2();
- /* 8048AD8C */ void getType();
- /* 8048AD98 */ void getInvalidEventFlag();
- /* 8048ADA4 */ void getAreaType();
- /* 8048ADB0 */ void getValidEventFlag();
- /* 8048ADBC */ void horseRodeo();
- /* 8048ADEC */ void arrivalTerms();
- /* 8048AEEC */ void demoInitProc();
- /* 8048AEF8 */ void demoEndProc();
- /* 8048AEFC */ void demoProc();
- /* 8048AF00 */ void create();
- /* 8048B0E4 */ void actionNext();
- /* 8048B1B0 */ void actionEvent();
- /* 8048B268 */ void actionReady();
- /* 8048B378 */ void checkArea();
- /* 8048B514 */ void actionHunt();
- /* 8048B5C8 */ void actionArrival();
- /* 8048B5F4 */ bool actionWait();
- /* 8048B5FC */ void actionHunt2();
- /* 8048B6D4 */ void execute();
- /* 8048B784 */ bool draw();
-};
-
-struct dSv_info_c {
- /* 80035200 */ void onSwitch(int, int);
- /* 80035360 */ void isSwitch(int, int) const;
-};
-
-struct dSv_event_flag_c {
- static u8 saveBitLabels[1644 + 4 /* padding */];
-};
-
-struct dSv_event_c {
- /* 800349BC */ void isEventBit(u16) const;
-};
-
-struct dEvt_control_c {
- /* 80042468 */ void reset();
- /* 80043500 */ void searchMapEventData(u8, s32);
-};
-
-struct dEvent_manager_c {
- /* 80047698 */ void getEventIdx(fopAc_ac_c*, u8);
- /* 80047A78 */ void endCheck(s16);
-};
-
-struct Vec {};
-
-struct cXyz {
- /* 80266B34 */ void operator-(Vec const&) const;
-};
-
-//
-// Forward References:
-//
-
-extern "C" static void daTag_getBk__FUl();
-extern "C" void getEventNo__13daTag_Event_cFv();
-extern "C" void getSwbit__13daTag_Event_cFv();
-extern "C" void getSwbit2__13daTag_Event_cFv();
-extern "C" void getType__13daTag_Event_cFv();
-extern "C" void getInvalidEventFlag__13daTag_Event_cFv();
-extern "C" void getAreaType__13daTag_Event_cFv();
-extern "C" void getValidEventFlag__13daTag_Event_cFv();
-extern "C" void horseRodeo__13daTag_Event_cFv();
-extern "C" void arrivalTerms__13daTag_Event_cFv();
-extern "C" void demoInitProc__13daTag_Event_cFv();
-extern "C" void demoEndProc__13daTag_Event_cFv();
-extern "C" void demoProc__13daTag_Event_cFv();
-extern "C" void create__13daTag_Event_cFv();
-extern "C" void actionNext__13daTag_Event_cFv();
-extern "C" void actionEvent__13daTag_Event_cFv();
-extern "C" void actionReady__13daTag_Event_cFv();
-extern "C" void checkArea__13daTag_Event_cFv();
-extern "C" void actionHunt__13daTag_Event_cFv();
-extern "C" void actionArrival__13daTag_Event_cFv();
-extern "C" bool actionWait__13daTag_Event_cFv();
-extern "C" void actionHunt2__13daTag_Event_cFv();
-extern "C" void execute__13daTag_Event_cFv();
-extern "C" bool draw__13daTag_Event_cFv();
-extern "C" static void daTag_Event_Draw__FP13daTag_Event_c();
-extern "C" static void daTag_Event_Execute__FP13daTag_Event_c();
-extern "C" static bool daTag_Event_IsDelete__FP13daTag_Event_c();
-extern "C" static void daTag_Event_Delete__FP13daTag_Event_c();
-extern "C" static void daTag_Event_Create__FP10fopAc_ac_c();
-extern "C" extern char const* const d_a_tag_event__stringBase0;
-extern "C" extern void* g_profile_TAG_EVENT[12];
-
-//
-// External References:
-//
-
-extern "C" void __ct__10fopAc_ac_cFv();
-extern "C" void __dt__10fopAc_ac_cFv();
-extern "C" void fopAcM_orderOtherEventId__FP10fopAc_ac_csUcUsUsUs();
-extern "C" void fopAcM_searchFromName__FPCcUlUl();
-extern "C" void isEventBit__11dSv_event_cCFUs();
-extern "C" void onSwitch__10dSv_info_cFii();
-extern "C" void isSwitch__10dSv_info_cCFii();
-extern "C" void reset__14dEvt_control_cFv();
-extern "C" void searchMapEventData__14dEvt_control_cFUcl();
-extern "C" void getEventIdx__16dEvent_manager_cFP10fopAc_ac_cUc();
-extern "C" void endCheck__16dEvent_manager_cFs();
-extern "C" void __mi__4cXyzCFRC3Vec();
-extern "C" void PSVECSquareMag();
-extern "C" void _savegpr_28();
-extern "C" void _restgpr_28();
-extern "C" extern void* g_fopAc_Method[8];
-extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
-extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */];
-extern "C" extern u8 g_dComIfG_gameInfo[122384];
-extern "C" extern u8 mStayNo__20dStage_roomControl_c[4];
-
-//
-// Declarations:
-//
-
-/* ############################################################################################## */
-/* 8048B840-8048B840 000010 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8048B840 = "Bk";
-#pragma pop
+#include "rel/d/a/d_a_horse/d_a_horse.h"
/* 8048AD38-8048AD68 000078 0030+00 1/1 0/0 0/0 .text daTag_getBk__FUl */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void daTag_getBk(u32 param_0) {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/daTag_getBk__FUl.s"
+static fopAc_ac_c* daTag_getBk(u32 param_0) {
+ return fopAcM_searchFromName("Bk", 0xF, param_0);
}
-#pragma pop
/* 8048AD68-8048AD74 0000A8 000C+00 4/4 0/0 0/0 .text getEventNo__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::getEventNo() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/getEventNo__13daTag_Event_cFv.s"
+u8 daTag_Event_c::getEventNo() {
+ return fopAcM_GetParam(this) >> 0x18;
}
-#pragma pop
/* 8048AD74-8048AD80 0000B4 000C+00 4/4 0/0 0/0 .text getSwbit__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::getSwbit() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/getSwbit__13daTag_Event_cFv.s"
+u8 daTag_Event_c::getSwbit() {
+ return fopAcM_GetParam(this) >> 0x8;
}
-#pragma pop
/* 8048AD80-8048AD8C 0000C0 000C+00 1/1 0/0 0/0 .text getSwbit2__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::getSwbit2() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/getSwbit2__13daTag_Event_cFv.s"
+u8 daTag_Event_c::getSwbit2() {
+ return fopAcM_GetParam(this) >> 0x10;
}
-#pragma pop
/* 8048AD8C-8048AD98 0000CC 000C+00 1/1 0/0 0/0 .text getType__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::getType() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/getType__13daTag_Event_cFv.s"
+u8 daTag_Event_c::getType() {
+ return fopAcM_GetParam(this);
}
-#pragma pop
/* 8048AD98-8048ADA4 0000D8 000C+00 1/1 0/0 0/0 .text getInvalidEventFlag__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::getInvalidEventFlag() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/getInvalidEventFlag__13daTag_Event_cFv.s"
+u16 daTag_Event_c::getInvalidEventFlag() {
+ return home.angle.x & 0x7FFF;
}
-#pragma pop
/* 8048ADA4-8048ADB0 0000E4 000C+00 1/1 0/0 0/0 .text getAreaType__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::getAreaType() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/getAreaType__13daTag_Event_cFv.s"
+u16 daTag_Event_c::getAreaType() {
+ return home.angle.x & 0x8000;
}
-#pragma pop
/* 8048ADB0-8048ADBC 0000F0 000C+00 1/1 0/0 0/0 .text getValidEventFlag__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::getValidEventFlag() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/getValidEventFlag__13daTag_Event_cFv.s"
+u16 daTag_Event_c::getValidEventFlag() {
+ return home.angle.z;
}
-#pragma pop
/* 8048ADBC-8048ADEC 0000FC 0030+00 2/2 0/0 0/0 .text horseRodeo__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::horseRodeo() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/horseRodeo__13daTag_Event_cFv.s"
+BOOL daTag_Event_c::horseRodeo() {
+ if (getType() == 5) {
+ return true;
+ } else {
+ return false;
+ }
}
-#pragma pop
/* 8048ADEC-8048AEEC 00012C 0100+00 2/2 0/0 0/0 .text arrivalTerms__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::arrivalTerms() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/arrivalTerms__13daTag_Event_cFv.s"
+BOOL daTag_Event_c::arrivalTerms() {
+ int swbit2 = getSwbit2();
+ if (swbit2 != 0xFF) {
+ if (!dComIfGs_isSwitch(swbit2, fopAcM_GetRoomNo(this))) {
+ return false;
+ }
+ }
+
+ u16 invalid_flag = getInvalidEventFlag();
+ if (invalid_flag != 0x7FFF && invalid_flag != 0 &&
+ dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[invalid_flag]))
+ {
+ return false;
+ }
+
+ u16 valid_flag = getValidEventFlag();
+ if (valid_flag != 0xFFFF && valid_flag != 0 &&
+ !dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[valid_flag]))
+ {
+ return false;
+ }
+
+ return true;
}
-#pragma pop
/* 8048AEEC-8048AEF8 00022C 000C+00 1/1 0/0 0/0 .text demoInitProc__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::demoInitProc() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/demoInitProc__13daTag_Event_cFv.s"
+void daTag_Event_c::demoInitProc() {
+ field_0x56e = 0;
}
-#pragma pop
/* 8048AEF8-8048AEFC 000238 0004+00 1/1 0/0 0/0 .text demoEndProc__13daTag_Event_cFv */
-void daTag_Event_c::demoEndProc() {
- /* empty function */
-}
+void daTag_Event_c::demoEndProc() {}
/* 8048AEFC-8048AF00 00023C 0004+00 1/1 0/0 0/0 .text demoProc__13daTag_Event_cFv */
-void daTag_Event_c::demoProc() {
- /* empty function */
-}
-
-/* ############################################################################################## */
-/* 8048B830-8048B834 000000 0004+00 1/1 0/0 0/0 .rodata @3814 */
-SECTION_RODATA static f32 const lit_3814 = 100.0f;
-COMPILER_STRIP_GATE(0x8048B830, &lit_3814);
-
-/* 8048B834-8048B838 000004 0004+00 1/1 0/0 0/0 .rodata @3815 */
-SECTION_RODATA static f32 const lit_3815 = 10.0f;
-COMPILER_STRIP_GATE(0x8048B834, &lit_3815);
+void daTag_Event_c::demoProc() {}
/* 8048AF00-8048B0E4 000240 01E4+00 1/1 0/0 0/0 .text create__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::create() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/create__13daTag_Event_cFv.s"
+int daTag_Event_c::create() {
+ fopAcM_SetupActor(this, daTag_Event_c);
+
+ int swbit = getSwbit();
+ int room_no = fopAcM_GetRoomNo(this);
+
+ mEventIdx = dComIfGp_getEventManager().getEventIdx(this, getEventNo());
+ mMapToolId = -1;
+ mMapEventIdx = -1;
+
+ dStage_MapEvent_dt_c* event_data = dEvt_control_c::searchMapEventData(getEventNo(), room_no);
+ if (event_data != NULL) {
+ mMapToolId = event_data->field_0x5;
+ mMapEventIdx = dComIfGp_getEventManager().getEventIdx(this, mMapToolId);
+ }
+
+ eventInfo.setEventId(mEventIdx);
+ eventInfo.setMapToolId(getEventNo());
+
+ if (mEventIdx != -1 || horseRodeo() && (swbit == 0xFF || !dComIfGs_isSwitch(swbit, room_no)))
+ {
+ setActio(ACTION_ARRIVAL);
+ } else {
+ setActio(ACTION_WAIT);
+ }
+
+ shape_angle.z = 0;
+ shape_angle.x = 0;
+ current.angle.z = 0;
+ current.angle.x = 0;
+
+ scale.x *= 100.0f;
+ scale.y *= 100.0f;
+ scale.z *= 100.0f;
+
+ if (horseRodeo()) {
+ if (dComIfGs_isEventBit(dSv_event_flag_c::M_023)) {
+ return cPhs_ERROR_e;
+ }
+
+ scale.x *= 10.0f;
+ scale.y *= 10.0f;
+ scale.z *= 10.0f;
+ }
+
+ return cPhs_COMPLEATE_e;
}
-#pragma pop
/* 8048B0E4-8048B1B0 000424 00CC+00 1/1 0/0 0/0 .text actionNext__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::actionNext() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/actionNext__13daTag_Event_cFv.s"
+int daTag_Event_c::actionNext() {
+ if (eventInfo.i_checkCommandDemoAccrpt()) {
+ mEventIdx = mMapEventIdx;
+ mMapEventIdx = -1;
+
+ dStage_MapEvent_dt_c* event_data =
+ dEvt_control_c::searchMapEventData(mMapToolId, fopAcM_GetRoomNo(this));
+ if (event_data != NULL) {
+ mMapToolId = event_data->field_0x5;
+ mMapEventIdx = dComIfGp_getEventManager().getEventIdx(this, mMapToolId);
+ } else {
+ mMapToolId = -1;
+ }
+
+ setActio(ACTION_EVENT);
+ actionEvent();
+ } else {
+ fopAcM_orderOtherEventId(this, mMapEventIdx, mMapToolId, 0xFFFF, 0, 1);
+ }
+
+ return 1;
}
-#pragma pop
/* 8048B1B0-8048B268 0004F0 00B8+00 3/3 0/0 0/0 .text actionEvent__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::actionEvent() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/actionEvent__13daTag_Event_cFv.s"
+int daTag_Event_c::actionEvent() {
+ if (dComIfGp_evmng_endCheck(mEventIdx)) {
+ dComIfGp_event_reset();
+
+ if (mMapEventIdx != -1) {
+ setActio(ACTION_NEXT);
+ fopAcM_orderOtherEventId(this, mMapEventIdx, mMapToolId, 0xFFFF, 0, 1);
+ } else {
+ setActio(ACTION_WAIT);
+ demoEndProc();
+ mMapToolId = -1;
+ }
+ } else {
+ demoProc();
+ }
+
+ return 1;
}
-#pragma pop
/* 8048B268-8048B378 0005A8 0110+00 1/1 0/0 0/0 .text actionReady__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::actionReady() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/actionReady__13daTag_Event_cFv.s"
+int daTag_Event_c::actionReady() {
+ int swbit = getSwbit();
+
+ if (eventInfo.i_checkCommandDemoAccrpt()) {
+ demoInitProc();
+ setActio(ACTION_EVENT);
+ actionEvent();
+
+ if (swbit != 0xFF) {
+ dComIfGs_onSwitch(swbit, fopAcM_GetRoomNo(this));
+ }
+
+ if (horseRodeo() && dComIfGp_getHorseActor() != NULL) {
+ dComIfGp_getHorseActor()->onRodeoMode();
+ }
+ } else {
+ if (swbit != 0xFF && dComIfGs_isSwitch(swbit, fopAcM_GetRoomNo(this))) {
+ setActio(ACTION_WAIT);
+ } else {
+ fopAcM_orderOtherEventId(this, mEventIdx, getEventNo(), 0xFFFF, 0, 1);
+ }
+ }
+
+ return 1;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 8048B838-8048B83C 000008 0004+00 1/1 0/0 0/0 .rodata @3954 */
-SECTION_RODATA static f32 const lit_3954 = 0.5f;
-COMPILER_STRIP_GATE(0x8048B838, &lit_3954);
-
-/* 8048B83C-8048B840 00000C 0004+00 1/1 0/0 0/0 .rodata @3955 */
-SECTION_RODATA static u8 const lit_3955[4] = {
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-};
-COMPILER_STRIP_GATE(0x8048B83C, &lit_3955);
/* 8048B378-8048B514 0006B8 019C+00 1/1 0/0 0/0 .text checkArea__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::checkArea() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/checkArea__13daTag_Event_cFv.s"
+BOOL daTag_Event_c::checkArea() {
+ cXyz pos;
+ daPy_py_c* player = dComIfGp_getLinkPlayer();
+
+ if (getAreaType() == 0x8000) {
+ pos = player->current.pos;
+
+ cXyz start(current.pos.x - scale.x * 0.5f, current.pos.y, current.pos.z - scale.z * 0.5f);
+ cXyz end(current.pos.x + scale.x * 0.5f, current.pos.y + scale.y,
+ current.pos.z + scale.z * 0.5f);
+
+ if (start.x <= pos.x && pos.x <= end.x && start.y <= pos.y && pos.y <= end.y &&
+ start.z <= pos.z && pos.z <= end.z)
+ {
+ return true;
+ }
+ } else {
+ pos = player->current.pos - current.pos;
+
+ if (pos.y < 0.0f) {
+ pos.y = -pos.y;
+ }
+
+ if (pos.abs2XZ() < scale.x * scale.x && pos.y <= scale.y) {
+ return true;
+ }
+ }
+
+ return false;
}
-#pragma pop
/* 8048B514-8048B5C8 000854 00B4+00 2/2 0/0 0/0 .text actionHunt__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::actionHunt() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/actionHunt__13daTag_Event_cFv.s"
+int daTag_Event_c::actionHunt() {
+ int swbit = getSwbit();
+
+ if (swbit != 0xFF && dComIfGs_isSwitch(swbit, fopAcM_GetRoomNo(this))) {
+ setActio(ACTION_WAIT);
+ } else if (arrivalTerms() && checkArea()) {
+ setActio(ACTION_READY);
+ fopAcM_orderOtherEventId(this, mEventIdx, getEventNo(), 0xFFFF, 0, 1);
+ }
+
+ return 1;
}
-#pragma pop
/* 8048B5C8-8048B5F4 000908 002C+00 1/1 0/0 0/0 .text actionArrival__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::actionArrival() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/actionArrival__13daTag_Event_cFv.s"
+int daTag_Event_c::actionArrival() {
+ setActio(ACTION_HUNT);
+ actionHunt();
+ return 1;
}
-#pragma pop
/* 8048B5F4-8048B5FC 000934 0008+00 1/1 0/0 0/0 .text actionWait__13daTag_Event_cFv */
-bool daTag_Event_c::actionWait() {
+int daTag_Event_c::actionWait() {
return true;
}
/* 8048B5FC-8048B6D4 00093C 00D8+00 1/1 0/0 0/0 .text actionHunt2__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::actionHunt2() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/actionHunt2__13daTag_Event_cFv.s"
+int daTag_Event_c::actionHunt2() {
+ int swbit = getSwbit();
+
+ if (swbit != 0xFF && dComIfGs_isSwitch(swbit, fopAcM_GetRoomNo(this))) {
+ setActio(ACTION_WAIT);
+ } else if (arrivalTerms() && daTag_getBk(field_0x573) == NULL) {
+ if (mHunt2Timer > 0) {
+ mHunt2Timer--;
+ } else {
+ setActio(ACTION_READY);
+ fopAcM_orderOtherEventId(this, mEventIdx, getEventNo(), 0xFFFF, 0, 1);
+ }
+ } else {
+ mHunt2Timer = 65;
+ }
+
+ return 1;
}
-#pragma pop
/* 8048B6D4-8048B784 000A14 00B0+00 1/1 0/0 0/0 .text execute__13daTag_Event_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void daTag_Event_c::execute() {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/execute__13daTag_Event_cFv.s"
+int daTag_Event_c::execute() {
+ if (home.roomNo != dComIfGp_roomControl_getStayNo()) {
+ return 0;
+ }
+
+ switch (mAction) {
+ case ACTION_ARRIVAL:
+ actionArrival();
+ break;
+ case ACTION_HUNT:
+ actionHunt();
+ break;
+ case ACTION_HUNT2:
+ actionHunt2();
+ break;
+ case ACTION_READY:
+ actionReady();
+ break;
+ case ACTION_NEXT:
+ actionNext();
+ break;
+ case ACTION_EVENT:
+ actionEvent();
+ break;
+ default:
+ actionWait();
+ }
+
+ return 1;
}
-#pragma pop
/* 8048B784-8048B78C 000AC4 0008+00 1/1 0/0 0/0 .text draw__13daTag_Event_cFv */
-bool daTag_Event_c::draw() {
- return true;
+int daTag_Event_c::draw() {
+ return 1;
}
/* 8048B78C-8048B7AC 000ACC 0020+00 1/0 0/0 0/0 .text daTag_Event_Draw__FP13daTag_Event_c
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void daTag_Event_Draw(daTag_Event_c* param_0) {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/daTag_Event_Draw__FP13daTag_Event_c.s"
+static int daTag_Event_Draw(daTag_Event_c* i_this) {
+ return i_this->draw();
}
-#pragma pop
/* 8048B7AC-8048B7D0 000AEC 0024+00 1/0 0/0 0/0 .text daTag_Event_Execute__FP13daTag_Event_c */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void daTag_Event_Execute(daTag_Event_c* param_0) {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/daTag_Event_Execute__FP13daTag_Event_c.s"
+static int daTag_Event_Execute(daTag_Event_c* i_this) {
+ i_this->execute();
+ return 1;
}
-#pragma pop
/* 8048B7D0-8048B7D8 000B10 0008+00 1/0 0/0 0/0 .text daTag_Event_IsDelete__FP13daTag_Event_c */
-static bool daTag_Event_IsDelete(daTag_Event_c* param_0) {
- return true;
+static int daTag_Event_IsDelete(daTag_Event_c* i_this) {
+ return 1;
}
/* 8048B7D8-8048B808 000B18 0030+00 1/0 0/0 0/0 .text daTag_Event_Delete__FP13daTag_Event_c */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void daTag_Event_Delete(daTag_Event_c* param_0) {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/daTag_Event_Delete__FP13daTag_Event_c.s"
+static int daTag_Event_Delete(daTag_Event_c* i_this) {
+ i_this->~daTag_Event_c();
+ return 1;
}
-#pragma pop
/* 8048B808-8048B828 000B48 0020+00 1/0 0/0 0/0 .text daTag_Event_Create__FP10fopAc_ac_c
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void daTag_Event_Create(fopAc_ac_c* param_0) {
- nofralloc
-#include "asm/rel/d/a/tag/d_a_tag_event/d_a_tag_event/daTag_Event_Create__FP10fopAc_ac_c.s"
+static int daTag_Event_Create(fopAc_ac_c* i_this) {
+ return static_cast<daTag_Event_c*>(i_this)->create();
}
-#pragma pop
-/* ############################################################################################## */
/* 8048B844-8048B864 -00001 0020+00 1/0 0/0 0/0 .data l_daTag_Event_Method */
-SECTION_DATA static void* l_daTag_Event_Method[8] = {
- (void*)daTag_Event_Create__FP10fopAc_ac_c,
- (void*)daTag_Event_Delete__FP13daTag_Event_c,
- (void*)daTag_Event_Execute__FP13daTag_Event_c,
- (void*)daTag_Event_IsDelete__FP13daTag_Event_c,
- (void*)daTag_Event_Draw__FP13daTag_Event_c,
- (void*)NULL,
- (void*)NULL,
- (void*)NULL,
+static actor_method_class l_daTag_Event_Method = {
+ (process_method_func)daTag_Event_Create, (process_method_func)daTag_Event_Delete,
+ (process_method_func)daTag_Event_Execute, (process_method_func)daTag_Event_IsDelete,
+ (process_method_func)daTag_Event_Draw,
};
/* 8048B864-8048B894 -00001 0030+00 0/0 0/0 1/0 .data g_profile_TAG_EVENT */
-SECTION_DATA extern void* g_profile_TAG_EVENT[12] = {
- (void*)0xFFFFFFFD, (void*)0x0007FFFD,
- (void*)0x02D10000, (void*)&g_fpcLf_Method,
- (void*)0x00000574, (void*)NULL,
- (void*)NULL, (void*)&g_fopAc_Method,
- (void*)0x01190000, (void*)&l_daTag_Event_Method,
- (void*)0x00044000, (void*)0x00060000,
+extern actor_process_profile_definition g_profile_TAG_EVENT = {
+ fpcLy_CURRENT_e,
+ 7,
+ fpcPi_CURRENT_e,
+ PROC_TAG_EVENT,
+ &g_fpcLf_Method.mBase,
+ sizeof(daTag_Event_c),
+ 0,
+ 0,
+ &g_fopAc_Method.base,
+ 281,
+ &l_daTag_Event_Method,
+ 0x44000,
+ fopAc_ACTOR_e,
+ fopAc_CULLBOX_6_e,
};
-
-/* 8048B840-8048B840 000010 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
diff --git a/rel/d/a/tag/d_a_tag_evtarea/d_a_tag_evtarea.cpp b/rel/d/a/tag/d_a_tag_evtarea/d_a_tag_evtarea.cpp
index cb2d845a4a..8d1d1ea3d9 100644
--- a/rel/d/a/tag/d_a_tag_evtarea/d_a_tag_evtarea.cpp
+++ b/rel/d/a/tag/d_a_tag_evtarea/d_a_tag_evtarea.cpp
@@ -6,129 +6,129 @@
#include "d/a/d_a_npc.h"
#include "d/d_procname.h"
-u32 daTag_EvtArea_c::getOnEvtBit() {
- u32 ret = fopAcM_GetParam(this) & 0xfff;
- return ret == 0xfff ? -1 : ret;
-}
-
-u32 daTag_EvtArea_c::getOffEvtBit() {
- u32 ret = (fopAcM_GetParam(this) & 0xfff000) >> 12;
- return ret == 0xfff ? -1 : ret;
-}
-
-u8 daTag_EvtArea_c::getBitSW() {
- return home.angle.x & 0xff;
-}
-
-u8 daTag_EvtArea_c::getBitSW2() {
- return (home.angle.x & 0xff00) >> 8;
-}
-
/* 8048C4F8-8048C728 000078 0230+00 2/1 0/0 0/0 .text create__15daTag_EvtArea_cFv */
cPhs__Step daTag_EvtArea_c::create() {
fopAcM_SetupActor(this, daTag_EvtArea_c);
switch (getType()) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- scale.x *= 100.0f;
- scale.y *= 100.0f;
- scale.z *= 100.0f;
- break;
- case 13:
- scale.x *= 200.0f;
- scale.y *= 200.0f;
- scale.z *= 200.0f;
- break;
- case 14:
- scale.x *= 100.0f;
- scale.y *= 100.0f;
- scale.z *= 100.0f;
- break;
- case 15:
- scale.x *= 0.5f;
- scale.z *= 0.5f;
- scale.x *= 1000.0f;
- scale.y *= 1000.0f;
- scale.z *= 1000.0f;
- break;
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- scale.x *= 100.0f;
- scale.y *= 100.0f;
- scale.z *= 100.0f;
- break;
- case 21:
- scale.x *= 1000.0f;
- scale.z *= 1000.0f;
- break;
- case 22:
- case 23:
- scale.x *= 100.0f;
- scale.y *= 100.0f;
- scale.z *= 100.0f;
- break;
- default:
- scale.x *= 100.0f;
- scale.y *= 100.0f;
- scale.z *= 100.0f;
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ scale.x *= 100.0f;
+ scale.y *= 100.0f;
+ scale.z *= 100.0f;
+ break;
+ case 13:
+ scale.x *= 200.0f;
+ scale.y *= 200.0f;
+ scale.z *= 200.0f;
+ break;
+ case 14:
+ scale.x *= 100.0f;
+ scale.y *= 100.0f;
+ scale.z *= 100.0f;
+ break;
+ case 15:
+ scale.x *= 0.5f;
+ scale.z *= 0.5f;
+ scale.x *= 1000.0f;
+ scale.y *= 1000.0f;
+ scale.z *= 1000.0f;
+ break;
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ scale.x *= 100.0f;
+ scale.y *= 100.0f;
+ scale.z *= 100.0f;
+ break;
+ case 21:
+ scale.x *= 1000.0f;
+ scale.z *= 1000.0f;
+ break;
+ case 22:
+ case 23:
+ scale.x *= 100.0f;
+ scale.y *= 100.0f;
+ scale.z *= 100.0f;
+ break;
+ default:
+ scale.x *= 100.0f;
+ scale.y *= 100.0f;
+ scale.z *= 100.0f;
}
+
+ // clang-format off
+ OS_REPORT("\t(%s:%d) no:%d, onEvt:%d, offEvt:%d, BitSW:%02x, BitSW2:%02x, scale:%f,%f,%f<%08x>\n",
+ fopAcM_getProcNameString(this),
+ getType(),
+ getNo(),
+ getOnEvtBit(),
+ getOffEvtBit(),
+ getBitSW(),
+ getBitSW2(),
+ scale.x, scale.y, scale.z,
+ fopAcM_GetParam(this)
+ );
+ // clang-format on
+
if (isDelete()) {
return cPhs_ERROR_e;
- } else {
- field_0x56c = 0;
- return cPhs_COMPLEATE_e;
}
+
+ field_0x56c = 0;
+ return cPhs_COMPLEATE_e;
}
/* 8048C728-8048C730 0002A8 0008+00 1/1 0/0 0/0 .text Delete__15daTag_EvtArea_cFv */
-bool daTag_EvtArea_c::Delete() {
+BOOL daTag_EvtArea_c::Delete() {
return true;
}
/* 8048C730-8048C894 0002B0 0164+00 1/1 0/0 0/0 .text Execute__15daTag_EvtArea_cFv */
-bool daTag_EvtArea_c::Execute() {
+BOOL daTag_EvtArea_c::Execute() {
if (home.roomNo == dComIfGp_roomControl_getStayNo()) {
if (isDelete()) {
fopAcM_delete(this);
return true;
- } else {
- attention_info.position = current.pos;
- if (getType() == 8) {
- attention_info.position.y += 100.0f;
- }
- group = 0;
- eyePos = attention_info.position;
- if (getType() == 15) {
- if (chkPointInArea(daPy_getPlayerActorClass()->current.pos)) {
- eyePos = daPy_getPlayerActorClass()->eyePos;
- group = 4;
- }
+ }
+
+ attention_info.position = current.pos;
+ if (getType() == 8) {
+ attention_info.position.y += 100.0f;
+ }
+
+ fopAcM_SetGroup(this, 0);
+ eyePos = attention_info.position;
+
+ if (getType() == 15) {
+ if (chkPointInArea(daPy_getPlayerActorClass()->current.pos)) {
+ eyePos = daPy_getPlayerActorClass()->eyePos;
+ fopAcM_SetGroup(this, 4);
}
- attention_info.flags = 0;
- return true;
}
- } else {
- return false;
+
+ attention_info.flags = 0;
+ return true;
}
+
+ return false;
}
/* 8048C894-8048C89C 000414 0008+00 1/1 0/0 0/0 .text Draw__15daTag_EvtArea_cFv */
-bool daTag_EvtArea_c::Draw() {
+BOOL daTag_EvtArea_c::Draw() {
return true;
}
@@ -140,53 +140,72 @@ BOOL daTag_EvtArea_c::isDelete() {
return true;
}
}
+
ret = false;
- if (getBitSW2() != 0xff) {
+ if (getBitSW2() != 0xFF) {
if (dComIfGs_isSwitch(getBitSW2(), fopAcM_GetRoomNo(this))) {
ret = true;
}
}
+
return ret;
}
/* 8048C94C-8048CC80 0004CC 0334+00 1/1 0/0 16/16 .text
* chkPointInArea__15daTag_EvtArea_cF4cXyz4cXyz */
-BOOL daTag_EvtArea_c::chkPointInArea(cXyz param_0, cXyz param_1) {
- cXyz local_24, local_30, local_3c, local_48, local_84, local_cc, local_6c, local_90;
+BOOL daTag_EvtArea_c::chkPointInArea(cXyz i_point, cXyz i_addSize) {
+ cXyz area_vtx[4];
+ cXyz size, center, player_to_home, point_to_current;
+
if (field_0x56c == 0) {
- if ((getOnEvtBit() != -1 && daNpcT_chkEvtBit(getOnEvtBit()))
- || (getBitSW() != 0xff && dComIfGs_isSwitch(getBitSW(), fopAcM_GetRoomNo(this)))
- || (getOnEvtBit() == -1 && getBitSW() == 0xff)) {
- local_84 = scale + param_1;
+ if ((getOnEvtBit() != -1 && daNpcT_chkEvtBit(getOnEvtBit())) ||
+ (getBitSW() != 0xff && dComIfGs_isSwitch(getBitSW(), fopAcM_GetRoomNo(this))) ||
+ (getOnEvtBit() == -1 && getBitSW() == 0xFF))
+ {
+ size = scale + i_addSize;
+
if (getType() == 15 || getType() == 16) {
- local_6c = daPy_getPlayerActorClass()->current.pos;
- local_6c -= home.pos;
+ player_to_home = daPy_getPlayerActorClass()->current.pos;
+ player_to_home -= home.pos;
mDoMtx_YrotS(mDoMtx_stack_c::now, -current.angle.y);
- mDoMtx_stack_c::multVec(&local_6c, &local_6c);
- local_48.x = -local_84.x;
- local_48.z = -local_84.z;
- local_3c.x = local_84.x;
- local_3c.z = -local_84.z;
- local_30.x = local_84.x;
- local_30.z = local_84.z;
- local_24.x = -local_84.x;
- local_24.z = local_84.z;
- if (local_48.x < local_6c.x && local_48.z < local_6c.z && local_84.x > local_6c.x && local_84.z > local_6c.z) {
- local_90 = param_0 - current.pos;
- if (0 <= (s32)local_90.y && (s32)local_90.y < (s32)local_84.y) {
+ mDoMtx_stack_c::multVec(&player_to_home, &player_to_home);
+
+ // bottom left
+ area_vtx[0].x = -size.x;
+ area_vtx[0].z = -size.z;
+
+ // bottom right
+ area_vtx[1].x = size.x;
+ area_vtx[1].z = -size.z;
+
+ // top right
+ area_vtx[2].x = size.x;
+ area_vtx[2].z = size.z;
+
+ // top left
+ area_vtx[3].x = -size.x;
+ area_vtx[3].z = size.z;
+
+ if (area_vtx[0].x < player_to_home.x && area_vtx[0].z < player_to_home.z &&
+ area_vtx[2].x > player_to_home.x && area_vtx[2].z > player_to_home.z)
+ {
+ point_to_current = i_point - current.pos;
+ if (0 <= (int)point_to_current.y && (int)point_to_current.y < (int)size.y) {
return true;
}
}
} else {
- local_cc = current.pos;
- local_cc.y -= 10.0f;
+ center = current.pos;
+ center.y -= 10.0f;
if (getType() == 21) {
- return daNpcT_chkPointInArea(param_0, local_cc, local_84, shape_angle.y, 0);
+ return daNpcT_chkPointInArea(i_point, center, size, shape_angle.y, 0);
}
- return daNpcT_chkPointInArea(param_0, local_cc, local_84, shape_angle.y, 1);
+
+ return daNpcT_chkPointInArea(i_point, center, size, shape_angle.y, 1);
}
}
}
+
return false;
}
@@ -196,31 +215,29 @@ static cPhs__Step daTag_EvtArea_Create(void* i_this) {
}
/* 8048CCA0-8048CCC0 000820 0020+00 1/0 0/0 0/0 .text daTag_EvtArea_Delete__FPv */
-static bool daTag_EvtArea_Delete(void* i_this) {
+static BOOL daTag_EvtArea_Delete(void* i_this) {
return static_cast<daTag_EvtArea_c*>(i_this)->Delete();
}
/* 8048CCC0-8048CCE0 000840 0020+00 1/0 0/0 0/0 .text daTag_EvtArea_Execute__FPv */
-static bool daTag_EvtArea_Execute(void* i_this) {
+static BOOL daTag_EvtArea_Execute(void* i_this) {
return static_cast<daTag_EvtArea_c*>(i_this)->Execute();
}
/* 8048CCE0-8048CD00 000860 0020+00 1/0 0/0 0/0 .text daTag_EvtArea_Draw__FPv */
-static bool daTag_EvtArea_Draw(void* i_this) {
+static BOOL daTag_EvtArea_Draw(void* i_this) {
return static_cast<daTag_EvtArea_c*>(i_this)->Draw();
}
/* 8048CD00-8048CD08 000880 0008+00 1/0 0/0 0/0 .text daTag_EvtArea_IsDelete__FPv */
-static bool daTag_EvtArea_IsDelete(void* i_this) {
+static BOOL daTag_EvtArea_IsDelete(void* i_this) {
return true;
}
/* 8048CE48-8048CE68 -00001 0020+00 1/0 0/0 0/0 .data daTag_EvtArea_MethodTable */
static actor_method_class daTag_EvtArea_MethodTable = {
- (process_method_func)daTag_EvtArea_Create,
- (process_method_func)daTag_EvtArea_Delete,
- (process_method_func)daTag_EvtArea_Execute,
- (process_method_func)daTag_EvtArea_IsDelete,
+ (process_method_func)daTag_EvtArea_Create, (process_method_func)daTag_EvtArea_Delete,
+ (process_method_func)daTag_EvtArea_Execute, (process_method_func)daTag_EvtArea_IsDelete,
(process_method_func)daTag_EvtArea_Draw,
};