// // Generated By: dol2asm // Translation Unit: d/d_insect // #include "d/d_insect.h" #include "dol2asm.h" #include "dolphin/types.h" #include "f_op/f_op_actor_mng.h" #include "d/com/d_com_inf_game.h" #include "d/menu/d_menu_insect.h" #include "m_Do/m_Do_lib.h" // // Forward References: // extern "C" void __ct__9dInsect_cFv(); extern "C" void Insect_GetDemoMain__9dInsect_cFv(); extern "C" void CalcZBuffer__9dInsect_cFf(); extern "C" extern char const* const d_d_insect__stringBase0; // // External References: // extern "C" void mDoLib_project__FP3VecP3Vec(); extern "C" void mDoLib_pos2camera__FP3VecP3Vec(); extern "C" void __ct__10fopAc_ac_cFv(); extern "C" void fopAcM_delete__FP10fopAc_ac_c(); extern "C" void fopAcM_orderItemEvent__FP10fopAc_ac_cUsUs(); extern "C" void fopAcM_createItemForTrBoxDemo__FPC4cXyziiiPC5csXyzPC4cXyz(); extern "C" void fopAcM_createItem__FPC4cXyziiiPC5csXyzPC4cXyzi(); extern "C" void fopAcM_cancelCarryNow__FP10fopAc_ac_c(); extern "C" void isEventBit__11dSv_event_cCFUs(); extern "C" void reset__14dEvt_control_cFv(); extern "C" void setPtI_Id__14dEvt_control_cFUi(); extern "C" void endCheckOld__16dEvent_manager_cFPCc(); extern "C" void newData__13dDlst_peekZ_cFssPUl(); extern "C" void Insect_Release__9dInsect_cFv(); extern "C" void isCatchNotGiveInsect__14dMenu_Insect_cFUc(); extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */]; // // Declarations: // /* ############################################################################################## */ /* 803BA078-803BA088 017198 000C+04 1/1 0/0 0/0 .data __vt__9dInsect_c */ SECTION_DATA extern void* __vt__9dInsect_c[3 + 1 /* padding */] = { (void*)NULL /* RTTI */, (void*)NULL, (void*)Insect_Release__9dInsect_cFv, /* padding */ NULL, }; /* 8015E010-8015E078 158950 0068+00 0/0 0/0 13/13 .text __ct__9dInsect_cFv */ dInsect_c::dInsect_c() { field_0x588 = -1; field_0x56C = 0; field_0x56D = 1; field_0x58C = 0; field_0x580 = 0xD6; field_0x584 = 0; field_0x585 = 0; } /* ############################################################################################## */ /* 80393D98-80393D98 0203F8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ #pragma push #pragma force_active on SECTION_DEAD static char const* const stringBase_80393D98 = "DEFAULT_GETITEM"; #pragma pop /* 8015E078-8015E26C 1589B8 01F4+00 0/0 0/0 24/24 .text Insect_GetDemoMain__9dInsect_cFv */ #ifdef NONMATCHING void dInsect_c::Insect_GetDemoMain() { if (field_0x58C != 1) { if (fopAcM_checkCarryNow(this)) { cLib_offBit(mAttentionInfo.mFlags,0x10); fopAcM_cancelCarryNow(this); fopAcM_orderItemEvent(this,0,0); mEvtInfo.i_onCondition(8); field_0x588 = fopAcM_createItemForTrBoxDemo(¤t.pos,field_0x580,-1,fopAcM_GetRoomNo(this),0,0); field_0x58C = 1; if (dMenu_Insect_c::isCatchNotGiveInsect(field_0x580) != 0) { field_0x585 = 1; } } else { cLib_onBit(mAttentionInfo.mFlags,0x10); } } else { if (mEvtInfo.checkCommandItem()) { if (field_0x588 != -1) { dComIfGp_event_setItemPartnerId(field_0x588); } field_0x56D = 0; field_0x58C = 2; } else { fopAcM_orderItemEvent(this,0,0); mEvtInfo.i_onCondition(8); } } if (dComIfGp_evmng_endCheck("DEFAULT_GETITEM")) { i_dComIfGp_event_reset(); if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[field_0x582]) || field_0x585 != 0) { field_0x56D = 1; field_0x58C = 0; if (field_0x584 == 0) { fopAcM_createItem(¤t.pos,0,-1,-1,0,0,0); field_0x584 = 1; } } else { fopAcM_delete(this); } } } #else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void dInsect_c::Insect_GetDemoMain() { nofralloc #include "asm/d/d_insect/Insect_GetDemoMain__9dInsect_cFv.s" } #pragma pop #endif /* ############################################################################################## */ /* 804535E0-804535E4 001BE0 0004+00 1/1 0/0 0/0 .sdata2 @3871 */ SECTION_SDATA2 static f32 lit_3871 = 20.0f; /* 804535E4-804535E8 001BE4 0004+00 1/1 0/0 0/0 .sdata2 @3872 */ SECTION_SDATA2 static u8 lit_3872[4] = { 0x00, 0x00, 0x00, 0x00, }; /* 804535E8-804535EC 001BE8 0004+00 1/1 0/0 0/0 .sdata2 @3873 */ SECTION_SDATA2 static f32 lit_3873 = 608.0f; /* 804535EC-804535F0 001BEC 0004+00 1/1 0/0 0/0 .sdata2 @3874 */ SECTION_SDATA2 static f32 lit_3874 = 448.0f; /* 804535F0-804535F4 001BF0 0004+00 1/1 0/0 0/0 .sdata2 @3875 */ SECTION_SDATA2 static f32 lit_3875 = -10.0f; /* 804535F4-804535F8 001BF4 0004+00 1/1 0/0 0/0 .sdata2 @3876 */ SECTION_SDATA2 static f32 lit_3876 = 16777215.0f; /* 804535F8-80453600 001BF8 0004+04 1/1 0/0 0/0 .sdata2 @3877 */ SECTION_SDATA2 static f32 lit_3877[1 + 1 /* padding */] = { 1.0f, /* padding */ 0.0f, }; /* 8015E26C-8015E3F8 158BAC 018C+00 0/0 0/0 3/3 .text CalcZBuffer__9dInsect_cFf */ #ifdef NONMATCHING void dInsect_c::CalcZBuffer(f32 param_0) { f32 camera_trim_height; cXyz pos; cXyz pos_projected; pos = current.pos; pos.y += FLOAT_LABEL(lit_3871); mDoLib_project(&pos_projected,&pos); if (dComIfGp_getCamera(0)) { camera_trim_height = dComIfGp_getCamera(0)->mCamera.field_0x93c; } else { camera_trim_height = FLOAT_LABEL(lit_3872); } if (pos_projected.x < FLOAT_LABEL(lit_3872) || pos_projected.x > FLOAT_LABEL(lit_3873) || pos_projected.y < camera_trim_height || pos_projected.y < FLOAT_LABEL(lit_3874) - camera_trim_height) { dComIfGd_peekZ(pos_projected.x,pos_projected.y,&field_0x578); } else { field_0x578 = 0; } f32 view_near = dComIfGd_getView()->mNear; f32 view_far = dComIfGd_getView()->mFar; mDoLib_pos2camera(&pos_projected,&pos); pos_projected.z += param_0; if (pos_projected.z == FLOAT_LABEL(lit_3872)) { pos_projected.z = FLOAT_LABEL(lit_3875); } field_0x57C = view_near + ((view_far * view_near) / pos_projected.z) / (view_far - view_near); } #else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void dInsect_c::CalcZBuffer(f32 param_0) { nofralloc #include "asm/d/d_insect/CalcZBuffer__9dInsect_cFf.s" } #pragma pop #endif /* 80393D98-80393D98 0203F8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */