d_a_obj_snowEffTag / d_a_obj_digplace / d_a_tag_lv2prchk OK (#390)

* d_a_obj_snowEffTag OK

* d_a_obj_digplace OK

* d_a_tag_lv2prchk OK

* remove asm / fix tag_waterfall warnings
This commit is contained in:
TakaRikka
2023-07-25 18:25:04 -04:00
committed by GitHub
parent 469d9cfe91
commit 62ab7c9a0b
37 changed files with 602 additions and 2456 deletions
+182 -284
View File
@@ -1,309 +1,207 @@
//
// Generated By: dol2asm
// Translation Unit: d_a_obj_digplace
//
/**
* d_a_obj_digplace.cpp
* Generic Wolf Digging Spots
*/
#include "rel/d/a/obj/d_a_obj_digplace/d_a_obj_digplace.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct mDoMtx_stack_c {
static u8 now[48];
};
struct fopAc_ac_c {
/* 80018B64 */ fopAc_ac_c();
/* 80018C8C */ ~fopAc_ac_c();
};
struct cXyz {};
struct daPy_py_c {
/* 8015F4F0 */ void setLookPos(cXyz*);
};
struct daObjDigpl_c {
/* 8057BF98 */ void create();
/* 8057C158 */ ~daObjDigpl_c();
/* 8057C1EC */ void execute();
};
struct dSv_info_c {
/* 80035200 */ void onSwitch(int, int);
/* 80035360 */ void isSwitch(int, int) const;
};
struct dKy_tevstr_c {};
struct _GXColor {};
struct dPa_control_c {
/* 8004D1B8 */ void setSimple(u16, cXyz const*, dKy_tevstr_c const*, u8, _GXColor const&,
_GXColor const&, int, f32);
};
struct csXyz {};
//
// Forward References:
//
extern "C" void create__12daObjDigpl_cFv();
extern "C" static void daObjDigpl_Create__FP10fopAc_ac_c();
extern "C" void __dt__12daObjDigpl_cFv();
extern "C" static void daObjDigpl_Delete__FP12daObjDigpl_c();
extern "C" void execute__12daObjDigpl_cFv();
extern "C" static void daObjDigpl_Execute__FP12daObjDigpl_c();
extern "C" static bool daObjDigpl_Draw__FP12daObjDigpl_c();
//
// External References:
//
extern "C" void mDoMtx_YrotM__FPA4_fs();
extern "C" void __ct__10fopAc_ac_cFv();
extern "C" void __dt__10fopAc_ac_cFv();
extern "C" void fopAcM_delete__FP10fopAc_ac_c();
extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff();
extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff();
extern "C" void fopAcM_seenActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c();
extern "C" void fopAcM_searchActorDistanceXZ2__FPC10fopAc_ac_cPC10fopAc_ac_c();
extern "C" void fopAcM_createItemFromTable__FPC4cXyziiiPC5csXyziPC4cXyzPfPfb();
extern "C" void fopAcM_createItem__FPC4cXyziiiPC5csXyzPC4cXyzi();
extern "C" void onSwitch__10dSv_info_cFii();
extern "C" void isSwitch__10dSv_info_cCFii();
extern "C" void setSimple__13dPa_control_cFUsPC4cXyzPC12dKy_tevstr_cUcRC8_GXColorRC8_GXColorif();
extern "C" void dPath_GetRoomPath__Fii();
extern "C" void setLookPos__9daPy_py_cFP4cXyz();
extern "C" void __dl__FPv();
extern "C" void PSMTXCopy();
extern "C" void PSMTXTrans();
extern "C" void PSVECSquareDistance();
extern "C" void _savegpr_25();
extern "C" void _restgpr_25();
extern "C" extern void* g_fopAc_Method[8];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" u8 now__14mDoMtx_stack_c[48];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" extern u32 g_whiteColor;
extern "C" extern u32 __float_nan;
extern "C" extern u32 __float_max;
extern "C" extern u8 mStayNo__20dStage_roomControl_c[4];
//
// Declarations:
//
/* ############################################################################################## */
/* 8057C8B0-8057C8B4 000000 0004+00 2/2 0/0 0/0 .rodata @3822 */
SECTION_RODATA static f32 const lit_3822 = -550.0f;
COMPILER_STRIP_GATE(0x8057C8B0, &lit_3822);
/* 8057C8B4-8057C8B8 000004 0004+00 0/1 0/0 0/0 .rodata @3823 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3823 = -250.0f;
COMPILER_STRIP_GATE(0x8057C8B4, &lit_3823);
#pragma pop
/* 8057C8B8-8057C8BC 000008 0004+00 0/1 0/0 0/0 .rodata @3824 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3824 = 550.0f;
COMPILER_STRIP_GATE(0x8057C8B8, &lit_3824);
#pragma pop
/* 8057C8BC-8057C8C0 00000C 0004+00 0/1 0/0 0/0 .rodata @3825 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3825 = 250.0f;
COMPILER_STRIP_GATE(0x8057C8BC, &lit_3825);
#pragma pop
/* 8057C8F8-8057C918 -00001 0020+00 1/0 0/0 0/0 .data l_daObjDigpl_Method */
SECTION_DATA static void* l_daObjDigpl_Method[8] = {
(void*)daObjDigpl_Create__FP10fopAc_ac_c,
(void*)daObjDigpl_Delete__FP12daObjDigpl_c,
(void*)daObjDigpl_Execute__FP12daObjDigpl_c,
(void*)NULL,
(void*)daObjDigpl_Draw__FP12daObjDigpl_c,
(void*)NULL,
(void*)NULL,
(void*)NULL,
};
/* 8057C918-8057C948 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Digpl */
SECTION_DATA extern void* g_profile_Obj_Digpl[12] = {
(void*)0xFFFFFFFD, (void*)0x0003FFFD,
(void*)0x00530000, (void*)&g_fpcLf_Method,
(void*)0x000005C0, (void*)NULL,
(void*)NULL, (void*)&g_fopAc_Method,
(void*)0x00FA0000, (void*)&l_daObjDigpl_Method,
(void*)0x00044080, (void*)0x030E0000,
};
/* 8057C948-8057C954 000050 000C+00 2/2 0/0 0/0 .data __vt__12daObjDigpl_c */
SECTION_DATA extern void* __vt__12daObjDigpl_c[3] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__12daObjDigpl_cFv,
};
#include "JSystem/JKernel/JKRHeap.h"
#include "d/a/d_a_player.h"
#include "d/com/d_com_inf_game.h"
#include "d/d_procname.h"
/* 8057BF98-8057C138 000078 01A0+00 1/1 0/0 0/0 .text create__12daObjDigpl_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daObjDigpl_c::create() {
nofralloc
#include "asm/rel/d/a/obj/d_a_obj_digplace/d_a_obj_digplace/create__12daObjDigpl_cFv.s"
int daObjDigpl_c::create() {
if (!fopAcM_CheckCondition(this, 8)) {
new (this) daObjDigpl_c();
fopAcM_OnCondition(this, 8);
}
mType = (fopAcM_GetParam(this) >> 8) & 0xF;
mSwitch = fopAcM_GetParam(this) & 0xFF;
if (mType == 5) {
fopAcM_OffStatus(this, 0x80);
mpDigPoints =
dPath_GetRoomPath((fopAcM_GetParam(this) >> 0x14) & 0xFF, fopAcM_GetRoomNo(this));
}
if (mType >= 4) {
mType = 0;
}
if (mSwitch != 0xFF && i_fopAcM_isSwitch(this, mSwitch)) {
return cPhs_ERROR_e;
}
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::YrotM(shape_angle.y);
mDoMtx_copy(mDoMtx_stack_c::get(), field_0x570);
fopAcM_SetMtx(this, field_0x570);
mAttentionInfo.mPosition = current.pos;
mEyePos = mAttentionInfo.mPosition;
mTevStr.mRoomNo = dComIfGp_roomControl_getStayNo();
fopAcM_SetMin(this, -550.0f, -250.0f, -550.0f);
fopAcM_SetMax(this, 550.0f, 250.0f, 550.0f);
mAttentionInfo.field_0x0[7] = 27;
return cPhs_COMPLEATE_e;
}
#pragma pop
/* 8057C138-8057C158 000218 0020+00 1/0 0/0 0/0 .text daObjDigpl_Create__FP10fopAc_ac_c
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daObjDigpl_Create(fopAc_ac_c* param_0) {
nofralloc
#include "asm/rel/d/a/obj/d_a_obj_digplace/d_a_obj_digplace/daObjDigpl_Create__FP10fopAc_ac_c.s"
static int daObjDigpl_Create(fopAc_ac_c* i_this) {
return static_cast<daObjDigpl_c*>(i_this)->create();
}
#pragma pop
/* 8057C158-8057C1B8 000238 0060+00 1/0 0/0 0/0 .text __dt__12daObjDigpl_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm daObjDigpl_c::~daObjDigpl_c() {
nofralloc
#include "asm/rel/d/a/obj/d_a_obj_digplace/d_a_obj_digplace/__dt__12daObjDigpl_cFv.s"
}
#pragma pop
daObjDigpl_c::~daObjDigpl_c() {}
/* 8057C1B8-8057C1EC 000298 0034+00 1/0 0/0 0/0 .text daObjDigpl_Delete__FP12daObjDigpl_c
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daObjDigpl_Delete(daObjDigpl_c* param_0) {
nofralloc
#include "asm/rel/d/a/obj/d_a_obj_digplace/d_a_obj_digplace/daObjDigpl_Delete__FP12daObjDigpl_c.s"
static int daObjDigpl_Delete(daObjDigpl_c* i_this) {
i_this->~daObjDigpl_c();
return 1;
}
#pragma pop
/* ############################################################################################## */
/* 8057C8C0-8057C8C4 000010 0004+00 0/1 0/0 0/0 .rodata @4023 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_4023 = 30.0f;
COMPILER_STRIP_GATE(0x8057C8C0, &lit_4023);
#pragma pop
/* 8057C8C4-8057C8C8 000014 0004+00 0/1 0/0 0/0 .rodata @4024 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_4024 = 100000.0f;
COMPILER_STRIP_GATE(0x8057C8C4, &lit_4024);
#pragma pop
/* 8057C8C8-8057C8D0 000018 0004+04 0/1 0/0 0/0 .rodata @4025 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_4025[4 + 4 /* padding */] = {
0x00,
0x00,
0x00,
0x00,
/* padding */
0x00,
0x00,
0x00,
0x00,
};
COMPILER_STRIP_GATE(0x8057C8C8, &lit_4025);
#pragma pop
/* 8057C8D0-8057C8D8 000020 0008+00 0/1 0/0 0/0 .rodata @4026 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_4026[8] = {
0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x8057C8D0, &lit_4026);
#pragma pop
/* 8057C8D8-8057C8E0 000028 0008+00 0/1 0/0 0/0 .rodata @4027 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_4027[8] = {
0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x8057C8D8, &lit_4027);
#pragma pop
/* 8057C8E0-8057C8E8 000030 0008+00 0/1 0/0 0/0 .rodata @4028 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_4028[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x8057C8E0, &lit_4028);
#pragma pop
/* 8057C8E8-8057C8EC 000038 0004+00 0/1 0/0 0/0 .rodata @4029 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_4029 = 1000.0f;
COMPILER_STRIP_GATE(0x8057C8E8, &lit_4029);
#pragma pop
/* 8057C8EC-8057C8F0 00003C 0004+00 0/1 0/0 0/0 .rodata @4030 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_4030 = 200.0f;
COMPILER_STRIP_GATE(0x8057C8EC, &lit_4030);
#pragma pop
/* 8057C8F0-8057C8F4 000040 0004+00 0/1 0/0 0/0 .rodata @4031 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_4031 = 1600.0f;
COMPILER_STRIP_GATE(0x8057C8F0, &lit_4031);
#pragma pop
/* 8057C8F4-8057C8F8 000044 0004+00 0/1 0/0 0/0 .rodata @4032 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_4032 = 250000.0f;
COMPILER_STRIP_GATE(0x8057C8F4, &lit_4032);
#pragma pop
/* 8057C1EC-8057C880 0002CC 0694+00 1/1 0/0 0/0 .text execute__12daObjDigpl_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daObjDigpl_c::execute() {
nofralloc
#include "asm/rel/d/a/obj/d_a_obj_digplace/d_a_obj_digplace/execute__12daObjDigpl_cFv.s"
int daObjDigpl_c::execute() {
daPy_py_c* player_p = daPy_getLinkPlayerActorClass();
if (mDigFlg == 1) {
if (mSwitch != 0xFF) {
i_fopAcM_onSwitch(this, mSwitch);
}
cXyz item_pos(current.pos.x, current.pos.y - 30.0f, current.pos.z);
u8 item_no;
if (mpDigPoints != NULL) {
item_no = mpDigPoints->m_points[mCurrentDigPoint].field_0x0;
} else {
item_no = getItemNum();
}
if (mType == 0) {
fopAcM_createItem(&item_pos, item_no, -1, fopAcM_GetRoomNo(this),
&player_p->shape_angle, NULL, 9);
} else if (mType == 2) {
fopAcM_createItemFromTable(&item_pos, item_no, -1, fopAcM_GetRoomNo(this),
&player_p->shape_angle, 9, NULL, NULL, NULL, false);
}
if (mType == 1) {
mDigFlg = 2;
} else if (mpDigPoints != NULL) {
mUsedDigFlags[mCurrentDigPoint >> 5] |= 1 << (mCurrentDigPoint % 32);
mDigFlg = 0;
} else {
fopAcM_delete(this);
return 1;
}
}
mAttentionInfo.mFlags &= ~0x80;
if (mpDigPoints != NULL) {
current.pos.y = player_p->current.pos.y + 100000.0f;
mAttentionInfo.mPosition.y = current.pos.y;
cXyz point_pos;
dStage_dPnt_c* point_p = mpDigPoints->m_points;
f32 dist_to_current_pnt = FLT_MAX;
for (int i = 0; i < mpDigPoints->m_num; i++, point_p++) {
if ((mUsedDigFlags[i >> 5] & (1 << (i % 32))) == 0) {
point_pos.set(point_p->m_position.x, point_p->m_position.y, point_p->m_position.z);
if (player_p->current.pos.abs(point_pos) < 1000.0f) {
dComIfGp_particle_setSimple(0x70F, &point_pos, 255, g_whiteColor, g_whiteColor,
0, 0.0f);
dComIfGp_particle_setSimple(0x73D, &point_pos, 255, g_whiteColor, g_whiteColor,
0, 0.0f);
}
f32 point_to_plyr_dist = player_p->current.pos.abs2XZ(point_pos);
if (dist_to_current_pnt > point_to_plyr_dist &&
fabsf(point_pos.y - player_p->current.pos.y) < 200.0f)
{
dist_to_current_pnt = point_to_plyr_dist;
mCurrentDigPoint = i;
current.pos = point_pos;
mAttentionInfo.mPosition = point_pos;
mEyePos = point_pos;
if (point_p->field_0x3 == 0) {
mType = 0;
} else {
mType = 2;
}
}
}
}
}
if (daPy_py_c::i_checkNowWolf() && mDigFlg == 0) {
if (field_0x56b == 0) {
int seen_angle = fopAcM_seenActorAngleY(player_p, this);
f32 dist_to_player = fopAcM_searchPlayerDistanceXZ2(this);
if (seen_angle <= 0x2800 || dist_to_player < 1600.0f) {
mAttentionInfo.mFlags |= 0x80;
}
if (dist_to_player < 250000.0f &&
fabsf(current.pos.y - player_p->current.pos.y) < 200.0f)
{
daPy_py_c::setLookPos(&mAttentionInfo.mPosition);
}
}
if (mpDigPoints == NULL && player_p->current.pos.abs(current.pos) < 1000.0f) {
dComIfGp_particle_setSimple(0x70F, &current.pos, 255, g_whiteColor, g_whiteColor, 0,
0.0f);
dComIfGp_particle_setSimple(0x73D, &current.pos, 255, g_whiteColor, g_whiteColor, 0,
0.0f);
}
}
return 1;
}
#pragma pop
/* 8057C880-8057C8A0 000960 0020+00 1/0 0/0 0/0 .text daObjDigpl_Execute__FP12daObjDigpl_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daObjDigpl_Execute(daObjDigpl_c* param_0) {
nofralloc
#include "asm/rel/d/a/obj/d_a_obj_digplace/d_a_obj_digplace/daObjDigpl_Execute__FP12daObjDigpl_c.s"
static int daObjDigpl_Execute(daObjDigpl_c* i_this) {
return i_this->execute();
}
#pragma pop
/* 8057C8A0-8057C8A8 000980 0008+00 1/0 0/0 0/0 .text daObjDigpl_Draw__FP12daObjDigpl_c
*/
static bool daObjDigpl_Draw(daObjDigpl_c* param_0) {
return true;
static int daObjDigpl_Draw(daObjDigpl_c* i_this) {
return 1;
}
/* 8057C8F8-8057C918 -00001 0020+00 1/0 0/0 0/0 .data l_daObjDigpl_Method */
static actor_method_class l_daObjDigpl_Method = {
(process_method_func)daObjDigpl_Create, (process_method_func)daObjDigpl_Delete,
(process_method_func)daObjDigpl_Execute, (process_method_func)NULL,
(process_method_func)daObjDigpl_Draw,
};
/* 8057C918-8057C948 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Digpl */
extern actor_process_profile_definition g_profile_Obj_Digpl = {
-3,
3,
-3,
PROC_Obj_Digpl,
&g_fpcLf_Method.mBase,
sizeof(daObjDigpl_c),
0,
0,
&g_fopAc_Method.base,
250,
&l_daObjDigpl_Method,
0x44080,
3,
14,
};
File diff suppressed because it is too large Load Diff
-2
View File
@@ -8,12 +8,10 @@ M128_MAP := $(BUILD_DIR)/rel/d/a/tag/d_a_tag_lv2prchk.map
M128_CPP_FILES := \
rel/executor.cpp \
rel/d/a/tag/d_a_tag_lv2prchk/unknown_translation_unit_bss.cpp \
rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk.cpp \
M128_O_FILES := \
$(BUILD_DIR)/rel/executor.o \
$(BUILD_DIR)/rel/d/a/tag/d_a_tag_lv2prchk/unknown_translation_unit_bss.o \
$(BUILD_DIR)/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk.o \
M128_LIBS := \
+172 -204
View File
@@ -1,126 +1,59 @@
//
// Generated By: dol2asm
// Translation Unit: d_a_tag_lv2prchk
//
/**
* d_a_tag_lv2prchk.cpp
* Boomerang Switch Puzzle Tag
*/
#include "rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct fopAc_ac_c {
/* 80018B64 */ fopAc_ac_c();
};
struct daTagLv2PrChk_c {
/* 805A4C58 */ void Create();
/* 805A4CDC */ void create();
/* 805A4D44 */ void execute();
/* 805A4D68 */ void action();
/* 805A4DF4 */ void actionCheck();
/* 805A5290 */ void actionEnd();
/* 805A5294 */ void seStartWrong();
/* 805A52F4 */ bool _delete();
};
struct dSv_info_c {
/* 80035200 */ void onSwitch(int, int);
/* 80035360 */ void isSwitch(int, int) const;
};
struct JAISoundID {};
struct Vec {};
struct Z2SeMgr {
/* 802AB984 */ void seStart(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8);
};
struct Z2AudioMgr {
static u8 mAudioMgrPtr[4 + 4 /* padding */];
};
//
// Forward References:
//
extern "C" void Create__15daTagLv2PrChk_cFv();
extern "C" void create__15daTagLv2PrChk_cFv();
extern "C" void execute__15daTagLv2PrChk_cFv();
extern "C" void action__15daTagLv2PrChk_cFv();
extern "C" void actionCheck__15daTagLv2PrChk_cFv();
extern "C" void actionEnd__15daTagLv2PrChk_cFv();
extern "C" void seStartWrong__15daTagLv2PrChk_cFv();
extern "C" bool _delete__15daTagLv2PrChk_cFv();
extern "C" static void daTagLv2PrChk_Execute__FP15daTagLv2PrChk_c();
extern "C" static void daTagLv2PrChk_Delete__FP15daTagLv2PrChk_c();
extern "C" static void daTagLv2PrChk_Create__FP15daTagLv2PrChk_c();
extern "C" extern void* g_profile_Tag_Lv2PrChk[12];
//
// External References:
//
extern "C" void __ct__10fopAc_ac_cFv();
extern "C" void onSwitch__10dSv_info_cFii();
extern "C" void isSwitch__10dSv_info_cCFii();
extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc();
extern "C" void __ptmf_scall();
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" extern u8 g_dComIfG_gameInfo[122384];
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
extern "C" extern u8 data_805A5410[4];
//
// Declarations:
//
#include "JSystem/JKernel/JKRHeap.h"
#include "d/com/d_com_inf_game.h"
#include "d/d_procname.h"
/* 805A4C58-805A4CDC 000078 0084+00 1/1 0/0 0/0 .text Create__15daTagLv2PrChk_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daTagLv2PrChk_c::Create() {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/Create__15daTagLv2PrChk_cFv.s"
int daTagLv2PrChk_c::Create() {
mSwbit2 = getSwbit2();
if (mSwbit2 == 0xFF) {
return 0;
}
if (i_fopAcM_isSwitch(this, getSwbit())) {
mAction = ACTION_END_e;
} else {
mAction = ACTION_CHECK_e;
}
return 1;
}
#pragma pop
/* 805A4CDC-805A4D44 0000FC 0068+00 1/1 0/0 0/0 .text create__15daTagLv2PrChk_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daTagLv2PrChk_c::create() {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/func_805A4CDC.s"
int daTagLv2PrChk_c::create() {
if (!fopAcM_CheckCondition(this, 8)) {
new (this) daTagLv2PrChk_c();
fopAcM_OnCondition(this, 8);
}
if (!Create()) {
return cPhs_ERROR_e;
}
return cPhs_COMPLEATE_e;
}
#pragma pop
/* 805A4D44-805A4D68 000164 0024+00 1/1 0/0 0/0 .text execute__15daTagLv2PrChk_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daTagLv2PrChk_c::execute() {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/execute__15daTagLv2PrChk_cFv.s"
int daTagLv2PrChk_c::execute() {
action();
return 1;
}
#pragma pop
/* ############################################################################################## */
/* 805A536C-805A5378 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
static u8 cNullVec__6Z2Calc[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 805A5378-805A538C 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
#pragma push
#pragma force_active on
SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = {
static u32 lit_1787[1 + 4 /* padding */] = {
0x02000201,
/* padding */
0x40080000,
@@ -130,135 +63,170 @@ SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = {
};
#pragma pop
/* 805A538C-805A5398 -00001 000C+00 0/1 0/0 0/0 .data @3667 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3667[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)actionCheck__15daTagLv2PrChk_cFv,
};
#pragma pop
/* 805A5398-805A53A4 -00001 000C+00 0/1 0/0 0/0 .data @3668 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3668[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)actionEnd__15daTagLv2PrChk_cFv,
};
#pragma pop
/* 805A53A4-805A53BC 000038 0018+00 0/1 0/0 0/0 .data l_func$3666 */
#pragma push
#pragma force_active on
SECTION_DATA static u8 l_func[24] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#pragma pop
/* 805A4D68-805A4DF4 000188 008C+00 1/1 0/0 0/0 .text action__15daTagLv2PrChk_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daTagLv2PrChk_c::action() {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/action__15daTagLv2PrChk_cFv.s"
void daTagLv2PrChk_c::action() {
typedef void (daTagLv2PrChk_c::*actionFunc)();
static actionFunc l_func[] = {&daTagLv2PrChk_c::actionCheck, &daTagLv2PrChk_c::actionEnd};
(this->*l_func[mAction])();
}
#pragma pop
/* 805A4DF4-805A5290 000214 049C+00 1/0 0/0 0/0 .text actionCheck__15daTagLv2PrChk_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daTagLv2PrChk_c::actionCheck() {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/actionCheck__15daTagLv2PrChk_cFv.s"
void daTagLv2PrChk_c::actionCheck() {
bool switch_1 = i_fopAcM_isSwitch(this, mSwbit2);
bool switch_2 = i_fopAcM_isSwitch(this, mSwbit2 + 1);
bool switch_3 = i_fopAcM_isSwitch(this, mSwbit2 + 2);
bool switch_4 = i_fopAcM_isSwitch(this, mSwbit2 + 3);
int active_switch_num = switch_1 + switch_2 + switch_3 + switch_4;
switch (mMode) {
case MODE_CHECK_FIRST_SW:
mPlayedSound = false;
if (switch_1 && !switch_2 && !switch_3 && !switch_4) {
mDirection = 1;
mMode = MODE_CHECK_SECOND_SW;
} else if (switch_4 && !switch_1 && !switch_2 && !switch_3) {
mDirection = -1;
mMode = MODE_CHECK_SECOND_SW;
} else if (switch_2 || switch_3) {
mMode = MODE_CHECK_WRONG_ORDER;
}
break;
case MODE_CHECK_SECOND_SW:
if (mDirection > 0) {
if (switch_1 && switch_2) {
mMode = MODE_CHECK_THIRD_SW;
} else if (!switch_1) {
mMode = MODE_CHECK_RESET;
} else if (switch_3 || switch_4) {
mMode = MODE_CHECK_WRONG_ORDER;
}
} else {
if (switch_4 && switch_3) {
mMode = MODE_CHECK_THIRD_SW;
} else if (!switch_4) {
mMode = MODE_CHECK_RESET;
} else if (switch_2 || switch_1) {
mMode = MODE_CHECK_WRONG_ORDER;
}
}
break;
case MODE_CHECK_THIRD_SW:
if (mDirection > 0) {
if (switch_1 && switch_2 && switch_3) {
mMode = MODE_CHECK_FOURTH_SW;
} else if (!switch_1 || !switch_2) {
field_0x56d = 1;
mMode = MODE_CHECK_RESET;
} else if (switch_4) {
mMode = MODE_CHECK_WRONG_ORDER;
}
} else {
if (switch_4 && switch_3 && switch_2) {
mMode = MODE_CHECK_FOURTH_SW;
} else if (!switch_4 || !switch_3) {
field_0x56d = 1;
mMode = MODE_CHECK_RESET;
} else if (switch_1) {
mMode = MODE_CHECK_WRONG_ORDER;
}
}
break;
case MODE_CHECK_FOURTH_SW:
if (switch_1 && switch_2 && switch_3 && switch_4) {
mMode = MODE_PUZZLE_CLEAR;
} else if (mDirection > 0) {
if (!switch_1 || !switch_2 || !switch_3) {
mMode = MODE_CHECK_RESET;
}
} else if (!switch_4 || !switch_3 || !switch_2) {
mMode = MODE_CHECK_RESET;
}
break;
case MODE_PUZZLE_CLEAR:
i_fopAcM_onSwitch(this, getSwbit());
mAction = ACTION_END_e;
break;
case MODE_CHECK_RESET:
if (!switch_1 && !switch_2 && !switch_3 && !switch_4) {
mMode = MODE_CHECK_FIRST_SW;
field_0x56d = 0;
} else if (active_switch_num > 1 || field_0x56d == 1) {
i_fopAcM_onSwitch(this, getSwbit3());
}
break;
case MODE_CHECK_WRONG_ORDER:
if (switch_1 && switch_2 && switch_3 && switch_4) {
if (!mPlayedSound) {
seStartWrong();
mPlayedSound = true;
}
} else {
mMode = MODE_CHECK_RESET;
}
break;
case 150:
if (!switch_1 && !switch_2 && !switch_3 && !switch_4) {
mMode = MODE_CHECK_FIRST_SW;
}
break;
}
}
#pragma pop
/* 805A5290-805A5294 0006B0 0004+00 1/0 0/0 0/0 .text actionEnd__15daTagLv2PrChk_cFv */
void daTagLv2PrChk_c::actionEnd() {
/* empty function */
}
/* ############################################################################################## */
/* 805A5364-805A5368 000000 0004+00 1/1 0/0 0/0 .rodata @3844 */
SECTION_RODATA static f32 const lit_3844 = 1.0f;
COMPILER_STRIP_GATE(0x805A5364, &lit_3844);
/* 805A5368-805A536C 000004 0004+00 1/1 0/0 0/0 .rodata @3845 */
SECTION_RODATA static f32 const lit_3845 = -1.0f;
COMPILER_STRIP_GATE(0x805A5368, &lit_3845);
void daTagLv2PrChk_c::actionEnd() {}
/* 805A5294-805A52F4 0006B4 0060+00 1/1 0/0 0/0 .text seStartWrong__15daTagLv2PrChk_cFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daTagLv2PrChk_c::seStartWrong() {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/seStartWrong__15daTagLv2PrChk_cFv.s"
void daTagLv2PrChk_c::seStartWrong() {
Z2GetAudioMgr()->mSeMgr.seStart(Z2SE_SYS_RESULT_WRONG, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
}
#pragma pop
/* 805A52F4-805A52FC 000714 0008+00 1/1 0/0 0/0 .text _delete__15daTagLv2PrChk_cFv */
bool daTagLv2PrChk_c::_delete() {
return true;
int daTagLv2PrChk_c::_delete() {
return 1;
}
/* 805A52FC-805A531C 00071C 0020+00 1/0 0/0 0/0 .text daTagLv2PrChk_Execute__FP15daTagLv2PrChk_c
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daTagLv2PrChk_Execute(daTagLv2PrChk_c* param_0) {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/daTagLv2PrChk_Execute__FP15daTagLv2PrChk_c.s"
static int daTagLv2PrChk_Execute(daTagLv2PrChk_c* i_this) {
return i_this->execute();
}
#pragma pop
/* 805A531C-805A533C 00073C 0020+00 1/0 0/0 0/0 .text daTagLv2PrChk_Delete__FP15daTagLv2PrChk_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daTagLv2PrChk_Delete(daTagLv2PrChk_c* param_0) {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/daTagLv2PrChk_Delete__FP15daTagLv2PrChk_c.s"
static int daTagLv2PrChk_Delete(daTagLv2PrChk_c* i_this) {
return i_this->_delete();
}
#pragma pop
/* 805A533C-805A535C 00075C 0020+00 1/0 0/0 0/0 .text daTagLv2PrChk_Create__FP15daTagLv2PrChk_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daTagLv2PrChk_Create(daTagLv2PrChk_c* param_0) {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_lv2prchk/d_a_tag_lv2prchk/daTagLv2PrChk_Create__FP15daTagLv2PrChk_c.s"
static int daTagLv2PrChk_Create(daTagLv2PrChk_c* i_this) {
return i_this->create();
}
#pragma pop
/* ############################################################################################## */
/* 805A53BC-805A53DC -00001 0020+00 1/0 0/0 0/0 .data l_daTagLv2PrChk_Method */
SECTION_DATA static void* l_daTagLv2PrChk_Method[8] = {
(void*)daTagLv2PrChk_Create__FP15daTagLv2PrChk_c,
(void*)daTagLv2PrChk_Delete__FP15daTagLv2PrChk_c,
(void*)daTagLv2PrChk_Execute__FP15daTagLv2PrChk_c,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)NULL,
static actor_method_class l_daTagLv2PrChk_Method = {
(process_method_func)daTagLv2PrChk_Create,
(process_method_func)daTagLv2PrChk_Delete,
(process_method_func)daTagLv2PrChk_Execute,
(process_method_func)NULL,
(process_method_func)NULL,
};
/* 805A53DC-805A540C -00001 0030+00 0/0 0/0 1/0 .data g_profile_Tag_Lv2PrChk */
SECTION_DATA extern void* g_profile_Tag_Lv2PrChk[12] = {
(void*)0xFFFFFFFD, (void*)0x0007FFFD,
(void*)0x01820000, (void*)&g_fpcLf_Method,
(void*)0x00000570, (void*)NULL,
(void*)NULL, (void*)&g_fopAc_Method,
(void*)0x022E0000, (void*)&l_daTagLv2PrChk_Method,
(void*)0x00040000, (void*)0x000E0000,
extern actor_process_profile_definition g_profile_Tag_Lv2PrChk = {
-3,
7,
-3,
PROC_Tag_Lv2PrChk,
&g_fpcLf_Method.mBase,
sizeof(daTagLv2PrChk_c),
0,
0,
&g_fopAc_Method.base,
558,
&l_daTagLv2PrChk_Method,
0x40000,
0,
14,
};
@@ -1,27 +0,0 @@
//
// Generated By: dol2asm
// Translation Unit: unknown_translation_unit_bss
//
#include "rel/d/a/tag/d_a_tag_lv2prchk/unknown_translation_unit_bss.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Forward References:
//
extern "C" extern u8 data_805A5410[4];
//
// External References:
//
//
// Declarations:
//
/* ############################################################################################## */
/* 805A5410-805A5414 000000 0004+00 0/0 1/1 0/0 .bss None */
extern u8 data_805A5410[4];
u8 data_805A5410[4];
@@ -1,6 +1,6 @@
/**
/* Translation Unit: d_a_tag_waterfall
/*
* d_a_tag_waterfall.cpp
*
*/
#include "rel/d/a/tag/d_a_tag_waterfall/d_a_tag_waterfall.h"
@@ -28,7 +28,7 @@ static u32 m_master_id = static_cast<u32>(0xFFFFFFFF);
static actor_method_class l_daTagWaterFall_Method = {
(process_method_func)daTagWaterFall_Create, (process_method_func)daTagWaterFall_Delete,
(process_method_func)daTagWaterFall_Execute, (process_method_func)daTagWaterFall_IsDelete,
(process_method_func)daTagWaterFall_Draw
(process_method_func)daTagWaterFall_Draw,
};
/* 80D64DB8-80D64DE8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Tag_WaterFall */
@@ -46,7 +46,7 @@ extern actor_process_profile_definition g_profile_Tag_WaterFall = {
&l_daTagWaterFall_Method,
0x00044000,
0,
0
0,
};
/* 80D6462C-80D64680 0000EC 0054+00 1/1 0/0 0/0 .text __ct__20daTagWaterFall_HIO_cFv */
@@ -70,7 +70,7 @@ int daTagWaterFall_c::draw() {
/* 80D64688-80D646A8 000148 0020+00 1/0 0/0 0/0 .text daTagWaterFall_Draw__FP16daTagWaterFall_c */
static int daTagWaterFall_Draw(daTagWaterFall_c* i_this) {
i_this->draw();
return i_this->draw();
}
/* 80D646A8-80D64724 000168 007C+00 1/1 0/0 0/0 .text s_waterfall__FPvPv */
@@ -127,8 +127,7 @@ bool daTagWaterFall_c::checkHitWaterFall(cXyz objPos) {
if (fabsf(dst.z) < absEllipseY) {
if (waterfallTagPos.y < objPos.y) {
// Instruction reordering occurs when mCylinderHeight == 0.0f is used
if (!mCylinderHeight || (waterfallTagPos.y + mCylinderHeight) > objPos.y)
{
if (!mCylinderHeight || (waterfallTagPos.y + mCylinderHeight) > objPos.y) {
return true;
}
}
@@ -177,7 +176,9 @@ int daTagWaterFall_c::execute() {
}
}
if ((!mPrevCameraInWaterfall && currCameraInWaterfall) || (mPrevCameraInWaterfall && !currCameraInWaterfall)) {
if ((!mPrevCameraInWaterfall && currCameraInWaterfall) ||
(mPrevCameraInWaterfall && !currCameraInWaterfall))
{
mColorBlend = 1.0f - mColorBlend;
mPrevCameraInWaterfall = currCameraInWaterfall;
}
@@ -200,10 +201,12 @@ int daTagWaterFall_c::execute() {
} else {
instanceFogMultiplier = mColorBlend;
HIOFogMultiplier = 1.0f - mColorBlend;
};
}
f32 fogParam0 = (mFogNear * instanceFogMultiplier) + (l_HIO.mBaseFogNear * HIOFogMultiplier);
f32 fogParam1 = (mFogFar * instanceFogMultiplier) + (l_HIO.mBaseFogFar * HIOFogMultiplier);
f32 fogParam0 =
(mFogNear * instanceFogMultiplier) + (l_HIO.mBaseFogNear * HIOFogMultiplier);
f32 fogParam1 =
(mFogFar * instanceFogMultiplier) + (l_HIO.mBaseFogFar * HIOFogMultiplier);
dKy_fog_startendz_set(fogParam0, fogParam1, 1.0f);
}
@@ -217,7 +220,7 @@ int daTagWaterFall_c::execute() {
*/
static int daTagWaterFall_Execute(daTagWaterFall_c* i_this) {
i_this->execute();
return i_this->execute();
}
/* 80D64AD8-80D64AE0 000598 0008+00 1/0 0/0 0/0 .text
@@ -237,7 +240,7 @@ int daTagWaterFall_c::_delete() {
/* 80D64B00-80D64B20 0005C0 0020+00 1/0 0/0 0/0 .text daTagWaterFall_Delete__FP16daTagWaterFall_c
*/
static int daTagWaterFall_Delete(daTagWaterFall_c* i_this) {
i_this->_delete();
return i_this->_delete();
}
/* 80D64B20-80D64CBC 0005E0 019C+00 1/1 0/0 0/0 .text create__16daTagWaterFall_cFv */
@@ -289,7 +292,7 @@ cPhs__Step daTagWaterFall_c::create() {
/* 80D64CBC-80D64CDC 00077C 0020+00 1/0 0/0 0/0 .text daTagWaterFall_Create__FP16daTagWaterFall_c
*/
static int daTagWaterFall_Create(daTagWaterFall_c* i_this) {
i_this->create();
return i_this->create();
}
/* 80D64CDC-80D64D24 00079C 0048+00 2/1 0/0 0/0 .text __dt__20daTagWaterFall_HIO_cFv */