diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2024-12-10 08:46:19 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-10 18:46:19 +0200 |
| commit | 8d73439554beb2b4870b86159aa2e676357792b7 (patch) | |
| tree | f146d56805cdbbf0ee01412b66d328396d2b0305 /include | |
| parent | 3fa6b50e6ab76f8d6fed3c92a70084db2f0e221e (diff) | |
tbox/camera/d_bg_w_kcol work and cleanup (#2262)
* some camera/tbox cleanup
* d_bg_w_kcol work
* make item name enum better
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/actor/d_a_alink.h | 12 | ||||
| -rw-r--r-- | include/d/actor/d_a_midna.h | 2 | ||||
| -rw-r--r-- | include/d/actor/d_a_player.h | 98 | ||||
| -rw-r--r-- | include/d/actor/d_a_tag_lantern.h | 2 | ||||
| -rw-r--r-- | include/d/actor/d_a_tbox.h | 4 | ||||
| -rw-r--r-- | include/d/d_bg_pc.h | 89 | ||||
| -rw-r--r-- | include/d/d_bg_plc.h | 18 | ||||
| -rw-r--r-- | include/d/d_bg_w_kcol.h | 53 | ||||
| -rw-r--r-- | include/d/d_cam_param.h | 4 | ||||
| -rw-r--r-- | include/d/d_camera.h | 127 | ||||
| -rw-r--r-- | include/d/d_drawlist.h | 4 | ||||
| -rw-r--r-- | include/d/d_save.h | 272 | ||||
| -rw-r--r-- | include/d/d_stage.h | 4 | ||||
| -rw-r--r-- | include/f_op/f_op_actor_mng.h | 20 | ||||
| -rw-r--r-- | include/f_pc/f_pc_name.h | 270 |
15 files changed, 553 insertions, 426 deletions
diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h index 90c6e75e45..80e2a93183 100644 --- a/include/d/actor/d_a_alink.h +++ b/include/d/actor/d_a_alink.h @@ -1321,7 +1321,7 @@ public: /* 800D0CDC */ virtual ~hsChainShape_c(); }; // Size: 0x10 - /* 8009D87C */ bool getE3Zhint(); + /* 8009D87C */ static BOOL getE3Zhint(); /* 8009D884 */ static const char* getAlinkArcName(); /* 8009DA60 */ static bool checkStageName(char const*); /* 8009DA98 */ void tgHitCallback(fopAc_ac_c*, dCcD_GObjInf*, dCcD_GObjInf*); @@ -3215,10 +3215,10 @@ public: return checkHookshotReadyAnime() || checkHookshotShootAnime(); } BOOL checkBoomerangReadyAnime() const { - return (mEquipItem == BOOMERANG || mEquipItem == noentry71) && checkUpperAnime(0x54); + return (mEquipItem == fpcNm_ITEM_BOOMERANG || mEquipItem == 0x102) && checkUpperAnime(0x54); } bool checkDkCaught2Anime() const { return checkUpperAnime(0x262); } - BOOL checkCopyRodThrowAnime() const { return mEquipItem == COPY_ROD && checkUpperAnime(0x53); } + BOOL checkCopyRodThrowAnime() const { return mEquipItem == fpcNm_ITEM_COPY_ROD && checkUpperAnime(0x53); } BOOL checkCutDashChargeAnime() const { return checkUpperAnime(0x83); } BOOL checkBoomerangAnimeAndReturnWait() const { return checkBoomerangAnime(); } BOOL checkTwoHandItemEquipAnime() const { return checkUpperAnime(0x245); } @@ -3249,7 +3249,7 @@ public: bool checkIronBallSwingAnime() const { return checkUpperAnime(0x19B); } bool checkDashDamageAnime() const { return checkUpperAnime(0xAD); } bool checkBoomerangCatchAnime() const { return checkUpperAnime(0x52); } - BOOL checkCopyRodReadyAnime() const { return mEquipItem == COPY_ROD && checkUpperAnime(0x54); } + BOOL checkCopyRodReadyAnime() const { return mEquipItem == fpcNm_ITEM_COPY_ROD && checkUpperAnime(0x54); } BOOL checkCanoeFishingWaitAnime() const { return checkUpperAnime(0x5D) || checkUpperAnime(0x260); } BOOL checkCopyRodControllAnime() const { return checkUpperAnime(0x202); } BOOL checkWolfHeadDamageAnime() const { return checkUpperAnime(0x2A7); } @@ -3262,7 +3262,7 @@ public: bool swordButton() { return itemButtonCheck(8); } daPy_actorKeep_c* getThrowBoomerangAcKeep() { return &mThrowBoomerangAcKeep; } s32 getStartRoomNo() { return fopAcM_GetParam(this) & 0x3F; } - bool checkFisingRodLure() const { return mEquipItem == noentry73; } + bool checkFisingRodLure() const { return mEquipItem == 0x105; } BOOL doTrigger() const { return mItemTrigger & BTN_A; } bool swordTrigger() { return itemTriggerCheck(BTN_B); } BOOL grassCancelTrigger() { return itemTriggerCheck(BTN_B); } @@ -3439,7 +3439,7 @@ public: void setGrassCancelStatus(u8 param_0) { setBStatus(param_0); } void seStartSystem(u32 i_seID) { mDoAud_seStart(i_seID, NULL, 0, 0); } - bool checkIronBallEquip() const { return mEquipItem == IRONBALL; } + bool checkIronBallEquip() const { return mEquipItem == fpcNm_ITEM_IRONBALL; } f32 getAnmSpeedStickRate(f32 param_0, f32 param_1) const { return param_0 + (field_0x33a8 * (param_1 - param_0)); diff --git a/include/d/actor/d_a_midna.h b/include/d/actor/d_a_midna.h index cc67587b7f..c1077de6f8 100644 --- a/include/d/actor/d_a_midna.h +++ b/include/d/actor/d_a_midna.h @@ -363,7 +363,7 @@ public: void resetRatBody() {} - bool checkFlyWaitAnime() { + bool checkFlyWaitAnime() const { return mBckHeap[0].getIdx() == 0x1CB || mBckHeap[0].getIdx() == 0x1C7 || mBckHeap[0].getIdx() == 0x1C8 || mBckHeap[0].getIdx() == 0x1C9; } diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 8f95de926d..cc948dc7a8 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -140,7 +140,103 @@ class daBoomerang_c; class daPy_demo_c { public: enum { - DEMO_LAST_e = 0x5F, + DEMO_UNK_0_e, + DEMO_UNK_1_e, + DEMO_UNK_2_e, + DEMO_UNK_3_e, + DEMO_UNK_4_e, + DEMO_WAIT_TURN_e, + DEMO_UNK_6_e, + DEMO_UNK_7_e, + DEMO_UNK_8_e, + DEMO_UNK_9_e, + DEMO_OPEN_TREASURE_e, + DEMO_GET_ITEM_e, + DEMO_UNEQUIP_e, + DEMO_GRAB_PUT_e, + DEMO_UNK_14_e, + DEMO_UNK_15_e, + DEMO_UNK_16_e, + DEMO_UNK_17_e, + DEMO_UNK_18_e, + DEMO_MONKEY_MOVE_e, + DEMO_LOOK_AROUND_e, + DEMO_UNK_21_e, + DEMO_UNK_22_e, + DEMO_UNK_23_e, + DEMO_UNK_24_e, + DEMO_TURN_BACK_e, + DEMO_UNK_26_e, + DEMO_UNK_27_e, + DEMO_BOOMERANG_CATCH_e, + DEMO_HAWK_CATCH_e, + DEMO_SWORD_UNEQUIP_SP_e, + DEMO_UNK_31_e, + DEMO_PUSH_PULL_WAIT_e, + DEMO_PUSH_MOVE_e, + DEMO_BOSS_ATN_WAIT_e, + DEMO_DOOR_OPEN_e, + DEMO_UNK_36_e, + DEMO_TRADE_ITEM_OUT_e, + DEMO_UNK_38_e, + DEMO_KANDELAAR_SWING_e, + DEMO_FRONT_ROLL_e, + DEMO_CROUCH_e, + DEMO_UNK_42_e, + DEMO_UNK_43_e, + DEMO_UNK_44_e, + DEMO_UNK_45_e, + DEMO_CAUGHT_e, + DEMO_LOOK_UP_e, + DEMO_LOOK_UP_TO_GET_ITEM_e, + DEMO_HAND_PAT_e, + DEMO_WOLF_MIDNA_RIDE_SHOCK_e, + DEMO_SUMOU_SHIKO_e, + DEMO_FOG_DEAD_e, + DEMO_WOLF_SMELL_WAIT_e, + DEMO_UNK_54_e, + DEMO_UNK_55_e, + DEMO_WOLF_CARGO_CARRY_e, + DEMO_METAMORPHOSE_UNK1_e, + DEMO_METAMORPHOSE_UNK2_e, + DEMO_HORSE_GET_KEY_e, + DEMO_NOD_e, + DEMO_GLARE_e, + DEMO_EYE_AWAY_e, + DEMO_GOAT_STOP_READY_e, + DEMO_GET_READY_SIT_e, + DEMO_UNK_65_e, + DEMO_TWGATE_e, + DEMO_FM_CHAIN_STRONG_PULL_e, + DEMO_WOLF_SNOW_ESCAPE_e, + DEMO_ZORA_MOVE_e, + DEMO_METAMORPHOSE_ONLY_UNK1_e, + DEMO_METAMORPHOSE_ONLY_UNK2_e, + DEMO_LOOK_AROUND_TURN_e, + DEMO_UNK_73_e, + DEMO_QUAKE_INIT_e, + DEMO_GUARD_ATTACK_e, + DEMO_SWORD_READY_e, + DEMO_DUNGEON_WARP_e, + DEMO_DUNGEON_WARP_SCENE_START_e, + DEMO_MASTER_SWORD_STICK_e, + DEMO_MASTER_SWORD_PULL_e, + DEMO_CUT_DOWN_e, + DEMO_UNK_82_e, + DEMO_CUT_HEAD_e, + DEMO_UNK_84_e, + DEMO_UNK_85_e, + DEMO_CUT_LARGE_JUMP_e, + DEMO_CUT_FAST_READY_e, + DEMO_COPY_ROD_REVIVE_e, + DEMO_SWORD_PUSH_e, + DEMO_GANON_FINISH_e, + DEMO_UNK_91_e, + DEMO_UNK_92_e, + DEMO_HORSE_LOOK_DOWN_e, + DEMO_UNK_94_e, + DEMO_LAST_e, + DEMO_NEW_ANM0_e = 0x200, }; diff --git a/include/d/actor/d_a_tag_lantern.h b/include/d/actor/d_a_tag_lantern.h index faf04d85f9..87127fb43c 100644 --- a/include/d/actor/d_a_tag_lantern.h +++ b/include/d/actor/d_a_tag_lantern.h @@ -17,7 +17,7 @@ public: BOOL rt = false; if (fopAcM_searchPlayerDistanceXZ(this) < scale.x && 0.0f <= var_f31 && var_f31 < scale.y) { - rt = dComIfGp_checkItemGet(KANTERA, 1) && dComIfGs_getOil() != 0; + rt = dComIfGp_checkItemGet(fpcNm_ITEM_KANTERA, 1) && dComIfGs_getOil() != 0; field_0x5f8 = rt == true ? 0 : 1; } else { rt = true; diff --git a/include/d/actor/d_a_tbox.h b/include/d/actor/d_a_tbox.h index 5dc4763ddf..2987743ece 100644 --- a/include/d/actor/d_a_tbox.h +++ b/include/d/actor/d_a_tbox.h @@ -143,7 +143,7 @@ public: void action() { (this->*mpActionFn)(); } private: - /* 0x718 */ bool field_0x718; + /* 0x718 */ u8 field_0x718; /* 0x71C */ request_of_phase_process_class mPhase; /* 0x724 */ J3DModel* mpModel; /* 0x728 */ J3DModel* mpSlimeModel; @@ -151,7 +151,7 @@ private: /* 0x730 */ J3DModel* mpEffectModel; /* 0x734 */ mDoExt_brkAnm* mpEffectAnm; /* 0x738 */ dBgW* mpOpenBgW; - /* 0x73C */ dBgW* mpBgCollider; + /* 0x73C */ dBgW* mpBgCollision; /* 0x740 */ daTbox_actionFn mpActionFn; /* 0x74C */ int mStaffId; /* 0x750 */ f32 field_0x750; diff --git a/include/d/d_bg_pc.h b/include/d/d_bg_pc.h index f2fd07d1e0..9a27765da5 100644 --- a/include/d/d_bg_pc.h +++ b/include/d/d_bg_pc.h @@ -11,63 +11,52 @@ struct sBgPc { /* 0x10 */ u32 code4; }; // Size: 0x14 -enum dBgPc_ECode { - /* 0x00004000 */ CODE_OBJ_THRU = 0x4000, - /* 0x00008000 */ CODE_CAM_THRU = 0x8000, - /* 0x00010000 */ CODE_LINK_THRU = 0x10000, - /* 0x00020000 */ CODE_ARROW_THRU = 0x20000, - /* 0x00040000 */ CODE_HS_STICK = 0x40000, - /* 0x00080000 */ CODE_BOOMERANG_THRU = 0x80000, - /* 0x00100000 */ CODE_ROPE_THRU = 0x100000, - /* 0x00200000 */ CODE_HORSE_NO_ENTRY = 0x200000, - /* 0x00400000 */ CODE_SHDW_THRU = 0x400000, - /* 0x00800000 */ CODE_BOMB_THRU = 0x800000, - /* 0x01000000 */ CODE_IRON_BALL_THRU = 0x1000000, - /* 0x02000000 */ CODE_ATTACK_THRU = 0x2000000, - /* 0x40000000 */ CODE_UNDERWATER_ROOF = 0x40000000, -}; +#define BGPC_GET_BITS(code, shift, bits) \ + ((code >> shift) & ((1 << bits) - 1)) + +#define BGPC_CHECK_BIT(code, bit) \ + (code & (1 << bit)) class dBgPc { public: void setCode(sBgPc&); + + u8 getExit() const { return BGPC_GET_BITS(m_code.code0, 0, 6); } + u8 getPolyCol() const { return BGPC_GET_BITS(m_code.code0, 6, 8); } + u32 getObjThrough() const { return BGPC_CHECK_BIT(m_code.code0, 14); } + u32 getCamThrough() const { return BGPC_CHECK_BIT(m_code.code0, 15); } + u32 getLinkThrough() const { return BGPC_CHECK_BIT(m_code.code0, 16); } + u32 getArrowThrough() const { return BGPC_CHECK_BIT(m_code.code0, 17); } + u32 getHSStick() const { return BGPC_CHECK_BIT(m_code.code0, 18); } + u32 getBoomerangThrough() const { return BGPC_CHECK_BIT(m_code.code0, 19); } + u32 getRopeThrough() const { return BGPC_CHECK_BIT(m_code.code0, 20); } + u32 getHorseNoEntry() const { return BGPC_CHECK_BIT(m_code.code0, 21) != 0; } + u32 getShdwThrough() const { return BGPC_CHECK_BIT(m_code.code0, 22); } + u32 getBombThrough() const { return BGPC_CHECK_BIT(m_code.code0, 23); } + s32 getSpl() const { return BGPC_GET_BITS(m_code.code0, 24, 4); } + u32 getMagnet() const { return BGPC_GET_BITS(m_code.code0, 28, 2); } + u32 getUnderwaterRoof() const { return BGPC_CHECK_BIT(m_code.code0, 30); } + u32 getMonkeyBars() const { return BGPC_CHECK_BIT(m_code.code0, 31) != 0; } + + u8 getLinkNo() const { return BGPC_GET_BITS(m_code.code1, 0, 8); } + s32 getWallCode() const { return BGPC_GET_BITS(m_code.code1, 8, 4); } + u32 getAtt0Code() const { return BGPC_GET_BITS(m_code.code1, 12, 4); } + u32 getAtt1Code() const { return BGPC_GET_BITS(m_code.code1, 16, 3); } + u32 getGroundCode() const { return BGPC_GET_BITS(m_code.code1, 19, 5); } + u32 getIronBallThrough() const { return BGPC_CHECK_BIT(m_code.code1, 24); } + u32 getAttackThrough() const { return BGPC_CHECK_BIT(m_code.code1, 25); } - u32 getHorseNoEntry() const { return m_code.code0 >> 0x15 & 1; } - s32 getSpl() const { return m_code.code0 >> 0x18 & 0xF; } - u32 getMagnet() const { return m_code.code0 >> 0x1C & 0x3; } - u32 getMonkeyBars() const { return m_code.code0 >> 0x1F; } - s32 getWallCode() const { return m_code.code1 >> 0x8 & 0xF; } - u32 getAtt0Code() const { return m_code.code1 >> 0xC & 0xF; } - u32 getAtt1Code() const { return m_code.code1 >> 0x10 & 0x7; } - u32 getGroundCode() const { return m_code.code1 >> 0x13 & 0x1F; } - u32 getObjThrough() const { return m_code.code0 & CODE_OBJ_THRU; } - u32 getCamThrough() const { return m_code.code0 & CODE_CAM_THRU; } - u32 getLinkThrough() const { return m_code.code0 & CODE_LINK_THRU; } - u32 getArrowThrough() const { return m_code.code0 & CODE_ARROW_THRU; } - u32 getHSStick() const { return m_code.code0 & CODE_HS_STICK; } - u32 getBoomerangThrough() const { return m_code.code0 & CODE_BOOMERANG_THRU; } - u32 getRopeThrough() const { return m_code.code0 & CODE_ROPE_THRU; } - u32 getBombThrough() const { return m_code.code0 & CODE_BOMB_THRU; } - u32 getIronBallThrough() const { return m_code.code1 & CODE_IRON_BALL_THRU; } - u32 getShdwThrough() const { return m_code.code0 & CODE_SHDW_THRU; } - u32 getUnderwaterRoof() const { return m_code.code0 & CODE_UNDERWATER_ROOF; } - u32 getAttackThrough() const { return m_code.code1 & CODE_ATTACK_THRU; } - u8 getRoom() const { return m_code.code4 >> 0x14; } - u8 getExit() const { return m_code.code0 & 0x3F; } - u8 getPolyCol() const { return m_code.code0 >> 6; } - u8 getLinkNo() const { return m_code.code1; } - u8 getCamMoveBG() const { return m_code.code2; } - u8 getRoomCam() const { return m_code.code2 >> 8; } - u8 getRoomPath() const { return m_code.code2 >> 0x10; } - u8 getRoomPathPnt() const { return m_code.code2 >> 0x18; } - u8 getRoomInf() const { return m_code.code4; } - u8 getSnd() const { return m_code.code4 >> 0xB; } - u32 maskNrm() { return m_code.code4 & 0x100; } + u8 getCamMoveBG() const { return BGPC_GET_BITS(m_code.code2, 0, 8); } + u8 getRoomCam() const { return BGPC_GET_BITS(m_code.code2, 8, 8); } + u8 getRoomPath() const { return BGPC_GET_BITS(m_code.code2, 16, 8); } + u8 getRoomPathPnt() const { return BGPC_GET_BITS(m_code.code2, 24, 8); } + u8 getRoomInf() const { return BGPC_GET_BITS(m_code.code4, 0, 8); } + u32 maskNrm() { return BGPC_CHECK_BIT(m_code.code4, 8); } // BUG: Seems like this uses the same mask as maskNrm - u32 getWtr() { return m_code.code4 & 0x100; } - u32 getObjThrough() { return m_code.code0 & 0x4000; } - u32 getCamThrough() { return m_code.code0 & 0x8000; } - u32 getLinkThrough() { return m_code.code0 & 0x10000; } + u32 getWtr() { return BGPC_CHECK_BIT(m_code.code4, 8); } + u8 getSnd() const { return BGPC_GET_BITS(m_code.code4, 11, 8); } + u8 getRoom() const { return BGPC_GET_BITS(m_code.code4, 20, 8); } /* 0x0 */ sBgPc m_code; }; diff --git a/include/d/d_bg_plc.h b/include/d/d_bg_plc.h index 9823f3367e..997f71da7e 100644 --- a/include/d/d_bg_plc.h +++ b/include/d/d_bg_plc.h @@ -3,15 +3,11 @@ #include "d/d_bg_pc.h" -enum { - /* 0x14 */ ZELDA_CODE_SIZE = 0x14 -}; - -struct PLC { - /* 0x0 */ u32 magic; - /* 0x4 */ u16 m_code_size; - /* 0x6 */ u16 m_num; - /* 0x8 */ sBgPc field_0x8[0]; +struct sBgPlc { + /* 0x0 */ u32 magic; // "SPLC" + /* 0x4 */ u16 m_code_size; // Should normally always be 0x14 + /* 0x6 */ u16 m_num; // Number of sBgPc entries to follow + /* 0x8 */ sBgPc m_code[0]; // m_num size array }; class dBgPlc { @@ -22,8 +18,10 @@ public: /* 800740C4 */ sBgPc* getCode(int, sBgPc**) const; /* 800740DC */ u32 getGrpCode(int) const; + static const int ZELDA_CODE_SIZE = sizeof(sBgPc); + private: - /* 0x00 */ PLC* m_base; + /* 0x00 */ sBgPlc* m_base; }; #endif /* D_BG_D_BG_PLC_H */ diff --git a/include/d/d_bg_w_kcol.h b/include/d/d_bg_w_kcol.h index d8716e31cd..2e08ab82c1 100644 --- a/include/d/d_bg_w_kcol.h +++ b/include/d/d_bg_w_kcol.h @@ -1,6 +1,7 @@ #ifndef D_BG_D_BG_W_KCOL_H #define D_BG_D_BG_W_KCOL_H +#include "JSystem/JUtility/JUTAssert.h" #include "SSystem/SComponent/c_m3d_g_aab.h" #include "d/d_bg_plc.h" #include "d/d_bg_w_base.h" @@ -11,35 +12,28 @@ struct dBgPc; struct dBgS_CaptPoly; struct KC_PrismData { - /* 0x0 */ f32 field_0x0; - /* 0x4 */ u16 field_0x4; - /* 0x6 */ u16 field_0x6; - /* 0x8 */ u16 field_0x8; - /* 0xA */ u16 field_0xa; - /* 0xC */ u16 field_0xc; - /* 0xE */ u16 field_0xe; + /* 0x0 */ f32 height; + /* 0x4 */ u16 pos_i; + /* 0x6 */ u16 fnrm_i; + /* 0x8 */ u16 enrm1_i; + /* 0xA */ u16 enrm2_i; + /* 0xC */ u16 enrm3_i; + /* 0xE */ u16 attribute; }; // Size: 0x10 -struct pkcdata { - /* 0x00 */ Vec* field_0x0; - /* 0x04 */ Vec* field_0x4; +struct KC_Header { + /* 0x00 */ Vec* m_pos_data; + /* 0x04 */ Vec* m_nrm_data; /* 0x08 */ KC_PrismData* m_prism_data; /* 0x0C */ KC_PrismData* m_block_data; - /* 0x10 */ u8 field_0x10[4]; + /* 0x10 */ f32 m_prism_thickness; /* 0x14 */ Vec m_area_min_pos; - /* 0x20 */ u32 field_0x20; - /* 0x24 */ u32 field_0x24; - /* 0x28 */ u32 field_0x28; - /* 0x2C */ u32 field_0x2c; - /* 0x30 */ u32 field_0x30; - /* 0x34 */ u32 field_0x34; -}; - -struct KCol_Header { - /* 0x0 */ u32 pos_data_offset; - /* 0x4 */ u32 nrm_data_offset; - /* 0x8 */ u32 prism_data_offset; - /* 0xC */ u32 block_data_offset; + /* 0x20 */ u32 m_area_x_width_mask; + /* 0x24 */ u32 m_area_y_width_mask; + /* 0x28 */ u32 m_area_z_width_mask; + /* 0x2C */ u32 m_block_width_shift; + /* 0x30 */ u32 m_area_x_blocks_shift; + /* 0x34 */ u32 m_area_xy_blocks_shift; }; class dBgWKCol : public dBgW_Base { @@ -113,11 +107,16 @@ public: /* 80082F94 */ virtual void MatrixCrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*); - KC_PrismData* getPrismData(int poly_index) const { return &m_pkc_head->m_prism_data[poly_index]; } - void getTri1Pos(KC_PrismData* pd, Vec** nrm) const { *nrm = &m_pkc_head->field_0x0[pd->field_0x4]; } + KC_PrismData* getPrismData(int poly_index) const { + KC_PrismData* pd = &m_pkc_head->m_prism_data[poly_index]; + JUT_ASSERT(0x12E, pd < (KC_PrismData*)m_pkc_head->m_block_data); + return pd; + } + + void getTri1Pos(KC_PrismData* pd, Vec** nrm) const { *nrm = &m_pkc_head->m_pos_data[pd->pos_i]; } private: - /* 0x18 */ pkcdata* m_pkc_head; + /* 0x18 */ KC_Header* m_pkc_head; /* 0x1C */ dBgPlc m_code; /* 0x20 */ cM3dGAab m_bnd; }; diff --git a/include/d/d_cam_param.h b/include/d/d_cam_param.h index 170c3223b8..48cfa63238 100644 --- a/include/d/d_cam_param.h +++ b/include/d/d_cam_param.h @@ -106,7 +106,7 @@ public: int Algorythmn() { return mCurrentStyle->field_0x4; } bool Flag(s32 param_0, u16 param_1) { return mCamStyleData[param_0].field_0x6 & param_1; } - /* 8008858C */ virtual ~dCamParam_c() {} + /* 8008858C */ virtual ~dCamParam_c(); }; class dCamSetup_c { @@ -202,7 +202,7 @@ public: /* 0x0F8 */ f32 field_0xf8; /* 0x0FC vtable */ - /* 800888B8 */ virtual ~dCamSetup_c() {} + /* 800888B8 */ virtual ~dCamSetup_c(); /* 0x100 */ dCstick_c mCStick; /* 0x114 */ dCamBGChk_c mBGChk; diff --git a/include/d/d_camera.h b/include/d/d_camera.h index eb0d120644..9d71570798 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -51,7 +51,7 @@ struct dCamMapToolData { struct dCamForcusLine { /* 801824C8 */ void Init(); /* 80182560 */ void Draw(); - /* 801825E4 */ void Off(); + /* 801825E4 */ bool Off(); /* 0x00 */ dDlst_effectLine_c mEffectLine; /* 0x38 */ cXyz field_0x38; @@ -227,13 +227,15 @@ public: }; struct Shake { - /* 0x00 */ u8 field_0x0[12]; - /* 0x0C */ int field_0xc; + /* 0x00 */ u8 field_0x0[4]; + /* 0x04 */ u8 field_0x4[4]; + /* 0x08 */ u8 field_0x8[0xC - 0x8]; + /* 0x0C */ s32 m_length; /* 0x10 */ int field_0x10; /* 0x14 */ u8 field_0x14[4]; - /* 0x18 */ cXyz field_0x18; + /* 0x18 */ cXyz m_pos; /* 0x24 */ cXyz field_0x24; - /* 0x30 */ cXyz field_0x30; + /* 0x30 */ cXyz mEyeShake; /* 0x3C */ f32 field_0x3c; /* 0x40 */ cSAngle field_0x40; }; // Size: 0x44 @@ -254,37 +256,37 @@ public: /* 800894C4 */ fopAc_ac_c* getEvActor(char*); /* 800895F4 */ fopAc_ac_c* getEvActor(char*, char*); /* 80089730 */ int pauseEvCamera(); - /* 800897E8 */ void fixedFrameEvCamera(); - /* 8008A510 */ void stokerEvCamera(); - /* 8008A974 */ void rollingEvCamera(); - /* 8008B9B0 */ void fixedPositionEvCamera(); - /* 8008BE2C */ void uniformTransEvCamera(); - /* 8008BE50 */ void uniformBrakeEvCamera(); - /* 8008BE74 */ void uniformAcceleEvCamera(); + /* 800897E8 */ int fixedFrameEvCamera(); + /* 8008A510 */ int stokerEvCamera(); + /* 8008A974 */ int rollingEvCamera(); + /* 8008B9B0 */ int fixedPositionEvCamera(); + /* 8008BE2C */ int uniformTransEvCamera(); + /* 8008BE50 */ int uniformBrakeEvCamera(); + /* 8008BE74 */ int uniformAcceleEvCamera(); /* 8008BE98 */ void transEvCamera(int); - /* 8008E938 */ void watchActorEvCamera(); - /* 8008FAE8 */ void restorePosEvCamera(); - /* 80090174 */ void talktoEvCamera(); + /* 8008E938 */ int watchActorEvCamera(); + /* 8008FAE8 */ int restorePosEvCamera(); + /* 80090174 */ int talktoEvCamera(); /* 80090230 */ bool maptoolIdEvCamera(); - /* 80090478 */ bool styleEvCamera(); - /* 80090514 */ void gameOverEvCamera(); - /* 80091468 */ void tactEvCamera(); - /* 800923B8 */ bool turnToActorEvCamera(); - /* 800923C0 */ bool stbWaitEvCamera(); - /* 800924D0 */ bool saveEvCamera(); - /* 8009258C */ void loadEvCamera(); - /* 800929AC */ void useItem0EvCamera(); - /* 800937AC */ void useItem1EvCamera(); - /* 80094240 */ void getItemEvCamera(); - /* 80094A70 */ void possessedEvCamera(); - /* 80095010 */ void fixedFramesEvCamera(); - /* 8009544C */ void bSplineEvCamera(); - /* 800956E4 */ void twoActor0EvCamera(); - /* 80095E7C */ void peepHoleEvCamera(); - /* 80095FD0 */ void digHoleEvCamera(); - /* 800965AC */ void hintTalkEvCamera(); - /* 80096EDC */ void bspTransEvCamera(); - /* 80097694 */ bool portalWarpEvCamera(); + /* 80090478 */ int styleEvCamera(); + /* 80090514 */ int gameOverEvCamera(); + /* 80091468 */ int tactEvCamera(); + /* 800923B8 */ int turnToActorEvCamera(); + /* 800923C0 */ int stbWaitEvCamera(); + /* 800924D0 */ int saveEvCamera(); + /* 8009258C */ int loadEvCamera(); + /* 800929AC */ int useItem0EvCamera(); + /* 800937AC */ int useItem1EvCamera(); + /* 80094240 */ int getItemEvCamera(); + /* 80094A70 */ int possessedEvCamera(); + /* 80095010 */ int fixedFramesEvCamera(); + /* 8009544C */ int bSplineEvCamera(); + /* 800956E4 */ int twoActor0EvCamera(); + /* 80095E7C */ int peepHoleEvCamera(); + /* 80095FD0 */ int digHoleEvCamera(); + /* 800965AC */ int hintTalkEvCamera(); + /* 80096EDC */ int bspTransEvCamera(); + /* 80097694 */ int portalWarpEvCamera(); /* 8009771C */ cXyz attentionPos(fopAc_ac_c*); /* 80097738 */ cSAngle directionOf(fopAc_ac_c*); /* 8009775C */ cXyz positionOf(fopAc_ac_c*); @@ -334,7 +336,7 @@ public: /* 80165104 */ void setUSOAngle(); /* 80165158 */ cSAngle getUSOAngle(cSAngle); /* 8016517C */ bool pointInSight(cXyz*); - /* 80167C24 */ void radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*); + /* 80167C24 */ f32 radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*); /* 80165238 */ f32 radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*, cXyz*, cXyz*, f32, s16, f32); /* 801657EC */ f32 groundHeight(cXyz*); /* 801658C0 */ bool lineBGCheck(cXyz*, cXyz*, dBgS_LinChk*, u32); @@ -346,8 +348,8 @@ public: /* 80165FB4 */ void setView(f32, f32, f32, f32); /* 8016608C */ cSAngle forwardCheckAngle(); /* 80166764 */ void bumpCheck(u32); - /* 80167BF8 */ void lineBGCheckBoth(cXyz*, cXyz*, dBgS_LinChk*, u32); - /* 80167CD8 */ void jutOutCheck(cXyz*, f32); + /* 80167BF8 */ bool lineBGCheckBoth(cXyz*, cXyz*, dBgS_LinChk*, u32); + /* 80167CD8 */ BOOL jutOutCheck(cXyz*, f32); /* 80167E3C */ void tooNearEscape(cXyz*); /* 80167EF4 */ f32 getWaterSurfaceHeight(cXyz*); /* 80167FEC */ void checkGroundInfo(); @@ -376,20 +378,20 @@ public: /* 8017E730 */ bool fixedPositionCamera(s32); /* 8017F25C */ bool oneSideCamera(s32); /* 8017F828 */ bool eventCamera(s32); - /* 8018050C */ void currentEvCamera(); + /* 8018050C */ int currentEvCamera(); /* 801806D4 */ bool letCamera(s32); /* 801806DC */ void setEventRecoveryTrans(s16); /* 80180738 */ void runEventRecoveryTrans(); /* 80180A40 */ void EventRecoverNotime(); - /* 80180AA8 */ void Set(cXyz, cXyz); - /* 80180AE0 */ void Set(cXyz, cXyz, f32, s16); - /* 80180B40 */ void Set(cXyz, cXyz, s16, f32); + /* 80180AA8 */ int Set(cXyz, cXyz); + /* 80180AE0 */ int Set(cXyz, cXyz, f32, s16); + /* 80180B40 */ int Set(cXyz, cXyz, s16, f32); /* 80180C18 */ void Reset(cXyz, cXyz); - /* 80180C68 */ void Reset(); + /* 80180C68 */ int Reset(); /* 80180BA0 */ void Reset(cXyz, cXyz, f32, s16); - /* 80180D24 */ void shakeCamera(); - /* 80181000 */ void StartShake(s32, u8*, s32, cXyz); - /* 80181158 */ void StopShake(); + /* 80180D24 */ f32 shakeCamera(); + /* 80181000 */ int StartShake(s32, u8*, s32, cXyz); + /* 80181158 */ int StopShake(); /* 80181170 */ void StartBlure(int, fopAc_ac_c*, f32, f32); /* 801811B8 */ void ResetBlure(); /* 80181208 */ void SetBlureAlpha(f32); @@ -399,9 +401,9 @@ public: /* 80181280 */ void blureCamera(); /* 80181490 */ void onHorseDush(); /* 80181500 */ fopAc_ac_c* GetForceLockOnActor(); - /* 80181534 */ void ForceLockOn(fopAc_ac_c*); - /* 80181560 */ void ForceLockOff(fpc_ProcID); - /* 8018159C */ void ForceLockOff(fopAc_ac_c*); + /* 80181534 */ int ForceLockOn(fopAc_ac_c*); + /* 80181560 */ int ForceLockOff(fpc_ProcID); + /* 8018159C */ int ForceLockOff(fopAc_ac_c*); /* 80181E20 */ cXyz Up(); /* 80181E64 */ cXyz Eye(); /* 80181E98 */ cXyz Center(); @@ -438,6 +440,20 @@ public: attn.LockSoundOn(); } + void SetWindow(f32 param_0, f32 param_1) { + field_0x914 = param_0; + field_0x918 = param_1; + field_0x92c = param_0 / param_1; + } + + s16 U2() { + if (chkFlag(0x10)) { + return field_0x5c.field_0x0.U(); + } else { + return field_0x8c; + } + } + static engine_fn engine_tbl[]; /* 0x000 */ camera_class* field_0x0; @@ -506,7 +522,7 @@ public: /* 0x18C */ u32 field_0x18c; /* 0x190 */ int field_0x190; /* 0x194 */ bool field_0x194; - /* 0x198 */ u32 mLockOnActorID; + /* 0x198 */ fpc_ProcID mLockOnActorID; /* 0x19C */ fopAc_ac_c* mpLockOnActor; /* 0x1A0 */ int mForceLockTimer; /* 0x1A4 */ int mCurMode; @@ -590,13 +606,13 @@ public: /* 0x00 */ u8 field_0x0[4]; /* 0x04 */ int field_0x4; /* 0x08 */ csXyz field_0x8; - /* 0x10 */ fopAc_ac_c* field_0x10; + /* 0x10 */ fopAc_ac_c* mpActor; /* 0x14 */ int field_0x14; - /* 0x18 */ cXyz mBlurePosition; - /* 0x24 */ cXyz mBlureScale; + /* 0x18 */ cXyz mPosition; + /* 0x24 */ cXyz mScale; + /* 0x30 */ f32 mAlpha; } - /* 0x700 */ field_0x700; - /* 0x730 */ f32 mBlureAlpha; + /* 0x700 */ mBlure; /* 0x734 */ f32 field_0x734; /* 0x738 */ f32 field_0x738; /* 0x73C */ f32 field_0x73c; @@ -621,7 +637,8 @@ public: /* 0x860 */ dCamMapToolData field_0x860; /* 0x89C */ dCamMapToolData field_0x89c; /* 0x8D8 */ dCamMapToolData field_0x8d8; - /* 0x914 */ u8 field_0x914[0x91c - 0x914]; + /* 0x914 */ f32 field_0x914; + /* 0x918 */ f32 field_0x918; /* 0x91C */ f32 field_0x91c; /* 0x920 */ f32 mTrimHeight; /* 0x924 */ int mTrimSize; diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 3ef7369e60..ace4cf2ab8 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -53,6 +53,10 @@ public: f32 getRndValue(f32 param_0, f32 param_1) { return mRnd.getValue(param_0, param_1); } f32 getRndFX(f32 param_0) { return mRnd.getFX(param_0); } + void initRnd(int r0, int r1, int r2) { + mRnd.init(r0, r1, r2); + } + private: /* 0x04 */ cM_rnd_c mRnd; /* 0x10 */ cXyz field_0x10; diff --git a/include/d/d_save.h b/include/d/d_save.h index c4d961f771..6e6d832c56 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -5,6 +5,7 @@ #include "SSystem/SComponent/c_xyz.h" #include "dolphin/os/OSTime.h" #include "global.h" +#include "f_pc/f_pc_name.h" #define DEFAULT_SELECT_ITEM_INDEX 0 #define MAX_SELECT_ITEM 4 @@ -73,277 +74,6 @@ enum ItemSlots { /* 0x17 */ SLOT_23 }; -enum ItemTable { - /* 0x0000 */ HEART, - /* 0x0001 */ GREEN_RUPEE, - /* 0x0002 */ BLUE_RUPEE, - /* 0x0003 */ YELLOW_RUPEE, - /* 0x0004 */ RED_RUPEE, - /* 0x0005 */ PURPLE_RUPEE, - /* 0x0006 */ ORANGE_RUPEE, - /* 0x0007 */ SILVER_RUPEE, - /* 0x0008 */ S_MAGIC, - /* 0x0009 */ L_MAGIC, - /* 0x000A */ BOMB_5, - /* 0x000B */ BOMB_10, - /* 0x000C */ BOMB_20, - /* 0x000D */ BOMB_30, - /* 0x000E */ ARROW_10, - /* 0x000F */ ARROW_20, - /* 0x0010 */ ARROW_30, - /* 0x0011 */ ARROW_1, - /* 0x0012 */ PACHINKO_SHOT, - /* 0x0013 */ noentry1, - /* 0x0014 */ noentry2, - /* 0x0015 */ noentry3, - /* 0x0016 */ WATER_BOMB_5, - /* 0x0017 */ WATER_BOMB_10, - /* 0x0018 */ WATER_BOMB_20, - /* 0x0019 */ WATER_BOMB_30, - /* 0x001A */ BOMB_INSECT_5, - /* 0x001B */ BOMB_INSECT_10, - /* 0x001C */ BOMB_INSECT_20, - /* 0x001D */ BOMB_INSECT_30, - /* 0x001E */ RECOVERY_FAILY, - /* 0x001F */ TRIPLE_HEART, - /* 0x0020 */ SMALL_KEY, - /* 0x0021 */ KAKERA_HEART, - /* 0x0022 */ UTAWA_HEART, - /* 0x0023 */ MAP, - /* 0x0024 */ COMPUS, - /* 0x0025 */ DUNGEON_EXIT, - /* 0x0026 */ BOSS_KEY, - /* 0x0027 */ DUNGEON_BACK, - /* 0x0028 */ SWORD, - /* 0x0029 */ MASTER_SWORD, - /* 0x002A */ WOOD_SHIELD, - /* 0x002B */ SHIELD, - /* 0x002C */ HYLIA_SHIELD, - /* 0x002D */ TKS_LETTER, - /* 0x002E */ WEAR_CASUAL, - /* 0x002F */ WEAR_KOKIRI, - /* 0x0030 */ ARMOR, - /* 0x0031 */ WEAR_ZORA, - /* 0x0032 */ MAGIC_LV1, - /* 0x0033 */ DUNGEON_EXIT_2, - /* 0x0034 */ WALLET_LV1, - /* 0x0035 */ WALLET_LV2, - /* 0x0036 */ WALLET_LV3, - /* 0x0037 */ noentry4, - /* 0x0038 */ noentry5, - /* 0x0039 */ noentry6, - /* 0x003A */ noentry7, - /* 0x003B */ noentry8, - /* 0x003C */ noentry9, - /* 0x003D */ ZORAS_JEWEL, - /* 0x003E */ HAWK_EYE, - /* 0x003F */ WOOD_STICK, - /* 0x0040 */ BOOMERANG, - /* 0x0041 */ SPINNER, - /* 0x0042 */ IRONBALL, - /* 0x0043 */ BOW, - /* 0x0044 */ HOOKSHOT, - /* 0x0045 */ HVY_BOOTS, - /* 0x0046 */ COPY_ROD, - /* 0x0047 */ W_HOOKSHOT, - /* 0x0048 */ KANTERA, - /* 0x0049 */ LIGHT_SWORD, - /* 0x004A */ FISHING_ROD_1, - /* 0x004B */ PACHINKO, - /* 0x004C */ COPY_ROD_2, - /* 0x004D */ noentry10, - /* 0x004E */ noentry11, - /* 0x004F */ BOMB_BAG_LV2, - /* 0x0050 */ BOMB_BAG_LV1, - /* 0x0051 */ BOMB_IN_BAG, - /* 0x0052 */ noentry12, - /* 0x0053 */ LIGHT_ARROW, - /* 0x0054 */ ARROW_LV1, - /* 0x0055 */ ARROW_LV2, - /* 0x0056 */ ARROW_LV3, - /* 0x0057 */ noentry13, - /* 0x0058 */ LURE_ROD, - /* 0x0059 */ BOMB_ARROW, - /* 0x005A */ HAWK_ARROW, - /* 0x005B */ BEE_ROD, - /* 0x005C */ JEWEL_ROD, - /* 0x005D */ WORM_ROD, - /* 0x005E */ JEWEL_BEE_ROD, - /* 0x005F */ JEWEL_WORM_ROD, - /* 0x0060 */ EMPTY_BOTTLE, - /* 0x0061 */ RED_BOTTLE, - /* 0x0062 */ GREEN_BOTTLE, - /* 0x0063 */ BLUE_BOTTLE, - /* 0x0064 */ MILK_BOTTLE, - /* 0x0065 */ HALF_MILK_BOTTLE, - /* 0x0066 */ OIL_BOTTLE, - /* 0x0067 */ WATER_BOTTLE, - /* 0x0068 */ OIL_BOTTLE_2, - /* 0x0069 */ RED_BOTTLE_2, - /* 0x006A */ UGLY_SOUP, - /* 0x006B */ HOT_SPRING, - /* 0x006C */ FAIRY, - /* 0x006D */ HOT_SPRING_2, - /* 0x006E */ OIL2, - /* 0x006F */ OIL, - /* 0x0070 */ NORMAL_BOMB, - /* 0x0071 */ WATER_BOMB, - /* 0x0072 */ POKE_BOMB, - /* 0x0073 */ FAIRY_DROP, - /* 0x0074 */ WORM, - /* 0x0075 */ DROP_BOTTLE, - /* 0x0076 */ BEE_CHILD, - /* 0x0077 */ CHUCHU_RARE, - /* 0x0078 */ CHUCHU_RED, - /* 0x0079 */ CHUCHU_BLUE, - /* 0x007A */ CHUCHU_GREEN, - /* 0x007B */ CHUCHU_YELLOW, - /* 0x007C */ CHUCHU_PURPLE, - /* 0x007D */ LV1_SOUP, - /* 0x007E */ LV2_SOUP, - /* 0x007F */ LV3_SOUP, - /* 0x0080 */ LETTER, - /* 0x0081 */ BILL, - /* 0x0082 */ WOOD_STATUE, - /* 0x0083 */ IRIAS_PENDANT, - /* 0x0084 */ HORSE_FLUTE, - /* 0x0085 */ noentry14, - /* 0x0086 */ noentry15, - /* 0x0087 */ noentry16, - /* 0x0088 */ noentry17, - /* 0x0089 */ noentry18, - /* 0x008A */ noentry19, - /* 0x008B */ noentry20, - /* 0x008C */ noentry21, - /* 0x008D */ noentry22, - /* 0x008E */ noentry23, - /* 0x008F */ noentry24, - /* 0x0090 */ RAFRELS_MEMO, - /* 0x0091 */ ASHS_SCRIBBLING, - /* 0x0092 */ noentry25, - /* 0x0093 */ noentry26, - /* 0x0094 */ noentry27, - /* 0x0095 */ noentry28, - /* 0x0096 */ noentry29, - /* 0x0097 */ noentry30, - /* 0x0098 */ noentry31, - /* 0x0099 */ noentry32, - /* 0x009A */ noentry33, - /* 0x009B */ noentry34, - /* 0x009C */ CHUCHU_YELLOW2, - /* 0x009D */ OIL_BOTTLE3, - /* 0x009E */ SHOP_BEE_CHILD, - /* 0x009F */ CHUCHU_BLACK, - /* 0x00A0 */ LIGHT_DROP, - /* 0x00A1 */ DROP_CONTAINER, - /* 0x00A2 */ DROP_CONTAINER02, - /* 0x00A3 */ DROP_CONTAINER03, - /* 0x00A4 */ FILLED_CONTAINER, - /* 0x00A5 */ MIRROR_PIECE_2, - /* 0x00A6 */ MIRROR_PIECE_3, - /* 0x00A7 */ MIRROR_PIECE_4, - /* 0x00A8 */ noentry35, - /* 0x00A9 */ noentry36, - /* 0x00AA */ noentry37, - /* 0x00AB */ noentry38, - /* 0x00AC */ noentry39, - /* 0x00AD */ noentry40, - /* 0x00AE */ noentry41, - /* 0x00AF */ noentry42, - /* 0x00B0 */ SMELL_YELIA_POUCH, - /* 0x00B1 */ SMELL_PUMPKIN, - /* 0x00B2 */ SMELL_POH, - /* 0x00B3 */ SMELL_FISH, - /* 0x00B4 */ SMELL_CHILDREN, - /* 0x00B5 */ SMELL_MEDICINE, - /* 0x00B6 */ noentry43, - /* 0x00B7 */ noentry44, - /* 0x00B8 */ noentry45, - /* 0x00B9 */ noentry46, - /* 0x00BA */ noentry47, - /* 0x00BB */ noentry48, - /* 0x00BC */ noentry49, - /* 0x00BD */ noentry50, - /* 0x00BE */ noentry51, - /* 0x00BF */ noentry52, - /* 0x00C0 */ M_BEETLE, - /* 0x00C1 */ F_BEETLE, - /* 0x00C2 */ M_BUTTERFLY, - /* 0x00C3 */ F_BUTTERFLY, - /* 0x00C4 */ M_STAG_BEETLE, - /* 0x00C5 */ F_STAG_BEETLE, - /* 0x00C6 */ M_GRASSHOPPER, - /* 0x00C7 */ F_GRASSHOPPER, - /* 0x00C8 */ M_NANAFUSHI, - /* 0x00C9 */ F_NANAFUSHI, - /* 0x00CA */ M_DANGOMUSHI, - /* 0x00CB */ F_DANGOMUSHI, - /* 0x00CC */ M_MANTIS, - /* 0x00CD */ F_MANTIS, - /* 0x00CE */ M_LADYBUG, - /* 0x00CF */ F_LADYBUG, - /* 0x00D0 */ M_SNAIL, - /* 0x00D1 */ F_SNAIL, - /* 0x00D2 */ M_DRAGONFLY, - /* 0x00D3 */ F_DRAGONFLY, - /* 0x00D4 */ M_ANT, - /* 0x00D5 */ F_ANT, - /* 0x00D6 */ M_MAYFLY, - /* 0x00D7 */ F_MAYFLY, - /* 0x00D8 */ noentry53, - /* 0x00D9 */ noentry54, - /* 0x00DA */ noentry55, - /* 0x00DB */ noentry56, - /* 0x00DC */ noentry57, - /* 0x00DD */ noentry58, - /* 0x00DE */ noentry59, - /* 0x00DF */ noentry60, - /* 0x00E0 */ POU_SPIRIT, - /* 0x00E1 */ noentry61, - /* 0x00E2 */ noentry62, - /* 0x00E3 */ noentry63, - /* 0x00E4 */ noentry64, - /* 0x00E5 */ noentry65, - /* 0x00E6 */ noentry66, - /* 0x00E7 */ noentry67, - /* 0x00E8 */ noentry68, - /* 0x00E9 */ ANCIENT_DOCUMENT, - /* 0x00EA */ AIR_LETTER, - /* 0x00EB */ ANCIENT_DOCUMENT2, - /* 0x00EC */ LV7_DUNGEON_EXIT, - /* 0x00ED */ LINKS_SAVINGS, - /* 0x00EE */ SMALL_KEY2, - /* 0x00EF */ POU_FIRE1, - /* 0x00F0 */ POU_FIRE2, - /* 0x00F1 */ POU_FIRE3, - /* 0x00F2 */ POU_FIRE4, - /* 0x00F3 */ BOSSRIDER_KEY, - /* 0x00F4 */ TOMATO_PUREE, - /* 0x00F5 */ TASTE, - /* 0x00F6 */ LV5_BOSS_KEY, - /* 0x00F7 */ SURFBOARD, - /* 0x00F8 */ KANTERA2, - /* 0x00F9 */ L2_KEY_PIECES1, - /* 0x00FA */ L2_KEY_PIECES2, - /* 0x00FB */ L2_KEY_PIECES3, - /* 0x00FC */ KEY_OF_CARAVAN, - /* 0x00FD */ LV2_BOSS_KEY, - /* 0x00FE */ KEY_OF_FILONE, - /* 0x00FF */ NO_ITEM, - /* 0x0100 */ noentry69, - /* 0x0101 */ noentry70, - /* 0x0102 */ noentry71, - /* 0x0103 */ EQUIP_SWORD, - /* 0x0104 */ noentry72, - /* 0x0105 */ noentry73, - /* 0x0106 */ noentry74, - /* 0x0107 */ noentry75, - /* 0x0108 */ noentry76, - /* 0x0109 */ noentry77, - /* 0x010A */ noentry78, - /* 0x010B */ noentry79, -}; - enum CollectItem { /* 0x0 */ COLLECT_CLOTHING, /* 0x1 */ COLLECT_SWORD, diff --git a/include/d/d_stage.h b/include/d/d_stage.h index e343b1da66..93a30143db 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -1112,6 +1112,10 @@ inline u8 dStage_stagInfo_DefaultCameraType(stage_stag_info_class* pstag) { return pstag->mCameraType; } +inline u16 dStage_stagInfo_GetCullPoint(stage_stag_info_class* pstag) { + return pstag->field_0x10 & 0xFFFF; +} + inline u8 dStage_sclsInfo_getSceneLayer(stage_scls_info_class* p_info) { return p_info->field_0xb & 0xF; } diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 041458e78d..c17a35b667 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -768,4 +768,24 @@ inline void fopAcM_effSmokeSet2(u32* param_0, u32* param_1, cXyz const* param_2, fopAcM_effSmokeSet1(param_0, param_1, param_2, param_3, param_4, param_5, 0); } +inline void fopAcM_setWarningMessage_f(const fopAc_ac_c* i_actor, const char* i_filename, int i_line, const char* i_msg, ...) { +#ifdef DEBUG + va_list args; + va_start(args, i_msg); + + char buf[64]; + snprintf(buf, sizeof(buf), "<%s> %s", dStage_getName(fopAcM_GetProfName(i_actor), i_actor->subtype), i_msg); + setWarningMessage_f_va(JUTAssertion::getSDevice(), i_filename, i_line, buf, args); + + va_end(args); +#endif +} + +#ifdef DEBUG +#define fopAcM_setWarningMessage(i_actor, i_filename, i_line, i_msg, ...) \ + fopAcM_setWarningMessage_f(i_actor, i_filename, i_line, i_msg, __VA_ARGS__) +#else +#define fopAcM_setWarningMessage(...) +#endif + #endif diff --git a/include/f_pc/f_pc_name.h b/include/f_pc/f_pc_name.h new file mode 100644 index 0000000000..1a837d3807 --- /dev/null +++ b/include/f_pc/f_pc_name.h @@ -0,0 +1,270 @@ + +#ifndef F_PC_NAME_H_ +#define F_PC_NAME_H_ + +/** + * This is a made up header based on a debug assert from d_a_obj_item: + * "OS_REPORT_ERROR("fpcNm_(ITEM)では扱わないアイテムです<%d>\n", m_itemNo)" + * Making an assumption that `Nm` is shorthand for `Name` + */ + +enum fpcNm_ITEM { + /* 0x00 */ fpcNm_ITEM_HEART, + /* 0x01 */ fpcNm_ITEM_GREEN_RUPEE, + /* 0x02 */ fpcNm_ITEM_BLUE_RUPEE, + /* 0x03 */ fpcNm_ITEM_YELLOW_RUPEE, + /* 0x04 */ fpcNm_ITEM_RED_RUPEE, + /* 0x05 */ fpcNm_ITEM_PURPLE_RUPEE, + /* 0x06 */ fpcNm_ITEM_ORANGE_RUPEE, + /* 0x07 */ fpcNm_ITEM_SILVER_RUPEE, + /* 0x08 */ fpcNm_ITEM_S_MAGIC, + /* 0x09 */ fpcNm_ITEM_L_MAGIC, + /* 0x0A */ fpcNm_ITEM_BOMB_5, + /* 0x0B */ fpcNm_ITEM_BOMB_10, + /* 0x0C */ fpcNm_ITEM_BOMB_20, + /* 0x0D */ fpcNm_ITEM_BOMB_30, + /* 0x0E */ fpcNm_ITEM_ARROW_10, + /* 0x0F */ fpcNm_ITEM_ARROW_20, + /* 0x10 */ fpcNm_ITEM_ARROW_30, + /* 0x11 */ fpcNm_ITEM_ARROW_1, + /* 0x12 */ fpcNm_ITEM_PACHINKO_SHOT, + /* 0x13 */ fpcNm_ITEM_NOENTRY_19, + /* 0x14 */ fpcNm_ITEM_NOENTRY_20, + /* 0x15 */ fpcNm_ITEM_NOENTRY_21, + /* 0x16 */ fpcNm_ITEM_WATER_BOMB_5, + /* 0x17 */ fpcNm_ITEM_WATER_BOMB_10, + /* 0x18 */ fpcNm_ITEM_WATER_BOMB_20, + /* 0x19 */ fpcNm_ITEM_WATER_BOMB_30, + /* 0x1A */ fpcNm_ITEM_BOMB_INSECT_5, + /* 0x1B */ fpcNm_ITEM_BOMB_INSECT_10, + /* 0x1C */ fpcNm_ITEM_BOMB_INSECT_20, + /* 0x1D */ fpcNm_ITEM_BOMB_INSECT_30, + /* 0x1E */ fpcNm_ITEM_RECOVERY_FAILY, + /* 0x1F */ fpcNm_ITEM_TRIPLE_HEART, + /* 0x20 */ fpcNm_ITEM_SMALL_KEY, + /* 0x21 */ fpcNm_ITEM_KAKERA_HEART, + /* 0x22 */ fpcNm_ITEM_UTAWA_HEART, + /* 0x23 */ fpcNm_ITEM_MAP, + /* 0x24 */ fpcNm_ITEM_COMPUS, + /* 0x25 */ fpcNm_ITEM_DUNGEON_EXIT, + /* 0x26 */ fpcNm_ITEM_BOSS_KEY, + /* 0x27 */ fpcNm_ITEM_DUNGEON_BACK, + /* 0x28 */ fpcNm_ITEM_SWORD, + /* 0x29 */ fpcNm_ITEM_MASTER_SWORD, + /* 0x2A */ fpcNm_ITEM_WOOD_SHIELD, + /* 0x2B */ fpcNm_ITEM_SHIELD, + /* 0x2C */ fpcNm_ITEM_HYLIA_SHIELD, + /* 0x2D */ fpcNm_ITEM_TKS_LETTER, + /* 0x2E */ fpcNm_ITEM_WEAR_CASUAL, + /* 0x2F */ fpcNm_ITEM_WEAR_KOKIRI, + /* 0x30 */ fpcNm_ITEM_ARMOR, + /* 0x31 */ fpcNm_ITEM_WEAR_ZORA, + /* 0x32 */ fpcNm_ITEM_MAGIC_LV1, + /* 0x33 */ fpcNm_ITEM_DUNGEON_EXIT_2, + /* 0x34 */ fpcNm_ITEM_WALLET_LV1, + /* 0x35 */ fpcNm_ITEM_WALLET_LV2, + /* 0x36 */ fpcNm_ITEM_WALLET_LV3, + /* 0x37 */ fpcNm_ITEM_NOENTRY_55, + /* 0x38 */ fpcNm_ITEM_NOENTRY_56, + /* 0x39 */ fpcNm_ITEM_NOENTRY_57, + /* 0x3A */ fpcNm_ITEM_NOENTRY_58, + /* 0x3B */ fpcNm_ITEM_NOENTRY_59, + /* 0x3C */ fpcNm_ITEM_NOENTRY_60, + /* 0x3D */ fpcNm_ITEM_ZORAS_JEWEL, + /* 0x3E */ fpcNm_ITEM_HAWK_EYE, + /* 0x3F */ fpcNm_ITEM_WOOD_STICK, + /* 0x40 */ fpcNm_ITEM_BOOMERANG, + /* 0x41 */ fpcNm_ITEM_SPINNER, + /* 0x42 */ fpcNm_ITEM_IRONBALL, + /* 0x43 */ fpcNm_ITEM_BOW, + /* 0x44 */ fpcNm_ITEM_HOOKSHOT, + /* 0x45 */ fpcNm_ITEM_HVY_BOOTS, + /* 0x46 */ fpcNm_ITEM_COPY_ROD, + /* 0x47 */ fpcNm_ITEM_W_HOOKSHOT, + /* 0x48 */ fpcNm_ITEM_KANTERA, + /* 0x49 */ fpcNm_ITEM_LIGHT_SWORD, + /* 0x4A */ fpcNm_ITEM_FISHING_ROD_1, + /* 0x4B */ fpcNm_ITEM_PACHINKO, + /* 0x4C */ fpcNm_ITEM_COPY_ROD_2, + /* 0x4D */ fpcNm_ITEM_NOENTRY_77, + /* 0x4E */ fpcNm_ITEM_NOENTRY_78, + /* 0x4F */ fpcNm_ITEM_BOMB_BAG_LV2, + /* 0x50 */ fpcNm_ITEM_BOMB_BAG_LV1, + /* 0x51 */ fpcNm_ITEM_BOMB_IN_BAG, + /* 0x52 */ fpcNm_ITEM_NOENTRY_82, + /* 0x53 */ fpcNm_ITEM_LIGHT_ARROW, + /* 0x54 */ fpcNm_ITEM_ARROW_LV1, + /* 0x55 */ fpcNm_ITEM_ARROW_LV2, + /* 0x56 */ fpcNm_ITEM_ARROW_LV3, + /* 0x57 */ fpcNm_ITEM_NOENTRY_87, + /* 0x58 */ fpcNm_ITEM_LURE_ROD, + /* 0x59 */ fpcNm_ITEM_BOMB_ARROW, + /* 0x5A */ fpcNm_ITEM_HAWK_ARROW, + /* 0x5B */ fpcNm_ITEM_BEE_ROD, + /* 0x5C */ fpcNm_ITEM_JEWEL_ROD, + /* 0x5D */ fpcNm_ITEM_WORM_ROD, + /* 0x5E */ fpcNm_ITEM_JEWEL_BEE_ROD, + /* 0x5F */ fpcNm_ITEM_JEWEL_WORM_ROD, + /* 0x60 */ fpcNm_ITEM_EMPTY_BOTTLE, + /* 0x61 */ fpcNm_ITEM_RED_BOTTLE, + /* 0x62 */ fpcNm_ITEM_GREEN_BOTTLE, + /* 0x63 */ fpcNm_ITEM_BLUE_BOTTLE, + /* 0x64 */ fpcNm_ITEM_MILK_BOTTLE, + /* 0x65 */ fpcNm_ITEM_HALF_MILK_BOTTLE, + /* 0x66 */ fpcNm_ITEM_OIL_BOTTLE, + /* 0x67 */ fpcNm_ITEM_WATER_BOTTLE, + /* 0x68 */ fpcNm_ITEM_OIL_BOTTLE_2, + /* 0x69 */ fpcNm_ITEM_RED_BOTTLE_2, + /* 0x6A */ fpcNm_ITEM_UGLY_SOUP, + /* 0x6B */ fpcNm_ITEM_HOT_SPRING, + /* 0x6C */ fpcNm_ITEM_FAIRY, + /* 0x6D */ fpcNm_ITEM_HOT_SPRING_2, + /* 0x6E */ fpcNm_ITEM_OIL2, + /* 0x6F */ fpcNm_ITEM_OIL, + /* 0x70 */ fpcNm_ITEM_NORMAL_BOMB, + /* 0x71 */ fpcNm_ITEM_WATER_BOMB, + /* 0x72 */ fpcNm_ITEM_POKE_BOMB, + /* 0x73 */ fpcNm_ITEM_FAIRY_DROP, + /* 0x74 */ fpcNm_ITEM_WORM, + /* 0x75 */ fpcNm_ITEM_DROP_BOTTLE, + /* 0x76 */ fpcNm_ITEM_BEE_CHILD, + /* 0x77 */ fpcNm_ITEM_CHUCHU_RARE, + /* 0x78 */ fpcNm_ITEM_CHUCHU_RED, + /* 0x79 */ fpcNm_ITEM_CHUCHU_BLUE, + /* 0x7A */ fpcNm_ITEM_CHUCHU_GREEN, + /* 0x7B */ fpcNm_ITEM_CHUCHU_YELLOW, + /* 0x7C */ fpcNm_ITEM_CHUCHU_PURPLE, + /* 0x7D */ fpcNm_ITEM_LV1_SOUP, + /* 0x7E */ fpcNm_ITEM_LV2_SOUP, + /* 0x7F */ fpcNm_ITEM_LV3_SOUP, + /* 0x80 */ fpcNm_ITEM_LETTER, + /* 0x81 */ fpcNm_ITEM_BILL, + /* 0x82 */ fpcNm_ITEM_WOOD_STATUE, + /* 0x83 */ fpcNm_ITEM_IRIAS_PENDANT, + /* 0x84 */ fpcNm_ITEM_HORSE_FLUTE, + /* 0x85 */ fpcNm_ITEM_NOENTRY_133, + /* 0x86 */ fpcNm_ITEM_NOENTRY_134, + /* 0x87 */ fpcNm_ITEM_NOENTRY_135, + /* 0x88 */ fpcNm_ITEM_NOENTRY_136, + /* 0x89 */ fpcNm_ITEM_NOENTRY_137, + /* 0x8A */ fpcNm_ITEM_NOENTRY_138, + /* 0x8B */ fpcNm_ITEM_NOENTRY_139, + /* 0x8C */ fpcNm_ITEM_NOENTRY_140, + /* 0x8D */ fpcNm_ITEM_NOENTRY_141, + /* 0x8E */ fpcNm_ITEM_NOENTRY_142, + /* 0x8F */ fpcNm_ITEM_NOENTRY_143, + /* 0x90 */ fpcNm_ITEM_RAFRELS_MEMO, + /* 0x91 */ fpcNm_ITEM_ASHS_SCRIBBLING, + /* 0x92 */ fpcNm_ITEM_NOENTRY_146, + /* 0x93 */ fpcNm_ITEM_NOENTRY_147, + /* 0x94 */ fpcNm_ITEM_NOENTRY_148, + /* 0x95 */ fpcNm_ITEM_NOENTRY_149, + /* 0x96 */ fpcNm_ITEM_NOENTRY_150, + /* 0x97 */ fpcNm_ITEM_NOENTRY_151, + /* 0x98 */ fpcNm_ITEM_NOENTRY_152, + /* 0x99 */ fpcNm_ITEM_NOENTRY_153, + /* 0x9A */ fpcNm_ITEM_NOENTRY_154, + /* 0x9B */ fpcNm_ITEM_NOENTRY_155, + /* 0x9C */ fpcNm_ITEM_CHUCHU_YELLOW2, + /* 0x9D */ fpcNm_ITEM_OIL_BOTTLE3, + /* 0x9E */ fpcNm_ITEM_SHOP_BEE_CHILD, + /* 0x9F */ fpcNm_ITEM_CHUCHU_BLACK, + /* 0xA0 */ fpcNm_ITEM_LIGHT_DROP, + /* 0xA1 */ fpcNm_ITEM_DROP_CONTAINER, + /* 0xA2 */ fpcNm_ITEM_DROP_CONTAINER02, + /* 0xA3 */ fpcNm_ITEM_DROP_CONTAINER03, + /* 0xA4 */ fpcNm_ITEM_FILLED_CONTAINER, + /* 0xA5 */ fpcNm_ITEM_MIRROR_PIECE_2, + /* 0xA6 */ fpcNm_ITEM_MIRROR_PIECE_3, + /* 0xA7 */ fpcNm_ITEM_MIRROR_PIECE_4, + /* 0xA8 */ fpcNm_ITEM_NOENTRY_168, + /* 0xA9 */ fpcNm_ITEM_NOENTRY_169, + /* 0xAA */ fpcNm_ITEM_NOENTRY_170, + /* 0xAB */ fpcNm_ITEM_NOENTRY_171, + /* 0xAC */ fpcNm_ITEM_NOENTRY_172, + /* 0xAD */ fpcNm_ITEM_NOENTRY_173, + /* 0xAE */ fpcNm_ITEM_NOENTRY_174, + /* 0xAF */ fpcNm_ITEM_NOENTRY_175, + /* 0xB0 */ fpcNm_ITEM_SMELL_YELIA_POUCH, + /* 0xB1 */ fpcNm_ITEM_SMELL_PUMPKIN, + /* 0xB2 */ fpcNm_ITEM_SMELL_POH, + /* 0xB3 */ fpcNm_ITEM_SMELL_FISH, + /* 0xB4 */ fpcNm_ITEM_SMELL_CHILDREN, + /* 0xB5 */ fpcNm_ITEM_SMELL_MEDICINE, + /* 0xB6 */ fpcNm_ITEM_NOENTRY_182, + /* 0xB7 */ fpcNm_ITEM_NOENTRY_183, + /* 0xB8 */ fpcNm_ITEM_NOENTRY_184, + /* 0xB9 */ fpcNm_ITEM_NOENTRY_185, + /* 0xBA */ fpcNm_ITEM_NOENTRY_186, + /* 0xBB */ fpcNm_ITEM_NOENTRY_187, + /* 0xBC */ fpcNm_ITEM_NOENTRY_188, + /* 0xBD */ fpcNm_ITEM_NOENTRY_189, + /* 0xBE */ fpcNm_ITEM_NOENTRY_190, + /* 0xBF */ fpcNm_ITEM_NOENTRY_191, + /* 0xC0 */ fpcNm_ITEM_M_BEETLE, + /* 0xC1 */ fpcNm_ITEM_F_BEETLE, + /* 0xC2 */ fpcNm_ITEM_M_BUTTERFLY, + /* 0xC3 */ fpcNm_ITEM_F_BUTTERFLY, + /* 0xC4 */ fpcNm_ITEM_M_STAG_BEETLE, + /* 0xC5 */ fpcNm_ITEM_F_STAG_BEETLE, + /* 0xC6 */ fpcNm_ITEM_M_GRASSHOPPER, + /* 0xC7 */ fpcNm_ITEM_F_GRASSHOPPER, + /* 0xC8 */ fpcNm_ITEM_M_NANAFUSHI, + /* 0xC9 */ fpcNm_ITEM_F_NANAFUSHI, + /* 0xCA */ fpcNm_ITEM_M_DANGOMUSHI, + /* 0xCB */ fpcNm_ITEM_F_DANGOMUSHI, + /* 0xCC */ fpcNm_ITEM_M_MANTIS, + /* 0xCD */ fpcNm_ITEM_F_MANTIS, + /* 0xCE */ fpcNm_ITEM_M_LADYBUG, + /* 0xCF */ fpcNm_ITEM_F_LADYBUG, + /* 0xD0 */ fpcNm_ITEM_M_SNAIL, + /* 0xD1 */ fpcNm_ITEM_F_SNAIL, + /* 0xD2 */ fpcNm_ITEM_M_DRAGONFLY, + /* 0xD3 */ fpcNm_ITEM_F_DRAGONFLY, + /* 0xD4 */ fpcNm_ITEM_M_ANT, + /* 0xD5 */ fpcNm_ITEM_F_ANT, + /* 0xD6 */ fpcNm_ITEM_M_MAYFLY, + /* 0xD7 */ fpcNm_ITEM_F_MAYFLY, + /* 0xD8 */ fpcNm_ITEM_NOENTRY_216, + /* 0xD9 */ fpcNm_ITEM_NOENTRY_217, + /* 0xDA */ fpcNm_ITEM_NOENTRY_218, + /* 0xDB */ fpcNm_ITEM_NOENTRY_219, + /* 0xDC */ fpcNm_ITEM_NOENTRY_220, + /* 0xDD */ fpcNm_ITEM_NOENTRY_221, + /* 0xDE */ fpcNm_ITEM_NOENTRY_222, + /* 0xDF */ fpcNm_ITEM_NOENTRY_223, + /* 0xE0 */ fpcNm_ITEM_POU_SPIRIT, + /* 0xE1 */ fpcNm_ITEM_NOENTRY_225, + /* 0xE2 */ fpcNm_ITEM_NOENTRY_226, + /* 0xE3 */ fpcNm_ITEM_NOENTRY_227, + /* 0xE4 */ fpcNm_ITEM_NOENTRY_228, + /* 0xE5 */ fpcNm_ITEM_NOENTRY_229, + /* 0xE6 */ fpcNm_ITEM_NOENTRY_230, + /* 0xE7 */ fpcNm_ITEM_NOENTRY_231, + /* 0xE8 */ fpcNm_ITEM_NOENTRY_232, + /* 0xE9 */ fpcNm_ITEM_ANCIENT_DOCUMENT, + /* 0xEA */ fpcNm_ITEM_AIR_LETTER, + /* 0xEB */ fpcNm_ITEM_ANCIENT_DOCUMENT2, + /* 0xEC */ fpcNm_ITEM_LV7_DUNGEON_EXIT, + /* 0xED */ fpcNm_ITEM_LINKS_SAVINGS, + /* 0xEE */ fpcNm_ITEM_SMALL_KEY2, + /* 0xEF */ fpcNm_ITEM_POU_FIRE1, + /* 0xF0 */ fpcNm_ITEM_POU_FIRE2, + /* 0xF1 */ fpcNm_ITEM_POU_FIRE3, + /* 0xF2 */ fpcNm_ITEM_POU_FIRE4, + /* 0xF3 */ fpcNm_ITEM_BOSSRIDER_KEY, + /* 0xF4 */ fpcNm_ITEM_TOMATO_PUREE, + /* 0xF5 */ fpcNm_ITEM_TASTE, + /* 0xF6 */ fpcNm_ITEM_LV5_BOSS_KEY, + /* 0xF7 */ fpcNm_ITEM_SURFBOARD, + /* 0xF8 */ fpcNm_ITEM_KANTERA2, + /* 0xF9 */ fpcNm_ITEM_L2_KEY_PIECES1, + /* 0xFA */ fpcNm_ITEM_L2_KEY_PIECES2, + /* 0xFB */ fpcNm_ITEM_L2_KEY_PIECES3, + /* 0xFC */ fpcNm_ITEM_KEY_OF_CARAVAN, + /* 0xFD */ fpcNm_ITEM_LV2_BOSS_KEY, + /* 0xFE */ fpcNm_ITEM_KEY_OF_FILONE, + /* 0xFF */ fpcNm_ITEM_NONE, +}; + +#endif |
