diff --git a/configure.py b/configure.py index d71dd1588..6f3cdf734 100644 --- a/configure.py +++ b/configure.py @@ -324,6 +324,11 @@ def ActorRel(rel_name, status): NonMatching("d/d_save.cpp"), NonMatching("d/d_save_init.cpp"), + NonMatching("d/actor/d_a_itembase_static.cpp"), + NonMatching("d/actor/d_a_item_static.cpp"), + NonMatching("d/actor/d_a_item.cpp"), + NonMatching("d/actor/d_a_itembase.cpp"), + # ? NonMatching("DynamicLink.cpp"), ], diff --git a/include/d/actor/d_a_item.h b/include/d/actor/d_a_item.h new file mode 100644 index 000000000..589e11240 --- /dev/null +++ b/include/d/actor/d_a_item.h @@ -0,0 +1,58 @@ +#ifndef D_A_ITEM_H +#define D_A_ITEM_H + +#include "d/actor/d_a_itembase.h" + +class daItem_c : public daItemBase_c { +public: + float getYOffset(); + void set_mtx(); + void set_mtx_base(J3DModel*, cXyz, csXyz); + void CreateInit(); + s32 _daItem_create(); + s32 _daItem_execute(); + void mode_proc_call(); + void execInitNormalDirection(); + void execMainNormalDirection(); + void execInitGetDemoDirection(); + void execWaitGetDemoDirection(); + void execMainGetDemoDirection(); + void execBringNezumi(); + void execWaitMain(); + void execWaitMainFromBoss(); + void scaleAnimFromBossItem(); + s32 _daItem_draw(); + void setTevStr(); + s32 _daItem_delete(); + void itemGetExecute(); + void itemDefaultRotateY(); + bool checkItemDisappear(); + void setItemTimer(int); + bool checkPlayerGet(); + void itemActionForRupee(); + void itemActionForHeart(); + void itemActionForKey(); + void itemActionForEmono(); + void itemActionForSword(); + void itemActionForArrow(); + void checkWall(); + void set_bound_se(); + s32 checkGetItem(); + void timeCount(); + void mode_wait_init(); + void mode_water_init(); + void mode_wait(); + void mode_water(); + void initAction(); + s32 _daItem_isdelete(); + +public: + u8 temp1[0x20]; + /* 0x668 */ u8 mItemAction; + /* 0x669 */ u8 mStatusFlags; + /* 0x66A */ u8 mMode; + /* 0x66B */ u8 mCurAction; + u8 temp2[0x54]; +}; + +#endif /* D_A_ITEM_H */ \ No newline at end of file diff --git a/include/d/actor/d_a_itembase.h b/include/d/actor/d_a_itembase.h new file mode 100644 index 000000000..f9584cdbb --- /dev/null +++ b/include/d/actor/d_a_itembase.h @@ -0,0 +1,88 @@ +#ifndef D_A_ITEMBASE_H +#define D_A_ITEMBASE_H + +#include "f_op/f_op_actor.h" +#include "SSystem/SComponent/c_phase.h" + +class mDoExt_btkAnm; +class mDoExt_brkAnm; +class mDoExt_bckAnm; + +struct daItemBase_c_m_data { + /* 0x00 */ float mFieldItemGravity; + /* 0x04 */ float field1_0x4; + /* 0x08 */ float field2_0x8; + /* 0x0C */ float mScaleAnimSpeed; + /* 0x10 */ float field4_0x10; + /* 0x14 */ short field5_0x14; + /* 0x16 */ short field6_0x16; + /* 0x18 */ short field7_0x18; + /* 0x1A */ u8 field8_0x1a; + /* 0x1B */ u8 field9_0x1b; + /* 0x1C */ short mNumFramesPerFullSpin; + u8 temp1[0x26]; + /* 0x42 */ short field47_0x42; + u8 temp2[0x4]; + /* 0x48 */ float mVelocityScale; +}; + +struct daItemBase_c : public fopAc_ac_c { +public: + s32 DeleteBase(const char*); + s32 CreateItemHeap(const char*, short, short, short, short, short, short, short); + virtual s32 DrawBase(); + virtual void setListStart(); + void setListEnd(); + virtual void settingBeforeDraw(); + virtual void setTevStr(); + virtual void setShadow(); + virtual void animEntry(); + void animPlay(float, float, float, float, float); + virtual s32 clothCreate(); + + void getItemNo(); + void getHeight(); + void getR(); + void hide(); + void show(); + void changeDraw(); + void chkDraw(); + void dead(); + void chkDead(); + void setLoadError(); + void CheckItemCreateHeap(fopAc_ac_c*); + void CheckFieldItemCreateHeap(fopAc_ac_c*); + + daItemBase_c_m_data* getData(); + + static daItemBase_c_m_data m_data; + +public: + /* 0x294 */ request_of_phase_process_class mPhs; + /* 0x29C */ J3DModel* mModel; + /* 0x2A0 */ J3DModel* mModelArrow[2]; // Extra models for arrow bundles + /* 0x2A8 */ mDoExt_btkAnm* mBtkAnm1; + /* 0x2AC */ mDoExt_btkAnm* mBtkAnm2; + /* 0x2B0 */ mDoExt_brkAnm* mBrkAnm1; + /* 0x2B4 */ mDoExt_brkAnm* mBrkAnm2; + /* 0x2B8 */ mDoExt_bckAnm* mBckAnm; + // /* 0x2BC */ dBgS_Acch mAcch; + // /* 0x480 */ dBgS_AcchCir mAcchCir; + // /* 0x4C0 */ dCcD_Stts mStts; + // /* 0x4FC */ dCcD_Cyl mCyl; + // /* 0x62C */ undefined field14_0x62c; + // /* 0x62D */ undefined field15_0x62d; + // /* 0x62E */ undefined field16_0x62e; + // /* 0x62F */ undefined field17_0x62f; + u8 temp[0x374]; + /* 0x630 */ int mPickupFlag; + /* 0x634 */ int field19_0x634; + /* 0x638 */ short field20_0x638; + /* 0x63A */ u8 m_itemNo; + /* 0x63B */ u8 mDrawFlags; + /* 0x63C */ cXyz mScaleTarget; +}; + +STATIC_ASSERT(sizeof(daItemBase_c) == 0x648); + +#endif /* D_A_ITEMBASE_H */ \ No newline at end of file diff --git a/include/d/actor/d_a_itembase_static.h b/include/d/actor/d_a_itembase_static.h new file mode 100644 index 000000000..a24ceccb8 --- /dev/null +++ b/include/d/actor/d_a_itembase_static.h @@ -0,0 +1,19 @@ +#ifndef D_A_ITEMBASE_STATIC_H +#define D_A_ITEMBASE_STATIC_H + +#include "f_op/f_op_actor.h" + +void getItemNo(); +void getHeight(); +void getR(); +void hide(); +void show(); +void changeDraw(); +void chkDraw(); +void dead(); +void chkDead(); +void setLoadError(); +void CheckItemCreateHeap(fopAc_ac_c*); +void CheckFieldItemCreateHeap(fopAc_ac_c*); + +#endif /* D_A_ITEMBASE_STATIC_H */ \ No newline at end of file diff --git a/include/d/d_item.h b/include/d/d_item.h new file mode 100644 index 000000000..ea2491d6b --- /dev/null +++ b/include/d/d_item.h @@ -0,0 +1,394 @@ +#ifndef D_ITEM_H +#define D_ITEM_H + +void execItemGet(unsigned char); +void checkItemGet(unsigned char, int); +void item_func_heart(); +void item_func_green_rupee(); +void item_func_blue_rupee(); +void item_func_white_rupee(); +void item_func_red_rupee(); +void item_func_purple_rupee(); +void item_func_orange_rupee(); +void item_func_kakera_heart(); +void item_func_utuwa_heart(); +void item_func_s_magic(); +void item_func_l_magic(); +void item_func_bomb_5(); +void item_func_bomb_10(); +void item_func_bomb_20(); +void item_func_bomb_30(); +void item_func_silver_rupee(); +void item_func_arrow_10(); +void item_func_arrow_20(); +void item_func_arrow_30(); +void item_func_small_key(); +void item_func_recover_faily(); +void item_func_subdun_rupee(); +void item_func_triple_heart(); +void item_func_pendant(); +void item_func_telescope(); +void item_func_tncl_whitsl(); +void item_func_wind_tact(); +void item_func_camera(); +void item_func_emono_bag(); +void item_func_rope(); +void item_func_camera2(); +void item_func_bow(); +void item_func_pwr_groove(); +void item_func_hvy_boots(); +void item_func_drgn_shield(); +void item_func_water_boots(); +void item_func_esa_bag(); +void item_func_boomerang(); +void item_func_bare_hand(); +void item_func_hookshot(); +void item_func_warasibe_bag(); +void item_func_bomb_bag(); +void item_func_fuku(); +void item_func_hummer(); +void item_func_deku_leaf(); +void item_func_magic_arrow(); +void item_func_light_arrow(); +void item_func_sword(); +void item_func_master_sword(); +void item_func_lv3_sword(); +void item_func_shield(); +void item_func_mirror_shield(); +void item_func_dropped_sword(); +void item_func_master_sword_ex(); +void item_func_pirates_omamori(); +void item_func_heros_omamori(); +void item_func_grass_ball(); +void item_func_skull_necklace(); +void item_func_bokobaba_seed(); +void item_func_golden_feather(); +void item_func_boko_belt(); +void item_func_red_jerry(); +void item_func_green_jerry(); +void item_func_blue_jerry(); +void item_func_map(); +void item_func_compass(); +void item_func_boss_key(); +void item_func_empty_bship(); +void item_func_empty_bottle(); +void item_func_red_bottle(); +void item_func_green_bottle(); +void item_func_blue_bottle(); +void item_func_bottleship(); +void item_func_soup_bottle(); +void item_func_bin_in_water(); +void item_func_fairy_bottle(); +void item_func_firefly_bottle(); +void item_func_fwater_bottle(); +void item_func_bin(); +void item_func_triforce1(); +void item_func_triforce2(); +void item_func_triforce3(); +void item_func_triforce4(); +void item_func_triforce5(); +void item_func_triforce6(); +void item_func_triforce7(); +void item_func_triforce8(); +void item_func_pearl1(); +void item_func_pearl2(); +void item_func_pearl3(); +void item_func_knowledge_tf(); +void item_func_tact_song1(); +void item_func_tact_song2(); +void item_func_tact_song3(); +void item_func_tact_song4(); +void item_func_tact_song5(); +void item_func_tact_song6(); +void item_func_normal_sail(); +void item_func_triforce_map1(); +void item_func_triforce_map2(); +void item_func_triforce_map3(); +void item_func_triforce_map4(); +void item_func_triforce_map5(); +void item_func_triforce_map6(); +void item_func_triforce_map7(); +void item_func_triforce_map8(); +void item_func_bird_esa_5(); +void item_func_animal_esa(); +void item_func_esa1(); +void item_func_esa2(); +void item_func_esa3(); +void item_func_esa4(); +void item_func_esa5(); +void item_func_magic_bean(); +void item_func_bird_esa_10(); +void item_func_flower_1(); +void item_func_flower_2(); +void item_func_flower_3(); +void item_func_heros_flag(); +void item_func_tairyo_flag(); +void item_func_sales_flag(); +void item_func_wind_flag(); +void item_func_red_flag(); +void item_func_fossil_head(); +void item_func_water_statue(); +void item_func_postman_statue(); +void item_func_president_statue(); +void item_func_letter00(); +void item_func_magic_seed(); +void item_func_magys_letter(); +void item_func_mo_letter(); +void item_func_cottage_paper(); +void item_func_kaisen_present1(); +void item_func_kaisen_present2(); +void item_func_salvage_item1(); +void item_func_salvage_item2(); +void item_func_salvage_item3(); +void item_func_xxx_039(); +void item_func_tincle_statue01(); +void item_func_tincle_statue02(); +void item_func_tincle_statue03(); +void item_func_tincle_statue04(); +void item_func_tincle_statue05(); +void item_func_tincle_statue06(); +void item_func_max_rupee_up1(); +void item_func_max_rupee_up2(); +void item_func_max_bomb_up1(); +void item_func_max_bomb_up2(); +void item_func_max_arrow_up1(); +void item_func_max_arrow_up2(); +void item_func_magic_power(); +void item_func_max_mp_up1(); +void item_func_tincle_rupee1(); +void item_func_tincle_rupee2(); +void item_func_tincle_rupee3(); +void item_func_tincle_rupee4(); +void item_func_tincle_rupee5(); +void item_func_tincle_rupee6(); +void item_func_lithograph1(); +void item_func_lithograph2(); +void item_func_lithograph3(); +void item_func_lithograph4(); +void item_func_lithograph5(); +void item_func_lithograph6(); +void item_func_collectmap64(); +void item_func_collectmap63(); +void item_func_collectmap62(); +void item_func_collectmap61(); +void item_func_collectmap60(); +void item_func_collectmap59(); +void item_func_collectmap58(); +void item_func_collectmap57(); +void item_func_collectmap56(); +void item_func_collectmap55(); +void item_func_collectmap54(); +void item_func_collectmap53(); +void item_func_collectmap52(); +void item_func_collectmap51(); +void item_func_collectmap50(); +void item_func_collectmap49(); +void item_func_collectmap48(); +void item_func_collectmap47(); +void item_func_collectmap46(); +void item_func_collectmap45(); +void item_func_collectmap44(); +void item_func_collectmap43(); +void item_func_collectmap42(); +void item_func_collectmap41(); +void item_func_collectmap40(); +void item_func_collectmap39(); +void item_func_collectmap38(); +void item_func_collectmap37(); +void item_func_collectmap36(); +void item_func_collectmap35(); +void item_func_collectmap34(); +void item_func_collectmap33(); +void item_func_collectmap32(); +void item_func_collectmap31(); +void item_func_collectmap30(); +void item_func_collectmap29(); +void item_func_collectmap28(); +void item_func_collectmap27(); +void item_func_collectmap26(); +void item_func_collectmap25(); +void item_func_collectmap24(); +void item_func_collectmap23(); +void item_func_collectmap22(); +void item_func_collectmap21(); +void item_func_collectmap20(); +void item_func_collectmap19(); +void item_func_collectmap18(); +void item_func_collectmap17(); +void item_func_collectmap16(); +void item_func_collectmap15(); +void item_func_collectmap14(); +void item_func_collectmap13(); +void item_func_collectmap12(); +void item_func_collectmap11(); +void item_func_collectmap10(); +void item_func_collectmap09(); +void item_func_collectmap08(); +void item_func_collectmap07(); +void item_func_collectmap06(); +void item_func_collectmap05(); +void item_func_collectmap04(); +void item_func_collectmap03(); +void item_func_collectmap02(); +void item_func_collectmap01(); +void item_func_noentry(); +void item_getcheck_func_heart(); +void item_getcheck_func_green_rupee(); +void item_getcheck_func_blue_rupee(); +void item_getcheck_func_white_rupee(); +void item_getcheck_func_red_rupee(); +void item_getcheck_func_purple_rupee(); +void item_getcheck_func_silver_rupee(); +void item_getcheck_func_kakera_heart(); +void item_getcheck_func_utuwa_heart(); +void item_getcheck_func_s_magic(); +void item_getcheck_func_l_magic(); +void item_getcheck_func_bomb_5(); +void item_getcheck_func_bomb_10(); +void item_getcheck_func_bomb_20(); +void item_getcheck_func_bomb_30(); +void item_getcheck_func_noentry(); +void item_getcheck_func_arrow_10(); +void item_getcheck_func_arrow_20(); +void item_getcheck_func_arrow_30(); +void item_getcheck_func_small_key(); +void item_getcheck_func_recover_faily(); +void item_getcheck_func_triple_heart(); +void item_getcheck_func_pendant(); +void item_getcheck_func_telescope(); +void item_getcheck_func_tncl_whitsl(); +void item_getcheck_func_wind_tact(); +void item_getcheck_func_camera(); +void item_getcheck_func_emono_bag(); +void item_getcheck_func_rope(); +void item_getcheck_func_camera2(); +void item_getcheck_func_bow(); +void item_getcheck_func_pwr_groove(); +void item_getcheck_func_hvy_boots(); +void item_getcheck_func_drgn_shield(); +void item_getcheck_func_water_boots(); +void item_getcheck_func_esa_bag(); +void item_getcheck_func_boomerang(); +void item_getcheck_func_bare_hand(); +void item_getcheck_func_hookshot(); +void item_getcheck_func_warasibe_bag(); +void item_getcheck_func_bomb_bag(); +void item_getcheck_func_hummer(); +void item_getcheck_func_deku_leaf(); +void item_getcheck_func_magic_arrow(); +void item_getcheck_func_light_arrow(); +void item_getcheck_func_sword(); +void item_getcheck_func_master_sword(); +void item_getcheck_func_lv3_sword(); +void item_getcheck_func_shield(); +void item_getcheck_func_mirror_shield(); +void item_getcheck_func_master_sword_ex(); +void item_getcheck_func_pirates_omamori(); +void item_getcheck_func_heros_omamori(); +void item_getcheck_func_grass_ball(); +void item_getcheck_func_skull_necklace(); +void item_getcheck_func_bokobaba_seed(); +void item_getcheck_func_golden_feather(); +void item_getcheck_func_boko_belt(); +void item_getcheck_func_red_jerry(); +void item_getcheck_func_green_jerry(); +void item_getcheck_func_blue_jerry(); +void item_getcheck_func_map(); +void item_getcheck_func_compass(); +void item_getcheck_func_boss_key(); +void item_getcheck_func_empty_bship(); +void item_getcheck_func_empty_bottle(); +void item_getcheck_func_red_bottle(); +void item_getcheck_func_green_bottle(); +void item_getcheck_func_blue_bottle(); +void item_getcheck_func_bottleship(); +void item_getcheck_func_bin_in_bottleship(); +void item_getcheck_func_bin_in_water(); +void item_getcheck_func_bin(); +void item_getcheck_func_triforce1(); +void item_getcheck_func_triforce2(); +void item_getcheck_func_triforce3(); +void item_getcheck_func_triforce4(); +void item_getcheck_func_triforce5(); +void item_getcheck_func_triforce6(); +void item_getcheck_func_triforce7(); +void item_getcheck_func_triforce8(); +void item_getcheck_func_pearl1(); +void item_getcheck_func_pearl2(); +void item_getcheck_func_pearl3(); +void item_getcheck_func_tact_song1(); +void item_getcheck_func_tact_song2(); +void item_getcheck_func_tact_song3(); +void item_getcheck_func_tact_song4(); +void item_getcheck_func_tact_song5(); +void item_getcheck_func_tact_song6(); +void item_getcheck_func_normal_sail(); +void item_getcheck_func_zora_sail(); +void item_getcheck_func_tincle_sail(); +void item_getcheck_func_sail(); +void item_getcheck_func_bird_esa_5(); +void item_getcheck_func_animal_esa(); +void item_getcheck_func_esa1(); +void item_getcheck_func_esa2(); +void item_getcheck_func_esa3(); +void item_getcheck_func_esa4(); +void item_getcheck_func_esa5(); +void item_getcheck_func_magic_bean(); +void item_getcheck_func_bird_esa_10(); +void item_getcheck_func_flower_1(); +void item_getcheck_func_flower_2(); +void item_getcheck_func_flower_3(); +void item_getcheck_func_heros_flag(); +void item_getcheck_func_tairyo_flag(); +void item_getcheck_func_sales_flag(); +void item_getcheck_func_wind_flag(); +void item_getcheck_func_red_flag(); +void item_getcheck_func_fossil_head(); +void item_getcheck_func_water_statue(); +void item_getcheck_func_postman_statue(); +void item_getcheck_func_president_statue(); +void item_getcheck_func_letter00(); +void item_getcheck_func_magic_seed(); +void item_getcheck_func_magys_letter(); +void item_getcheck_func_mo_letter(); +void item_getcheck_func_cottage_paper(); +void item_getcheck_func_kaisen_present1(); +void item_getcheck_func_kaisen_present2(); +void item_getcheck_func_salvage_item1(); +void item_getcheck_func_salvage_item2(); +void item_getcheck_func_salvage_item3(); +void item_getcheck_func_xxx_039(); +void item_getcheck_func_lithograph1(); +void item_getcheck_func_lithograph2(); +void item_getcheck_func_lithograph3(); +void item_getcheck_func_lithograph4(); +void item_getcheck_func_lithograph5(); +void item_getcheck_func_lithograph6(); +void item_getcheck_func_lithograph7(); +void item_getcheck_func_lithograph8(); +void item_getcheck_func_lithograph9(); +void item_getcheck_func_lithograph10(); +void item_getcheck_func_lithograph11(); +void item_getcheck_func_lithograph12(); +void item_getcheck_func_lithograph13(); +void item_getcheck_func_lithograph14(); +void item_getcheck_func_lithograph15(); +void item_getcheck_func_lithograph16(); +void getRotenItemNumInBag(); +void isDaizaItem(unsigned char); +void isBomb(unsigned char); +void isArrow(unsigned char); +void isEmono(unsigned char); +void isEsa(unsigned char); +void isRupee(unsigned char); +void isLimitedItem(unsigned char); +void isNonSavedEmono(unsigned char); +void isUseClothPacket(unsigned char); +void isTriforce(unsigned char); +void isHeart(unsigned char); +void getItemNoByLife(unsigned char); +void check_itemno(int); +void getEmonoItemFromLifeBallTable(unsigned short); +void getItemFromLifeBallTableWithoutEmono(unsigned short); + +#endif /* D_ITEM_H */ \ No newline at end of file diff --git a/include/d/d_item_data.h b/include/d/d_item_data.h new file mode 100644 index 000000000..382981ae0 --- /dev/null +++ b/include/d/d_item_data.h @@ -0,0 +1,300 @@ +#ifndef D_ITEM_DATA_H +#define D_ITEM_DATA_H + +#include "global.h" + +enum ItemTable { + /* 0x00 */ HEART, + /* 0x01 */ GREEN_RUPEE, + /* 0x02 */ BLUE_RUPEE, + /* 0x03 */ YELLOW_RUPEE, + /* 0x04 */ RED_RUPEE, + /* 0x05 */ PURPLE_RUPEE, + /* 0x06 */ ORANGE_RUPEE, + /* 0x07 */ KAKERA_HEART, + /* 0x08 */ UTUWA_HEART, + /* 0x09 */ S_MAGIC, + /* 0x0A */ L_MAGIC, + /* 0x0B */ BOMB_5, + /* 0x0C */ BOMB_10, + /* 0x0D */ BOMB_20, + /* 0x0E */ BOMB_30, + /* 0x0F */ SILVER_RUPEE, + /* 0x10 */ ARROW_10, + /* 0x11 */ ARROW_20, + /* 0x12 */ ARROW_30, + /* 0x13 */ noentry19, + /* 0x14 */ noentry20, + /* 0x15 */ SMALL_KEY, + /* 0x16 */ RECOVER_FAIRY, + /* 0x17 */ noentry23, + /* 0x18 */ noentry24, + /* 0x19 */ noentry25, + /* 0x1A */ SUB_DUN_RUPEE, + /* 0x1B */ noentry27, + /* 0x1C */ noentry28, + /* 0x1D */ noentry29, + /* 0x1E */ TRIPLE_HEART, + /* 0x1F */ PENDANT, + /* 0x20 */ TELESCOPE, + /* 0x21 */ TNCL_WHITSL, + /* 0x22 */ WIND_TACT, + /* 0x23 */ CAMERA, + /* 0x24 */ EMONO_BAG, + /* 0x25 */ ROPE, + /* 0x26 */ CAMERA2, + /* 0x27 */ BOW, + /* 0x28 */ PWR_GROOVE, + /* 0x29 */ HVY_BOOTS, + /* 0x2A */ DRGN_SHIELD, + /* 0x2B */ WATER_BOOTS, + /* 0x2C */ ESA_BAG, + /* 0x2D */ BOOMERANG, + /* 0x2E */ BARE_HAND, + /* 0x2F */ HOOKSHOT, + /* 0x30 */ WARASHIBE_BAG, + /* 0x31 */ BOMB_BAG, + /* 0x32 */ FUKU, + /* 0x33 */ HUMMER, + /* 0x34 */ DEKU_LEAF, + /* 0x35 */ MAGIC_ARROW, + /* 0x36 */ LIGHT_ARROW, + /* 0x37 */ noentry55, + /* 0x38 */ SWORD, + /* 0x39 */ MASTER_SWORD, + /* 0x3A */ LV3_SWORD, + /* 0x3B */ SHIELD, + /* 0x3C */ MIRROW_SHIELD, + /* 0x3D */ DROPPED_SWORD, + /* 0x3E */ MASTER_SWORD_EX, + /* 0x3F */ KAKERA_HEART2, + /* 0x40 */ noentry64, + /* 0x41 */ noentry65, + /* 0x42 */ PIRATES_OMAMORI, + /* 0x43 */ HEROS_OMAMORI, + /* 0x44 */ GRASS_BALL, + /* 0x45 */ SKULL_NECKLACE, + /* 0x46 */ BOKOBABA_SEED, + /* 0x47 */ GOLDEN_FEATHER, + /* 0x48 */ BOKO_BELT, + /* 0x49 */ RED_JELLY, + /* 0x4A */ GREEN_JELLY, + /* 0x4B */ BLUE_JELLY, + /* 0x4C */ MAP, + /* 0x4D */ COMPASS, + /* 0x4E */ BOSS_KEY, + /* 0x4F */ EMPTY_BSHIP, + /* 0x50 */ EMPTY_BOTTLE, + /* 0x51 */ RED_BOTTLE, + /* 0x52 */ GREEN_BOTTLE, + /* 0x53 */ BLUE_BOTTLE, + /* 0x54 */ BOTTLESHIP, + /* 0x55 */ SOUP_BOTTLE, + /* 0x56 */ BIN_IN_WATER, + /* 0x57 */ FAIRY_BOTTLE, + /* 0x58 */ FIREFLY_BOTTLE, + /* 0x59 */ FWATER_BOTTLE, + /* 0x5A */ UNK_BOTTLE_5A, + /* 0x5B */ UNK_BOTTLE_5B, + /* 0x5C */ UNK_BOTTLE_5C, + /* 0x5D */ UNK_BOTTLE_5D, + /* 0x5E */ UNK_BOTTLE_5E, + /* 0x5F */ UNK_BOTTLE_5F, + /* 0x60 */ UNK_BOTTLE_60, + /* 0x61 */ TRIFORCE1, + /* 0x62 */ TRIFORCE2, + /* 0x63 */ TRIFORCE3, + /* 0x64 */ TRIFORCE4, + /* 0x65 */ TRIFORCE5, + /* 0x66 */ TRIFORCE6, + /* 0x67 */ TRIFORCE7, + /* 0x68 */ TRIFORCE8, + /* 0x69 */ PEARL1, + /* 0x6A */ PEARL2, + /* 0x6B */ PEARL3, + /* 0x6C */ KNOWLEDGE_TF, + /* 0x6D */ TACT_SONG1, + /* 0x6E */ TACT_SONG2, + /* 0x6F */ TACT_SONG3, + /* 0x70 */ TACT_SONG4, + /* 0x71 */ TACT_SONG5, + /* 0x72 */ TACT_SONG6, + /* 0x73 */ noentry115, + /* 0x74 */ noentry116, + /* 0x75 */ noentry117, + /* 0x76 */ noentry118, + /* 0x77 */ noentry119, + /* 0x78 */ NORMAL_SAIL, + /* 0x79 */ TRIFORCE_MAP1, + /* 0x7A */ TRIFORCE_MAP2, + /* 0x7B */ TRIFORCE_MAP3, + /* 0x7C */ TRIFORCE_MAP4, + /* 0x7D */ TRIFORCE_MAP5, + /* 0x7E */ TRIFORCE_MAP6, + /* 0x7F */ TRIFORCE_MAP7, + /* 0x80 */ TRIFORCE_MAP8, + /* 0x81 */ noentry129, + /* 0x82 */ BIRD_ESA_5, + /* 0x83 */ ANIMAL_ESA, + /* 0x84 */ ESA1, + /* 0x85 */ ESA2, + /* 0x86 */ ESA3, + /* 0x87 */ ESA4, + /* 0x88 */ ESA5, + /* 0x89 */ MAGIC_BEAN, + /* 0x8A */ BIRD_ESA_10, + /* 0x8B */ noentry139, + /* 0x8C */ FLOWER_1, + /* 0x8D */ FLOWER_2, + /* 0x8E */ FLOWER_3, + /* 0x8F */ HEROS_FLAG, + /* 0x90 */ TAIRYO_FLAG, + /* 0x91 */ SALES_FLAG, + /* 0x92 */ WIND_FLAG, + /* 0x93 */ RED_FLAG, + /* 0x94 */ FOSSIL_HEAD, + /* 0x95 */ WATER_STATUE, + /* 0x96 */ POSTMAN_STATUE, + /* 0x97 */ PRESIDENT_STATUE, + /* 0x98 */ LETTER00, + /* 0x99 */ MAGIC_SEED, + /* 0x9A */ MAGYS_LETTER, + /* 0x9B */ MO_LETTER, + /* 0x9C */ COTTAGE_PAPER, + /* 0x9D */ KAISEN_PRESENT1, + /* 0x9E */ KAISEN_PRESENT2, + /* 0x9F */ SALVAGE_ITEM1, + /* 0xA0 */ SALVAGE_ITEM2, + /* 0xA1 */ SALVAGE_ITEM3, + /* 0xA2 */ XXX_039, + /* 0xA3 */ TINGLE_STATUE1, + /* 0xA4 */ TINGLE_STATUE2, + /* 0xA5 */ TINGLE_STATUE3, + /* 0xA6 */ TINGLE_STATUE4, + /* 0xA7 */ TINGLE_STATUE5, + /* 0xA8 */ TINGLE_STATUE6, + /* 0xA9 */ noentry169, + /* 0xAA */ noentry170, + /* 0xAB */ MAX_RUPEE_UP1, + /* 0xAC */ MAX_RUPEE_UP2, + /* 0xAD */ MAX_BOMB_UP1, + /* 0xAE */ MAX_BOMB_UP2, + /* 0xAF */ MAX_ARROW_UP1, + /* 0xB0 */ MAX_ARROW_UP2, + /* 0xB1 */ MAGIC_POWER, + /* 0xB2 */ MAX_MP_UP1, + /* 0xB3 */ TINCLE_RUPEE1, + /* 0xB4 */ TINCLE_RUPEE2, + /* 0xB5 */ TINCLE_RUPEE3, + /* 0xB6 */ TINCLE_RUPEE4, + /* 0xB7 */ TINCLE_RUPEE5, + /* 0xB8 */ TINCLE_RUPEE6, + /* 0xB9 */ LITHOGRAPH1, + /* 0xBA */ LITHOGRAPH2, + /* 0xBB */ LITHOGRAPH3, + /* 0xBC */ LITHOGRAPH4, + /* 0xBD */ LITHOGRAPH5, + /* 0xBE */ LITHOGRAPH6, + /* 0xBF */ COLLECT_MAP_64, + /* 0xC0 */ COLLECT_MAP_63, + /* 0xC1 */ COLLECT_MAP_62, + /* 0xC2 */ COLLECT_MAP_61, + /* 0xC3 */ COLLECT_MAP_60, + /* 0xC4 */ COLLECT_MAP_59, + /* 0xC5 */ COLLECT_MAP_58, + /* 0xC6 */ COLLECT_MAP_57, + /* 0xC7 */ COLLECT_MAP_56, + /* 0xC8 */ COLLECT_MAP_55, + /* 0xC9 */ COLLECT_MAP_54, + /* 0xCA */ COLLECT_MAP_53, + /* 0xCB */ COLLECT_MAP_52, + /* 0xCC */ COLLECT_MAP_51, + /* 0xCD */ COLLECT_MAP_50, + /* 0xCE */ COLLECT_MAP_49, + /* 0xCF */ COLLECT_MAP_48, + /* 0xD0 */ COLLECT_MAP_47, + /* 0xD1 */ COLLECT_MAP_46, + /* 0xD2 */ COLLECT_MAP_45, + /* 0xD3 */ COLLECT_MAP_44, + /* 0xD4 */ COLLECT_MAP_43, + /* 0xD5 */ COLLECT_MAP_42, + /* 0xD6 */ COLLECT_MAP_41, + /* 0xD7 */ COLLECT_MAP_40, + /* 0xD8 */ COLLECT_MAP_39, + /* 0xD9 */ COLLECT_MAP_38, + /* 0xDA */ COLLECT_MAP_37, + /* 0xDB */ COLLECT_MAP_36, + /* 0xDC */ COLLECT_MAP_35, + /* 0xDD */ COLLECT_MAP_34, + /* 0xDE */ COLLECT_MAP_33, + /* 0xDF */ COLLECT_MAP_32, + /* 0xE0 */ COLLECT_MAP_31, + /* 0xE1 */ COLLECT_MAP_30, + /* 0xE2 */ COLLECT_MAP_29, + /* 0xE3 */ COLLECT_MAP_28, + /* 0xE4 */ COLLECT_MAP_27, + /* 0xE5 */ COLLECT_MAP_26, + /* 0xE6 */ COLLECT_MAP_25, + /* 0xE7 */ COLLECT_MAP_24, + /* 0xE8 */ COLLECT_MAP_23, + /* 0xE9 */ COLLECT_MAP_22, + /* 0xEA */ COLLECT_MAP_21, + /* 0xEB */ COLLECT_MAP_20, + /* 0xEC */ COLLECT_MAP_19, + /* 0xED */ COLLECT_MAP_18, + /* 0xEE */ COLLECT_MAP_17, + /* 0xEF */ COLLECT_MAP_16, + /* 0xF0 */ COLLECT_MAP_15, + /* 0xF1 */ COLLECT_MAP_14, + /* 0xF2 */ COLLECT_MAP_13, + /* 0xF3 */ COLLECT_MAP_12, + /* 0xF4 */ COLLECT_MAP_11, + /* 0xF5 */ COLLECT_MAP_10, + /* 0xF6 */ COLLECT_MAP_09, + /* 0xF7 */ COLLECT_MAP_08, + /* 0xF8 */ COLLECT_MAP_07, + /* 0xF9 */ COLLECT_MAP_06, + /* 0xFA */ COLLECT_MAP_05, + /* 0xFB */ COLLECT_MAP_04, + /* 0xFC */ COLLECT_MAP_03, + /* 0xFD */ COLLECT_MAP_02, + /* 0xFE */ COLLECT_MAP_01, + /* 0xFF */ NO_ITEM, +}; + +struct dItem_data_item_resource { + /* 0x00 */ char* mModelArcName; + /* 0x04 */ char* mIconFilename; + /* 0x08 */ s16 mModelFileIdx; + /* 0x0A */ s16 mBtkFileIdx; + /* 0x0C */ s16 mBrkFileIdx; + /* 0x0E */ s16 field5_0xe; + /* 0x10 */ s16 field6_0x10; + /* 0x12 */ s16 field7_0x12; + /* 0x14 */ s8 mTevRegAnimFrameIndex; // If specified, keep the BRK animation on this frame. + /* 0x15 */ u8 field9_0x15; + /* 0x16 */ s16 mNameMessageId; + /* 0x18 */ u8 temp[8]; + /* 0x20 */ u16 mMaxHeapSize; + /* 0x22 */ u8 field20_0x22; + /* 0x23 */ u8 field21_0x23; +}; + +STATIC_ASSERT(sizeof(dItem_data_item_resource) == 0x24); + +struct dItem_data_item_info { + /* 0x00 */ u8 mMaybeShadowRelated; + /* 0x01 */ u8 mCollisionH; // Cylinder Height + /* 0x02 */ u8 mCollisionR; // Cylinder Radius + /* 0x03 */ u8 mSpecialBehaviors; +}; + +STATIC_ASSERT(sizeof(dItem_data_item_info) == 0x4); + +class dItem_data { +public: + static dItem_data_item_resource item_resource[0x100]; + static dItem_data_item_info item_info[0x100]; +}; + +#endif /* D_ITEM_DATA_H */ \ No newline at end of file diff --git a/include/d/d_save.h b/include/d/d_save.h index 242255468..0d0c8ac4f 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -4,265 +4,6 @@ #include "global.h" #include "SSystem/SComponent/c_xyz.h" -enum ItemTable { - /* 0x00 */ HEART, - /* 0x01 */ GREEN_RUPEE, - /* 0x02 */ BLUE_RUPEE, - /* 0x03 */ YELLOW_RUPEE, - /* 0x04 */ RED_RUPEE, - /* 0x05 */ PURPLE_RUPEE, - /* 0x06 */ ORANGE_RUPEE, - /* 0x07 */ KAKERA_HEART, - /* 0x08 */ UTUWA_HEART, - /* 0x09 */ S_MAGIC, - /* 0x0A */ L_MAGIC, - /* 0x0B */ BOMB_5, - /* 0x0C */ BOMB_10, - /* 0x0D */ BOMB_20, - /* 0x0E */ BOMB_30, - /* 0x0F */ SILVER_RUPEE, - /* 0x10 */ ARROW_10, - /* 0x11 */ ARROW_20, - /* 0x12 */ ARROW_30, - /* 0x13 */ noentry19, - /* 0x14 */ noentry20, - /* 0x15 */ SMALL_KEY, - /* 0x16 */ RECOVER_FAIRY, - /* 0x17 */ noentry23, - /* 0x18 */ noentry24, - /* 0x19 */ noentry25, - /* 0x1A */ SUB_DUN_RUPEE, - /* 0x1B */ noentry27, - /* 0x1C */ noentry28, - /* 0x1D */ noentry29, - /* 0x1E */ TRIPLE_HEART, - /* 0x1F */ PENDANT, - /* 0x20 */ TELESCOPE, - /* 0x21 */ TNCL_WHITSL, - /* 0x22 */ WIND_TACT, - /* 0x23 */ CAMERA, - /* 0x24 */ EMONO_BAG, - /* 0x25 */ ROPE, - /* 0x26 */ CAMERA2, - /* 0x27 */ BOW, - /* 0x28 */ PWR_GROOVE, - /* 0x29 */ HVY_BOOTS, - /* 0x2A */ DRGN_SHIELD, - /* 0x2B */ WATER_BOOTS, - /* 0x2C */ ESA_BAG, - /* 0x2D */ BOOMERANG, - /* 0x2E */ BARE_HAND, - /* 0x2F */ HOOKSHOT, - /* 0x30 */ WARASHIBE_BAG, - /* 0x31 */ BOMB_BAG, - /* 0x32 */ FUKU, - /* 0x33 */ HUMMER, - /* 0x34 */ DEKU_LEAF, - /* 0x35 */ MAGIC_ARROW, - /* 0x36 */ LIGHT_ARROW, - /* 0x37 */ noentry55, - /* 0x38 */ SWORD, - /* 0x39 */ MASTER_SWORD, - /* 0x3A */ LV3_SWORD, - /* 0x3B */ SHIELD, - /* 0x3C */ MIRROW_SHIELD, - /* 0x3D */ DROPPED_SWORD, - /* 0x3E */ MASTER_SWORD_EX, - /* 0x3F */ KAKERA_HEART2, - /* 0x40 */ noentry64, - /* 0x41 */ noentry65, - /* 0x42 */ PIRATES_OMAMORI, - /* 0x43 */ HEROS_OMAMORI, - /* 0x44 */ GRASS_BALL, - /* 0x45 */ SKULL_NECKLACE, - /* 0x46 */ BOKOBABA_SEED, - /* 0x47 */ GOLDEN_FEATHER, - /* 0x48 */ BOKO_BELT, - /* 0x49 */ RED_JELLY, - /* 0x4A */ GREEN_JELLY, - /* 0x4B */ BLUE_JELLY, - /* 0x4C */ MAP, - /* 0x4D */ COMPASS, - /* 0x4E */ BOSS_KEY, - /* 0x4F */ EMPTY_BSHIP, - /* 0x50 */ EMPTY_BOTTLE, - /* 0x51 */ RED_BOTTLE, - /* 0x52 */ GREEN_BOTTLE, - /* 0x53 */ BLUE_BOTTLE, - /* 0x54 */ BOTTLESHIP, - /* 0x55 */ SOUP_BOTTLE, - /* 0x56 */ BIN_IN_WATER, - /* 0x57 */ FAIRY_BOTTLE, - /* 0x58 */ FIREFLY_BOTTLE, - /* 0x59 */ FWATER_BOTTLE, - /* 0x5A */ UNK_BOTTLE_5A, - /* 0x5B */ UNK_BOTTLE_5B, - /* 0x5C */ UNK_BOTTLE_5C, - /* 0x5D */ UNK_BOTTLE_5D, - /* 0x5E */ UNK_BOTTLE_5E, - /* 0x5F */ UNK_BOTTLE_5F, - /* 0x60 */ UNK_BOTTLE_60, - /* 0x61 */ TRIFORCE1, - /* 0x62 */ TRIFORCE2, - /* 0x63 */ TRIFORCE3, - /* 0x64 */ TRIFORCE4, - /* 0x65 */ TRIFORCE5, - /* 0x66 */ TRIFORCE6, - /* 0x67 */ TRIFORCE7, - /* 0x68 */ TRIFORCE8, - /* 0x69 */ PEARL1, - /* 0x6A */ PEARL2, - /* 0x6B */ PEARL3, - /* 0x6C */ KNOWLEDGE_TF, - /* 0x6D */ TACT_SONG1, - /* 0x6E */ TACT_SONG2, - /* 0x6F */ TACT_SONG3, - /* 0x70 */ TACT_SONG4, - /* 0x71 */ TACT_SONG5, - /* 0x72 */ TACT_SONG6, - /* 0x73 */ noentry115, - /* 0x74 */ noentry116, - /* 0x75 */ noentry117, - /* 0x76 */ noentry118, - /* 0x77 */ noentry119, - /* 0x78 */ NORMAL_SAIL, - /* 0x79 */ TRIFORCE_MAP1, - /* 0x7A */ TRIFORCE_MAP2, - /* 0x7B */ TRIFORCE_MAP3, - /* 0x7C */ TRIFORCE_MAP4, - /* 0x7D */ TRIFORCE_MAP5, - /* 0x7E */ TRIFORCE_MAP6, - /* 0x7F */ TRIFORCE_MAP7, - /* 0x80 */ TRIFORCE_MAP8, - /* 0x81 */ noentry129, - /* 0x82 */ BIRD_ESA_5, - /* 0x83 */ ANIMAL_ESA, - /* 0x84 */ ESA1, - /* 0x85 */ ESA2, - /* 0x86 */ ESA3, - /* 0x87 */ ESA4, - /* 0x88 */ ESA5, - /* 0x89 */ MAGIC_BEAN, - /* 0x8A */ BIRD_ESA_10, - /* 0x8B */ noentry139, - /* 0x8C */ FLOWER_1, - /* 0x8D */ FLOWER_2, - /* 0x8E */ FLOWER_3, - /* 0x8F */ HEROS_FLAG, - /* 0x90 */ TAIRYO_FLAG, - /* 0x91 */ SALES_FLAG, - /* 0x92 */ WIND_FLAG, - /* 0x93 */ RED_FLAG, - /* 0x94 */ FOSSIL_HEAD, - /* 0x95 */ WATER_STATUE, - /* 0x96 */ POSTMAN_STATUE, - /* 0x97 */ PRESIDENT_STATUE, - /* 0x98 */ LETTER00, - /* 0x99 */ MAGIC_SEED, - /* 0x9A */ MAGYS_LETTER, - /* 0x9B */ MO_LETTER, - /* 0x9C */ COTTAGE_PAPER, - /* 0x9D */ KAISEN_PRESENT1, - /* 0x9E */ KAISEN_PRESENT2, - /* 0x9F */ SALVAGE_ITEM1, - /* 0xA0 */ SALVAGE_ITEM2, - /* 0xA1 */ SALVAGE_ITEM3, - /* 0xA2 */ XXX_039, - /* 0xA3 */ TINGLE_STATUE1, - /* 0xA4 */ TINGLE_STATUE2, - /* 0xA5 */ TINGLE_STATUE3, - /* 0xA6 */ TINGLE_STATUE4, - /* 0xA7 */ TINGLE_STATUE5, - /* 0xA8 */ TINGLE_STATUE6, - /* 0xA9 */ noentry169, - /* 0xAA */ noentry170, - /* 0xAB */ MAX_RUPEE_UP1, - /* 0xAC */ MAX_RUPEE_UP2, - /* 0xAD */ MAX_BOMB_UP1, - /* 0xAE */ MAX_BOMB_UP2, - /* 0xAF */ MAX_ARROW_UP1, - /* 0xB0 */ MAX_ARROW_UP2, - /* 0xB1 */ MAGIC_POWER, - /* 0xB2 */ MAX_MP_UP1, - /* 0xB3 */ TINCLE_RUPEE1, - /* 0xB4 */ TINCLE_RUPEE2, - /* 0xB5 */ TINCLE_RUPEE3, - /* 0xB6 */ TINCLE_RUPEE4, - /* 0xB7 */ TINCLE_RUPEE5, - /* 0xB8 */ TINCLE_RUPEE6, - /* 0xB9 */ LITHOGRAPH1, - /* 0xBA */ LITHOGRAPH2, - /* 0xBB */ LITHOGRAPH3, - /* 0xBC */ LITHOGRAPH4, - /* 0xBD */ LITHOGRAPH5, - /* 0xBE */ LITHOGRAPH6, - /* 0xBF */ COLLECT_MAP_64, - /* 0xC0 */ COLLECT_MAP_63, - /* 0xC1 */ COLLECT_MAP_62, - /* 0xC2 */ COLLECT_MAP_61, - /* 0xC3 */ COLLECT_MAP_60, - /* 0xC4 */ COLLECT_MAP_59, - /* 0xC5 */ COLLECT_MAP_58, - /* 0xC6 */ COLLECT_MAP_57, - /* 0xC7 */ COLLECT_MAP_56, - /* 0xC8 */ COLLECT_MAP_55, - /* 0xC9 */ COLLECT_MAP_54, - /* 0xCA */ COLLECT_MAP_53, - /* 0xCB */ COLLECT_MAP_52, - /* 0xCC */ COLLECT_MAP_51, - /* 0xCD */ COLLECT_MAP_50, - /* 0xCE */ COLLECT_MAP_49, - /* 0xCF */ COLLECT_MAP_48, - /* 0xD0 */ COLLECT_MAP_47, - /* 0xD1 */ COLLECT_MAP_46, - /* 0xD2 */ COLLECT_MAP_45, - /* 0xD3 */ COLLECT_MAP_44, - /* 0xD4 */ COLLECT_MAP_43, - /* 0xD5 */ COLLECT_MAP_42, - /* 0xD6 */ COLLECT_MAP_41, - /* 0xD7 */ COLLECT_MAP_40, - /* 0xD8 */ COLLECT_MAP_39, - /* 0xD9 */ COLLECT_MAP_38, - /* 0xDA */ COLLECT_MAP_37, - /* 0xDB */ COLLECT_MAP_36, - /* 0xDC */ COLLECT_MAP_35, - /* 0xDD */ COLLECT_MAP_34, - /* 0xDE */ COLLECT_MAP_33, - /* 0xDF */ COLLECT_MAP_32, - /* 0xE0 */ COLLECT_MAP_31, - /* 0xE1 */ COLLECT_MAP_30, - /* 0xE2 */ COLLECT_MAP_29, - /* 0xE3 */ COLLECT_MAP_28, - /* 0xE4 */ COLLECT_MAP_27, - /* 0xE5 */ COLLECT_MAP_26, - /* 0xE6 */ COLLECT_MAP_25, - /* 0xE7 */ COLLECT_MAP_24, - /* 0xE8 */ COLLECT_MAP_23, - /* 0xE9 */ COLLECT_MAP_22, - /* 0xEA */ COLLECT_MAP_21, - /* 0xEB */ COLLECT_MAP_20, - /* 0xEC */ COLLECT_MAP_19, - /* 0xED */ COLLECT_MAP_18, - /* 0xEE */ COLLECT_MAP_17, - /* 0xEF */ COLLECT_MAP_16, - /* 0xF0 */ COLLECT_MAP_15, - /* 0xF1 */ COLLECT_MAP_14, - /* 0xF2 */ COLLECT_MAP_13, - /* 0xF3 */ COLLECT_MAP_12, - /* 0xF4 */ COLLECT_MAP_11, - /* 0xF5 */ COLLECT_MAP_10, - /* 0xF6 */ COLLECT_MAP_09, - /* 0xF7 */ COLLECT_MAP_08, - /* 0xF8 */ COLLECT_MAP_07, - /* 0xF9 */ COLLECT_MAP_06, - /* 0xFA */ COLLECT_MAP_05, - /* 0xFB */ COLLECT_MAP_04, - /* 0xFC */ COLLECT_MAP_03, - /* 0xFD */ COLLECT_MAP_02, - /* 0xFE */ COLLECT_MAP_01, - /* 0xFF */ NO_ITEM, -}; - class dSv_player_status_a_c { public: /* 800589A8 */ void init(); diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index cf5231bd5..4d96fdf45 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -76,7 +76,7 @@ class mDoExt_brkAnm : public mDoExt_baseAnm { public: mDoExt_brkAnm() { mpAnm = 0; } /* 8000D70C */ int init(J3DMaterialTable* i_matTable, J3DAnmTevRegKey* i_brk, int i_anmPlay, - int i_attribute, f32 i_rate, s16 i_start, s16 param_6); + int i_attribute, f32 i_rate, s16 i_start, s16 i_end, bool i_modify, int i_entry); /* 8000D7A8 */ void entry(J3DMaterialTable* i_matTable, f32 i_frame); void entry(J3DModelData* i_modelData) { entry(i_modelData, getFrame()); } @@ -85,9 +85,9 @@ class mDoExt_brkAnm : public mDoExt_baseAnm { } int init(J3DModelData* i_modelData, J3DAnmTevRegKey* i_brk, int i_anmPlay, int i_attribute, - f32 i_rate, s16 i_start, s16 param_6) { + f32 i_rate, s16 i_start, s16 i_end, bool i_modify, int i_entry) { return init(&i_modelData->getMaterialTable(), i_brk, i_anmPlay, i_attribute, i_rate, - i_start, param_6); + i_start, i_end, i_modify, i_entry); } int remove(J3DModelData* i_modelData) { return i_modelData->removeTevRegAnimator(mpAnm); } diff --git a/src/d/actor/d_a_item.cpp b/src/d/actor/d_a_item.cpp index 4184f0625..c06fd40b2 100644 --- a/src/d/actor/d_a_item.cpp +++ b/src/d/actor/d_a_item.cpp @@ -3,12 +3,19 @@ // Translation Unit: d_a_item.cpp // -#include "d_a_item.h" +#include "d/d_item.h" +#include "d/d_item_data.h" +#include "d/actor/d_a_item.h" +#include "d/actor/d_a_player.h" +#include "d/d_com_inf_game.h" +#include "d/d_procname.h" #include "dolphin/types.h" +class dCcD_GObjInf; + /* 800F4BC8-800F4BD4 .text getData__12daItemBase_cFv */ -void daItemBase_c::getData() { - /* Nonmatching */ +daItemBase_c_m_data* daItemBase_c::getData() { + return &daItemBase_c::m_data; } /* 800F4BD4-800F4C4C .text setArrowTrans__Fs4cXyz */ @@ -17,8 +24,45 @@ void setArrowTrans(short, cXyz) { } /* 800F4C4C-800F4CD8 .text getYOffset__8daItem_cFv */ -void daItem_c::getYOffset() { - /* Nonmatching */ +float daItem_c::getYOffset() { + switch (m_itemNo) { + case HEART: + return 0.0; + case GREEN_RUPEE: + case BLUE_RUPEE: + case YELLOW_RUPEE: + case RED_RUPEE: + case PURPLE_RUPEE: + case ORANGE_RUPEE: + case SILVER_RUPEE: + return 0.0; + case KAKERA_HEART: + case UTUWA_HEART: + return 0.0; + case SMALL_KEY: + case BOSS_KEY: + return 0.0; + case SWORD: + return 20.0; + case SHIELD: + return 23.0; + case DROPPED_SWORD: + return 10.0; + case SKULL_NECKLACE: + return 0.0; + case BOKOBABA_SEED: + return 0.0; + case GOLDEN_FEATHER: + return 0.0; + case BOKO_BELT: + return 0.0; + case RED_JELLY: + case GREEN_JELLY: + case BLUE_JELLY: + return 0.0; + default: + return 0.0; + } } /* 800F4CD8-800F4E6C .text set_mtx__8daItem_cFv */ @@ -42,12 +86,12 @@ void daItem_c::CreateInit() { } /* 800F53EC-800F5668 .text _daItem_create__8daItem_cFv */ -void daItem_c::_daItem_create() { +s32 daItem_c::_daItem_create() { /* Nonmatching */ } /* 800F5668-800F5834 .text _daItem_execute__8daItem_cFv */ -void daItem_c::_daItem_execute() { +s32 daItem_c::_daItem_execute() { /* Nonmatching */ } @@ -102,7 +146,7 @@ void daItem_c::scaleAnimFromBossItem() { } /* 800F60C0-800F6110 .text _daItem_draw__8daItem_cFv */ -void daItem_c::_daItem_draw() { +s32 daItem_c::_daItem_draw() { /* Nonmatching */ } @@ -112,7 +156,7 @@ void daItem_c::setTevStr() { } /* 800F61C8-800F6268 .text _daItem_delete__8daItem_cFv */ -void daItem_c::_daItem_delete() { +s32 daItem_c::_daItem_delete() { /* Nonmatching */ } @@ -124,16 +168,43 @@ void Reflect(cXyz&, cXyz*, float, float) { /* 800F6434-800F6D24 .text itemGetExecute__8daItem_cFv */ void daItem_c::itemGetExecute() { /* Nonmatching */ + execItemGet(m_itemNo); } /* 800F6D24-800F6D78 .text itemDefaultRotateY__8daItem_cFv */ void daItem_c::itemDefaultRotateY() { - /* Nonmatching */ + // Rotates at a fixed speed. + s16 rotationSpeed = 0xFFFF / getData()->mNumFramesPerFullSpin; + fopAcM_addAngleY(this, current.angle.y + rotationSpeed, rotationSpeed); } /* 800F6D78-800F6E54 .text checkItemDisappear__8daItem_cFv */ -void daItem_c::checkItemDisappear() { - /* Nonmatching */ +bool daItem_c::checkItemDisappear() { + bool disappearing = true; + if (mCurAction == 3) { + disappearing = false; + show(); + } + if (mStatusFlags & 0x02) { + disappearing = false; + } + if (mStatusFlags & 0x10) { + disappearing = false; + } + if (dItem_data::item_info[m_itemNo].mSpecialBehaviors & 0x01) { + disappearing = false; + } + if (g_dComIfG_gameInfo.play.mEvtCtrl.mMode != 0) { + disappearing = false; + } + if (mCurAction == 4) { + disappearing = false; + } + if ((mStatusFlags & 0x08) || (mStatusFlags & 0x40) || (mStatus & 0x100000)) { + disappearing = false; + show(); + } + return disappearing; } /* 800F6E54-800F6E74 .text setItemTimer__8daItem_cFi */ @@ -142,7 +213,7 @@ void daItem_c::setItemTimer(int) { } /* 800F6E74-800F6EC8 .text checkPlayerGet__8daItem_cFv */ -void daItem_c::checkPlayerGet() { +bool daItem_c::checkPlayerGet() { /* Nonmatching */ } @@ -187,8 +258,16 @@ void daItem_c::set_bound_se() { } /* 800F7DDC-800F7E6C .text checkGetItem__8daItem_cFv */ -void daItem_c::checkGetItem() { +s32 daItem_c::checkGetItem() { /* Nonmatching */ + if (checkPlayerGet()) { + itemGetExecute(); + + return 1; + } + + mStatusFlags |= 0x08; + return 0; } /* 800F7E6C-800F7F0C .text timeCount__8daItem_cFv */ @@ -227,28 +306,28 @@ void daItem_Draw(daItem_c*) { } /* 800F8970-800F8990 .text daItem_Execute__FP8daItem_c */ -void daItem_Execute(daItem_c*) { - /* Nonmatching */ +s32 daItem_Execute(daItem_c* i_this) { + return i_this->_daItem_execute(); } /* 800F8990-800F89B0 .text daItem_IsDelete__FP8daItem_c */ -void daItem_IsDelete(daItem_c*) { - /* Nonmatching */ +s32 daItem_IsDelete(daItem_c* i_this) { + return i_this->_daItem_isdelete(); } /* 800F89B0-800F89D0 .text daItem_Delete__FP8daItem_c */ -void daItem_Delete(daItem_c*) { - /* Nonmatching */ +s32 daItem_Delete(daItem_c* i_this) { + return i_this->_daItem_delete(); } /* 800F89D0-800F89F0 .text daItem_Create__FP10fopAc_ac_c */ -void daItem_Create(fopAc_ac_c*) { +s32 daItem_Create(fopAc_ac_c* i_this) { /* Nonmatching */ } /* 800F89F0-800F89F8 .text _daItem_isdelete__8daItem_cFv */ -void daItem_c::_daItem_isdelete() { - /* Nonmatching */ +s32 daItem_c::_daItem_isdelete() { + return 1; } /* 800F89F8-800F8A14 .text getHeadTopPos__9daPy_py_cCFv */ @@ -256,3 +335,27 @@ void daPy_py_c::getHeadTopPos() const { /* Nonmatching */ } +static actor_method_class l_daItem_Method = { + (process_method_func)daItem_Create, + (process_method_func)daItem_Delete, + (process_method_func)daItem_Execute, + (process_method_func)daItem_IsDelete, + (process_method_func)daItem_Draw, +}; + +extern actor_process_profile_definition g_profile_ITEM = { + -3, + 7, + 0xFFFD, + PROC_ITEM, + &g_fpcLf_Method.mBase, + sizeof(daItem_c), + 0, + 0, + &g_fopAc_Method.base, + 0x00F5, + &l_daItem_Method, + 0x000C0100, + fopAc_ACTOR_e, + fopAc_CULLBOX_0_e, +}; diff --git a/src/d/actor/d_a_itembase.cpp b/src/d/actor/d_a_itembase.cpp index bc2e3d5b3..8641fa5df 100644 --- a/src/d/actor/d_a_itembase.cpp +++ b/src/d/actor/d_a_itembase.cpp @@ -3,27 +3,135 @@ // Translation Unit: d_a_itembase.cpp // -#include "d_a_itembase.h" +#include "d/actor/d_a_itembase.h" +#include "d/d_item_data.h" +#include "d/d_resorce.h" +#include "d/d_drawlist.h" +#include "m_Do/m_Do_ext.h" +#include "JSystem/JUtility/JUTAssert.h" +#include "d/d_item_data.h" +#include "d/d_com_inf_game.h" #include "dolphin/types.h" /* 800F8A14-800F8A3C .text DeleteBase__12daItemBase_cFPCc */ -void daItemBase_c::DeleteBase(const char*) { - /* Nonmatching */ +s32 daItemBase_c::DeleteBase(const char* resName) { + dComIfG_resDelete(&mPhs, resName); + return 1; } /* 800F8A3C-800F8A44 .text clothCreate__12daItemBase_cFv */ -void daItemBase_c::clothCreate() { - /* Nonmatching */ +s32 daItemBase_c::clothCreate() { + return 1; } /* 800F8A44-800F9074 .text CreateItemHeap__12daItemBase_cFPCcsssssss */ -void daItemBase_c::CreateItemHeap(const char*, short, short, short, short, short, short, short) { +s32 daItemBase_c::CreateItemHeap(const char* resName, short resIdx, short btkAnm1, short btkAnm2, short brkAnm1, short brkAnm2, short bckAnm, short) { /* Nonmatching */ + JUT_ASSERT(78, 0 <= m_itemNo && m_itemNo <= 255); + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(resName, resIdx); + JUT_ASSERT(85, modelData != 0); + + mModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203); + if (!mModel) { + return 0; + } + + switch (m_itemNo) { + case ARROW_30: + mModelArrow[0] = mDoExt_J3DModel__create(modelData, 8, 0x11000002); + if (!mModelArrow[0]) { + return 0; + } + case ARROW_20: + mModelArrow[1] = mDoExt_J3DModel__create(modelData, 8, 0x11000002); + if (!mModelArrow[1]) { + return 0; + } + break; + default: + mModelArrow[1] = NULL; + mModelArrow[0] = NULL; + } + + mBtkAnm1 = NULL; + if (btkAnm1 != -1) { + J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(resName, btkAnm1); + JUT_ASSERT(140, pbtk != 0); + mBtkAnm1 = new mDoExt_btkAnm(); + if (!mBtkAnm1 || !mBtkAnm1->init(modelData, pbtk, true, 2, 1.0, 0, -1, false, false)) { + return 0; + } + } + + mBtkAnm2 = NULL; + if (btkAnm2 != -1) { + J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(resName, btkAnm2); + JUT_ASSERT(172, pbtk != 0); + mBtkAnm2 = new mDoExt_btkAnm(); + if (!mBtkAnm2 || !mBtkAnm2->init(modelData, pbtk, true, 2, 1.0, 0, -1, false, false)) { + return 0; + } + } + + mBrkAnm1 = NULL; + if (brkAnm1 != -1) { + J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(resName, brkAnm1); + JUT_ASSERT(172, pbrk != 0); + int shouldAnimate = dItem_data::item_resource[m_itemNo].mTevRegAnimFrameIndex == 0xFF; + mBrkAnm1 = new mDoExt_brkAnm(); + if (!mBrkAnm1 || !mBrkAnm1->init(modelData, pbrk, shouldAnimate, 2, 1.0, 0, -1, false, false)) { + return 0; + } + } + + mBrkAnm2 = NULL; + if (brkAnm2 != -1) { + J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(resName, brkAnm2); + JUT_ASSERT(197, pbrk != 0); + mBrkAnm2 = new mDoExt_brkAnm(); + if (!mBrkAnm2 || !mBrkAnm2->init(modelData, pbrk, true, 2, 1.0, 0, -1, false, false)) { + return 0; + } + } + + mBckAnm = NULL; + if (bckAnm != -1) { + J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes(resName, bckAnm); + JUT_ASSERT(212, pbck != 0); + mBckAnm = new mDoExt_bckAnm(); + if (!mBckAnm || !mBckAnm->init(modelData, pbck, true, 2, 1.0, 0, -1, false)) { + return 0; + } + } + + if (!clothCreate()) { + return 0; + } + + return 1; } /* 800F9074-800F9130 .text DrawBase__12daItemBase_cFv */ -void daItemBase_c::DrawBase() { - /* Nonmatching */ +s32 daItemBase_c::DrawBase() { + setTevStr(); + animEntry(); + setListStart(); + settingBeforeDraw(); + + mDoExt_modelUpdateDL(mModel); + + if (mModelArrow[0]) { + mDoExt_modelUpdateDL(mModelArrow[0]); + } + if (mModelArrow[1]) { + mDoExt_modelUpdateDL(mModelArrow[1]); + } + + setListEnd(); + setShadow(); + + return 1; } /* 800F9130-800F9184 .text setListStart__12daItemBase_cFv */ @@ -54,6 +162,26 @@ void daItemBase_c::setShadow() { /* 800F93A8-800F94C0 .text animEntry__12daItemBase_cFv */ void daItemBase_c::animEntry() { /* Nonmatching */ + if (mBrkAnm1) { + int constantFrame = dItem_data::item_resource[m_itemNo].mTevRegAnimFrameIndex; + if (constantFrame != -1) { + mBrkAnm1->entry(mModel->getModelData(), constantFrame); + } else { + mBrkAnm1->entry(mModel->getModelData()); + } + } + if (mBtkAnm1) { + mBtkAnm1->entry(mModel->getModelData()); + } + if (mBrkAnm2) { + mBrkAnm2->entry(mModel->getModelData()); + } + if (mBtkAnm2) { + mBtkAnm2->entry(mModel->getModelData()); + } + if (mBckAnm) { + mBckAnm->entry(mModel->getModelData()); + } } /* 800F94C0-800F95B8 .text animPlay__12daItemBase_cFfffff */ diff --git a/src/d/actor/d_a_itembase_static.cpp b/src/d/actor/d_a_itembase_static.cpp index d51d00455..5ea11b66a 100644 --- a/src/d/actor/d_a_itembase_static.cpp +++ b/src/d/actor/d_a_itembase_static.cpp @@ -3,7 +3,7 @@ // Translation Unit: d_a_itembase_static.cpp // -#include "d_a_itembase_static.h" +#include "d/actor/d_a_itembase_static.h" #include "dolphin/types.h" /* 80068650-80068658 .text getItemNo__12daItemBase_cFv */