From d0b62fd83f6aa9d1f33e3f59c929cec9d4bfd37a Mon Sep 17 00:00:00 2001 From: TakaRikka Date: Fri, 27 Jan 2023 15:12:42 -0800 Subject: [PATCH] d_door_param2 / d_cam_param / d_gameover + some misc cleanup --- include/SSystem/SComponent/c_angle.h | 32 + include/d/com/d_com_inf_game.h | 22 +- include/d/d_cam_param.h | 72 +- include/d/d_door_param2.h | 24 +- include/d/d_drawlist.h | 6 +- include/d/d_gameover.h | 92 +- include/d/d_kantera_icon_meter.h | 2 + include/d/d_stage.h | 14 + include/d/d_timer.h | 154 +-- include/d/menu/d_menu_save.h | 1 + include/d/menu/d_menu_window.h | 1 + include/d/meter/d_meter2.h | 1 + include/d/meter/d_meter2_draw.h | 45 +- include/d/meter/d_meter2_info.h | 10 + include/d/msg/d_msg_class.h | 3 +- include/d/msg/d_msg_object.h | 1 + include/d/pane/d_pane_class.h | 5 +- include/d/save/d_save.h | 6 + include/f_op/f_op_msg_mng.h | 13 +- include/m_Do/m_Do_graphic.h | 3 + libs/SSystem/SComponent/c_angle.cpp | 182 ++- src/d/d_cam_param.cpp | 540 ++++----- src/d/d_door_param2.cpp | 230 +--- src/d/d_drawlist.cpp | 1683 +++----------------------- src/d/d_gameover.cpp | 766 +++++++----- src/d/d_timer.cpp | 150 +-- src/d/meter/d_meter2.cpp | 4 + src/d/meter/d_meter2_draw.cpp | 361 +++++- 28 files changed, 1651 insertions(+), 2772 deletions(-) diff --git a/include/SSystem/SComponent/c_angle.h b/include/SSystem/SComponent/c_angle.h index b54d8f7585d..d87b220fb70 100644 --- a/include/SSystem/SComponent/c_angle.h +++ b/include/SSystem/SComponent/c_angle.h @@ -52,12 +52,44 @@ public: cSAngle operator+(short, const cSAngle&); cSAngle operator-(short, const cSAngle&); +struct cAngle { + static f32 Radian_to_Degree(f32 rad) { return rad * 57.2957763671875f; } + static f32 Degree_to_Radian(f32 deg) { return deg * 0.017453292f; } + static s16 Degree_to_SAngle(f32 deg) { return deg * 182.04444885253906f; } + static f32 SAngle_to_Degree(s16 angle) { return (360.0f / 65536.0f) * angle; } + static f32 SAngle_to_Radian(s16 angle) { return 9.58738E-5f * angle; } + static f32 SAngle_to_Normal(s16 angle) { return 3.0517578E-5f * angle; } + static s16 Radian_to_SAngle(f32 rad) { return rad * 10430.378f; } + + /* Converts Radian value into Degree value */ + static f32 r2d(f32 r) { return Radian_to_Degree(r); } + + /* Converts Degree value to s16 angle */ + static s16 d2s(f32 d) { return Degree_to_SAngle(d); } + + template + static T Adjust(T f1, T f2, T f3); +}; + +template +T cAngle::Adjust(T f1, T f2, T f3) { + while (f1 >= f3) { + f1 -= f3 - f2; + } + while (f1 < f2) { + f1 += f3 - f2; + } + return f1; +} + class cDegree { private: float mDegree; public: cDegree(float); + ~cDegree() {} + cDegree& Formal(void); void Val(float); float Radian(void) const; diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index 1efc9d18533..84ba45a17f9 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -434,7 +434,9 @@ public: } char* getLastPlayStageName() { return mLastPlayStageName; } + void setGameoverStatus(u8 status) { mGameoverStatus = status; } u8 getGameoverStatus() { return mGameoverStatus; } + u8 getMesgStatus() { return mMesgStatus; } public: /* 0x00000 */ dBgS mBgs; @@ -1532,6 +1534,10 @@ inline int dComIfGs_createZone(int roomNo) { return g_dComIfG_gameInfo.info.createZone(roomNo); } +inline void dComIfGs_addDeathCount() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().addDeathCount(); +} + void dComIfGp_setSelectItem(int index); s32 dComIfGp_offHeapLockFlag(int flag); void dComIfGp_createSubExpHeap2D(); @@ -1834,6 +1840,10 @@ inline u8 dComIfGp_getGameoverStatus() { return g_dComIfG_gameInfo.play.getGameoverStatus(); } +inline void dComIfGp_setGameoverStatus(u8 i_status) { + return g_dComIfG_gameInfo.play.setGameoverStatus(i_status); +} + inline u32 dComIfGp_getNowVibration() { return g_dComIfG_gameInfo.play.getNowVibration(); } @@ -2359,6 +2369,14 @@ inline void i_dComIfGp_setHitMark(u16 i_hitmark, fopAc_ac_c* param_1, const cXyz i_atType); } +inline JKRArchive* dComIfGp_getFmapResArchive() { + return g_dComIfG_gameInfo.play.getFmapResArchive(); +} + +inline u8 dComIfGp_getMesgStatus() { + return g_dComIfG_gameInfo.play.getMesgStatus(); +} + inline s32 dComIfGp_roomControl_getStayNo() { return dStage_roomControl_c::getStayNo(); } @@ -2871,8 +2889,4 @@ inline daAlink_c* daAlink_getAlinkActorClass() { return (daAlink_c*)g_dComIfG_gameInfo.play.getPlayerPtr(LINK_PTR); } -inline JKRArchive* dComIfGp_getFmapResArchive() { - return g_dComIfG_gameInfo.play.getFmapResArchive(); -} - #endif /* D_COM_D_COM_INF_GAME_H */ diff --git a/include/d/d_cam_param.h b/include/d/d_cam_param.h index 96ea1d49258..3d23cd2e0d4 100644 --- a/include/d/d_cam_param.h +++ b/include/d/d_cam_param.h @@ -5,11 +5,11 @@ #include "SSystem/SComponent/c_xyz.h" struct dCamMath { - /* 8008813C */ void rationalBezierRatio(f32, f32); - /* 80088284 */ void zoomFovy(f32, f32); - /* 8008831C */ void xyzRotateX(cXyz&, cSAngle); - /* 80088384 */ void xyzRotateY(cXyz&, cSAngle); - /* 800883EC */ void xyzHorizontalDistance(cXyz&, cXyz&); + /* 8008813C */ static f32 rationalBezierRatio(f32, f32); + /* 80088284 */ static f32 zoomFovy(f32, f32); + /* 8008831C */ static cXyz xyzRotateX(cXyz&, cSAngle); + /* 80088384 */ static cXyz xyzRotateY(cXyz&, cSAngle); + /* 800883EC */ static f32 xyzHorizontalDistance(cXyz&, cXyz&); }; class dCstick_c { @@ -29,31 +29,43 @@ class dCamBGChk_c { public: /* 80088464 */ dCamBGChk_c(); - /* 0x00 */ f32 field_0x0; - /* 0x04 */ f32 field_0x4; - /* 0x08 */ f32 field_0x8; - /* 0x0C */ f32 field_0xc; - /* 0x10 */ f32 field_0x10; - /* 0x14 */ f32 field_0x14; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ f32 field_0x1c; - /* 0x20 */ f32 field_0x20; - /* 0x24 */ f32 field_0x24; - /* 0x28 */ f32 field_0x28; + // name is a guess for now + struct ChkInfo { + /* 0x0 */ f32 mDistance; + /* 0x4 */ f32 mChkAngle; + /* 0x8 */ f32 mWeightH; + /* 0xC */ f32 mWeightL; + }; // Size: 0x10 + + /* 0x00 */ f32 mFloorMargin; + /* 0x04 */ ChkInfo mChkInfo[2]; + /* 0x24 */ f32 mFwdBackMargin; + /* 0x28 */ f32 mFwdCushion; /* 0x2C */ f32 field_0x2c; - /* 0x30 */ f32 field_0x30; - /* 0x34 */ f32 field_0x34; - /* 0x38 */ f32 field_0x38; - /* 0x3C */ f32 field_0x3c; - /* 0x40 */ f32 field_0x40; - /* 0x44 */ f32 field_0x44; + /* 0x30 */ f32 mGazeBackMargin; + /* 0x34 */ f32 mCornerCushion; + /* 0x38 */ f32 mWallCushion; + /* 0x3C */ f32 mWallUpDistance; + /* 0x40 */ f32 mWallBackCushion; + /* 0x44 */ f32 mCornerAngleMax; +}; + +struct dCamStyleData { + struct StyleData { + /* 0x0 */ u32 field_0x0; + /* 0x4 */ u8 field_0x4[0x78 - 0x4]; + }; // Size: 0x78 + + /* 0x0 */ u8 field_0x0[4]; + /* 0x4 */ int mStyleNum; + /* 0x8 */ StyleData* mStyleData; }; class dCamParam_c { public: /* 800884F0 */ dCamParam_c(s32); - /* 800885D4 */ void Change(s32); - /* 80088620 */ void SearchStyle(u32); + /* 800885D4 */ int Change(s32); + /* 80088620 */ int SearchStyle(u32); /* 80182C60 */ void Arg2(s16); /* 80182C3C */ void Arg2(); /* 80182C48 */ void Arg1(); @@ -70,9 +82,9 @@ public: /* 0x01 */ u8 mMapToolArg0; /* 0x02 */ u8 mMapToolArg1; /* 0x04 */ int mMapToolArg2; - /* 0x08 */ u8* mCamStyleData; - /* 0x0C */ int field_0xc; - /* 0x10 */ u8* field_0x10; + /* 0x08 */ dCamStyleData::StyleData* mCamStyleData; + /* 0x0C */ s32 mStyleNum; + /* 0x10 */ dCamStyleData::StyleData* mCurrentStyle; /* 0x14 */ int mStyleID; /* 0x18 */ u8 field_0x18[4]; @@ -82,8 +94,8 @@ public: class dCamSetup_c { public: /* 80088668 */ dCamSetup_c(); - /* 80088918 */ void CheckLatitudeRange(s16*); - /* 80088988 */ void PlayerHideDist(); + /* 80088918 */ bool CheckLatitudeRange(s16*); + /* 80088988 */ f32 PlayerHideDist(); /* 80182BB8 */ void CheckFlag2(u16); /* 80182BD0 */ void CheckFlag(u16); /* 80182BE8 */ void WaitRollSpeed(); @@ -169,7 +181,7 @@ public: /* 0x114 */ dCamBGChk_c mBGChk; /* 0x15C */ f32 field_0x15c; /* 0x160 */ f32 field_0x160; - /* 0x164 */ f32 mWaitRollTimer; + /* 0x164 */ int mWaitRollTimer; /* 0x168 */ f32 mWaitRollSpeed; /* 0x16C */ f32 field_0x16c; /* 0x170 */ int mScreensaverFirstWaitTimer; diff --git a/include/d/d_door_param2.h b/include/d/d_door_param2.h index 13045c2d6a7..0ae93871b83 100644 --- a/include/d/d_door_param2.h +++ b/include/d/d_door_param2.h @@ -1,6 +1,28 @@ #ifndef D_D_DOOR_PARAM2_H #define D_D_DOOR_PARAM2_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" + +class door_param2_c { +public: + /* 8003A188 */ static u8 getKind(fopAc_ac_c* i_actor); + /* 8003A194 */ static u8 getDoorModel(fopAc_ac_c* i_actor); + /* 8003A1A0 */ static u8 getFrontOption(fopAc_ac_c* i_actor); + /* 8003A1AC */ static u8 getBackOption(fopAc_ac_c* i_actor); + /* 8003A1B8 */ static u8 getFRoomNo(fopAc_ac_c* i_actor); + /* 8003A1C4 */ static u8 getBRoomNo(fopAc_ac_c* i_actor); + /* 8003A1D0 */ static u8 getSwbit(fopAc_ac_c* i_actor); + /* 8003A1DC */ static u8 getSwbit2(fopAc_ac_c* i_actor); + /* 8003A1E8 */ static u8 getSwbit3(fopAc_ac_c* i_actor); + /* 8003A1F4 */ static u8 isMsgDoor(fopAc_ac_c* i_actor); + /* 8003A200 */ static u8 getEventNo(fopAc_ac_c* i_actor); + /* 8003A20C */ static u8 getEventNo2(fopAc_ac_c* i_actor); + /* 8003A218 */ static u16 getMsgNo(fopAc_ac_c* i_actor); + /* 8003A224 */ static u8 getExitNo(fopAc_ac_c* i_actor); + /* 8003A230 */ static u8 getFLightInf(fopAc_ac_c* i_actor); + /* 8003A23C */ static u8 getBLightInf(fopAc_ac_c* i_actor); + /* 8003A248 */ static u8 getMFLightInf(fopAc_ac_c* i_actor); + /* 8003A254 */ static u8 getMBLightInf(fopAc_ac_c* i_actor); +}; #endif /* D_D_DOOR_PARAM2_H */ diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index c22a647f2b9..c2de5e7e6ad 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -255,8 +255,8 @@ public: /* 80056770 */ void drawXluListItem3d(); /* 80056794 */ int set(dDlst_base_c**&, dDlst_base_c**&, dDlst_base_c*); /* 800567C4 */ void draw(dDlst_base_c**, dDlst_base_c**); - /* 8005681C */ void wipeIn(f32, _GXColor&); - /* 800568D8 */ static void wipeIn(f32); + /* 8005681C */ static void wipeIn(f32 i_wipeSpeed, GXColor& i_wipeColor); + /* 800568D8 */ static void wipeIn(f32 i_wipeSpeed); /* 80056900 */ void calcWipe(); enum DrawBuffer { @@ -336,7 +336,7 @@ public: static dDlst_2DT2_c mWipeDlst; static GXColor mWipeColor; static f32 mWipeRate; - static f32 mWipeSpeed[1 + 1 /* padding */]; + static f32 mWipeSpeed; static u8 mWipe; private: diff --git a/include/d/d_gameover.h b/include/d/d_gameover.h index 318cf8756bc..9e010aa19c1 100644 --- a/include/d/d_gameover.h +++ b/include/d/d_gameover.h @@ -1,13 +1,69 @@ #ifndef D_D_GAMEOVER_H #define D_D_GAMEOVER_H +#include "SSystem/SComponent/c_phase.h" +#include "d/menu/d_menu_save.h" #include "d/msg/d_msg_class.h" -#include "dolphin/types.h" #include "f_op/f_op_msg_mng.h" -struct dGameover_c : msg_class { - /* 8019B044 */ void _create(); - /* 8019B2F4 */ void _execute(); +class mDoHIO_entry_c { +public: + virtual ~mDoHIO_entry_c() {} + + /* 0x4 */ s8 mNo; + /* 0x5 */ u8 mCount; +}; + +class dGov_HIO_c : public mDoHIO_entry_c { +public: + /* 8019AFE0 */ dGov_HIO_c(); + /* 8019C06C */ virtual ~dGov_HIO_c(); + + /* 0x08 */ f32 mScale; + /* 0x0C */ f32 mAlpha; + /* 0x10 */ f32 mAnimSpeed; + /* 0x14 */ GXColor mBlack; + /* 0x18 */ GXColor mWhite; +}; // Size: 0x1C + +class dDlst_Gameover_CAPTURE_c : public dDlst_base_c { +public: + /* 8019ACF8 */ virtual void draw(); + /* 8019C2CC */ virtual ~dDlst_Gameover_CAPTURE_c(); +}; + +class dMsgScrnLight_c; +class dDlst_GameOverScrnDraw_c : public dDlst_base_c { +public: + /* 8019B940 */ dDlst_GameOverScrnDraw_c(JKRArchive*); + /* 8019BCB0 */ void setBackAlpha(f32); + + /* 8019BCF4 */ virtual void draw(); + /* 8019BBFC */ virtual ~dDlst_GameOverScrnDraw_c(); + + /* 0x04 */ J2DScreen* mpScreen; + /* 0x08 */ J2DPicture* mpBackImg; + /* 0x0C */ dMsgScrnLight_c* mpLight; + /* 0x10 */ f32 field_0x10; + /* 0x14 */ JUtility::TColor mFadeColor; +}; // Size: 0x18 + +enum dGameover_Proc { + /* 0 */ PROC_PLAYER_ANM_WAIT, + /* 1 */ PROC_DISP_FADE_OUT, + /* 2 */ PROC_DISP_WAIT, + /* 3 */ PROC_DEMO_FADE_IN, + /* 4 */ PROC_DEMO_FADE_OUT, + /* 5 */ PROC_SAVE_OPEN, + /* 6 */ PROC_SAVE_MOVE, + /* 7 */ PROC_SAVE_CLOSE, + /* 8 */ PROC_DELETE_WAIT, +}; + +class dGameover_c : public msg_class { +public: + /* 8019B044 */ int _create(); + /* 8019B2F4 */ int _execute(); /* 8019B384 */ void playerAnmWait_init(); /* 8019B388 */ void playerAnmWait_proc(); /* 8019B3A0 */ void dispFadeOut_init(); @@ -26,27 +82,37 @@ struct dGameover_c : msg_class { /* 8019B5F4 */ void saveClose_proc(); /* 8019B7BC */ void deleteWait_init(); /* 8019B7C0 */ void deleteWait_proc(); - /* 8019B7C4 */ void _draw(); - /* 8019B864 */ void _delete(); - s32 deleteCheck() { return _0x108 == 8; } + /* 8019B7C4 */ int _draw(); + /* 8019B864 */ int _delete(); - /* 0x100 */ u8 _0x100[0x118 - 0x100]; - /* 0x108 */ u8 _0x108; -}; // size unknown + s32 deleteCheck() { return mProc == 8; } + + /* 0x0FC */ dMenu_save_c* dMs_c; + /* 0x100 */ dDlst_GameOverScrnDraw_c* dgo_screen_c; + /* 0x104 */ dDlst_Gameover_CAPTURE_c* dgo_capture_c; + /* 0x108 */ request_of_phase_process_class mPhase; + /* 0x110 */ JKRHeap* mpHeap; + /* 0x114 */ s16 mTimer; + /* 0x116 */ s16 field_0x116; + /* 0x118 */ u8 mProc; + /* 0x119 */ bool mIsDemoSave; +}; // Size: 0x11C s32 d_GameOver_Create(u8 param_0); -void d_GameOver_Delete(unsigned int& param_0); +bool d_GameOver_Delete(unsigned int& i_id); + inline s32 d_GameOver_CheckDelete(unsigned int& id) { if (id != UINT32_MAX) { dGameover_c* gameover = (dGameover_c*)fopMsgM_SearchByID(id); + if (gameover != NULL) { return gameover->deleteCheck(); } else { return 0; } - } else { - return 0; } + + return 0; } #endif /* D_D_GAMEOVER_H */ diff --git a/include/d/d_kantera_icon_meter.h b/include/d/d_kantera_icon_meter.h index 666d1c4a267..ad0a52cf4bd 100644 --- a/include/d/d_kantera_icon_meter.h +++ b/include/d/d_kantera_icon_meter.h @@ -29,6 +29,8 @@ public: /* 801AE974 */ virtual ~dKantera_icon_c(); + void drawSelf() { mpKanteraIcon->draw(); } + private: /* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon; /* 0x08 */ CPaneMgr* mpParent; diff --git a/include/d/d_stage.h b/include/d/d_stage.h index e74c7acbb3d..67e0da5cdbf 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -241,8 +241,22 @@ public: /* 0x4 */ dStage_Mult_info* mInfo; }; +struct stage_sound_data { + /* 0x00 */ char field_0x0[8]; + /* 0x08 */ Vec field_0x8; + /* 0x14 */ u8 field_0x14; + /* 0x15 */ u8 field_0x15; + /* 0x16 */ u8 field_0x16; + /* 0x17 */ u8 field_0x17; + /* 0x18 */ u8 field_0x18; + /* 0x19 */ u8 field_0x19; + /* 0x1A */ u8 field_0x1a; +}; // Size: 0x1C + struct dStage_SoundInfo_c { // SOND + /* 0x0 */ int field_0x0; + /* 0x4 */ stage_sound_data* field_0x4; }; class dStage_FileList_dt_c { diff --git a/include/d/d_timer.h b/include/d/d_timer.h index 1b39147cabc..6f7899da0db 100644 --- a/include/d/d_timer.h +++ b/include/d/d_timer.h @@ -1,37 +1,28 @@ #ifndef D_D_TIMER_H #define D_D_TIMER_H -#include "SSystem/SComponent/c_xyz.h" +#include "JSystem/J2DGraph/J2DPane.h" +#include "JSystem/JKernel/JKRExpHeap.h" #include "SSystem/SComponent/c_phase.h" -#include "dolphin/types.h" -#include "dolphin/os/OSTime.h" +#include "SSystem/SComponent/c_xyz.h" #include "d/msg/d_msg_class.h" #include "d/msg/d_msg_object.h" -#include "JSystem/JKernel/JKRExpHeap.h" -#include "JSystem/J2DGraph/J2DPane.h" +#include "dolphin/os/OSTime.h" +#include "dolphin/types.h" s32 dTimer_createStockTimer(); -class dDlst_TimerScrnDraw_c { -private: - /* 0x000 */ u8 field_0x000[0x3B0]; - /* 0x3B0 */ int field_0x3B0;; - /* 0x3B4 */ int field_0x3B4; - /* 0x3B8 */ int field_0x3B8; - /* 0x3BC */ int field_0x3BC; - /* 0x3C0 */ u8 field_0x3C0[12]; - /* 0x3CC */ int field_0x3CC; - /* 0x3D0 */ int field_0x3D0; - /* 0x3D4 */ int field_0x3D4; - /* 0x3D8 */ int field_0x3D8; - /* 0x3DC */ u8 field_0x3DC; - // /* 0x3DC */ u8 field_0x3DD; - /* 0x3DE */ u8 field_0x3DE; - /* 0x3DF */ u8 field_0x3DF; - /* 0x3E0 */ u8 field_0x3E0; - /* 0x3E1 */ u8 field_0x3E1; - /* 0x3E2 */ u8 mTimerVisible; +class dDlst_TimerScrnDraw_c : public dDlst_base_c { public: + struct dDlst_TimerScrnDraw_UnkData { + /* 0x0 */ f32 field_0x0; + /* 0x4 */ f32 field_0x4; + /* 0x8 */ u16 field_0x8; + /* 0xA */ u16 field_0xa; + /* 0xC */ u8 field_0xc; + /* 0xD */ u8 field_0xd; + }; // Size: 0x10 + /* 8025DB38 */ dDlst_TimerScrnDraw_c(); /* 8025DBE0 */ void setHIO(); /* 8025DFBC */ void setScreen(s32, JKRArchive*); @@ -53,23 +44,86 @@ public: /* 8025FF98 */ void closeAnime(); /* 802601E4 */ void createGetIn(cXyz); /* 80260574 */ s32 createStart(u16); - /* 80260690 */ void draw(); /* 80260AA8 */ void checkStartAnimeEnd(); /* 80260AD4 */ void playBckAnimation(f32); /* 80260B54 */ void drawPikari(int); - /* 80261394 */ ~dDlst_TimerScrnDraw_c(); - void show() { - mTimerVisible = 1; - } + /* 80260690 */ virtual void draw(); + /* 80261394 */ virtual ~dDlst_TimerScrnDraw_c(); - void hide() { - mTimerVisible = 0; - } + void show() { mTimerVisible = 1; } + void hide() { mTimerVisible = 0; } + +private: + /* 0x004 */ J2DScreen* mpScreen; + /* 0x008 */ J2DScreen* mpGetInScreen; + /* 0x00C */ void* mpGetInBck; + /* 0x010 */ CPaneMgr* mpParent; + /* 0x014 */ CPaneMgr* mpCowParent; + /* 0x018 */ CPaneMgr* mpTimeParent; + /* 0x01C */ CPaneMgr* mpImageParent; + /* 0x020 */ CPaneMgr* mpGetInParent; + /* 0x024 */ CPaneMgr* mpGetInRoot; + /* 0x028 */ CPaneMgr* mpGetInText; + /* 0x02C */ J2DPane* mTimerText[6][2]; + /* 0x05C */ J2DPane* field_0x5c[2][2]; + /* 0x06C */ J2DPane* field_0x6c; + /* 0x070 */ J2DPane* field_0x70; + /* 0x074 */ J2DPane* field_0x74; + /* 0x078 */ J2DPane* field_0x78; + /* 0x07C */ JKRArchive* mpArchive; + /* 0x080 */ dDlst_TimerScrnDraw_UnkData field_0x80[51]; + /* 0x3B0 */ f32 field_0x3B0; + /* 0x3B4 */ f32 field_0x3B4; + /* 0x3B8 */ f32 field_0x3B8; + /* 0x3BC */ f32 field_0x3BC; + /* 0x3C0 */ f32 mTimerTransX; + /* 0x3C4 */ f32 mTimerTransY; + /* 0x3C8 */ s32 field_0x3C8; + /* 0x3CC */ int field_0x3CC; + /* 0x3D0 */ int field_0x3D0; + /* 0x3D4 */ int field_0x3D4; + /* 0x3D8 */ int field_0x3D8; + /* 0x3DC */ u8 mCowID; + /* 0x3DD */ u8 field_0x3DD; + /* 0x3DE */ u8 field_0x3DE; + /* 0x3DF */ u8 field_0x3DF; + /* 0x3E0 */ u8 field_0x3E0; + /* 0x3E1 */ u8 mTimerVisible; + /* 0x3E2 */ u8 mHIOType; }; class dTimer_c : public msg_class { +public: + /* 8025CA0C */ void _create(); + /* 8025CF04 */ void _execute(); + /* 8025D33C */ int _draw(); + /* 8025D3BC */ void _delete(); + /* 8025D524 */ int deleteCheck(); + /* 8025D618 */ void start(int, s16); + /* 8025D538 */ void start(int); + /* 8025D7C0 */ int stock_start(s16); + /* 8025D708 */ bool stock_start(); + /* 8025D7E8 */ int stop(u8); + /* 8025D86C */ int restart(u8); + /* 8025D920 */ int end(int); + /* 8025D9E0 */ int deleteRequest(); + /* 8025D9F0 */ int getTimeMs(); + /* 8025DA54 */ int getLimitTimeMs(); + /* 8025DA9C */ int getRestTimeMs(); + /* 8025DB10 */ int isStart(); + /* 802613DC */ int createGetIn(cXyz); + + s32 createStart(u16 param_0) { return mp_tm_scrn->createStart(param_0); } + + void show() { mp_tm_scrn->show(); } + + void hide() { mp_tm_scrn->hide(); } + + u8 isReadyFlag() { return mIsReady; } + private: + /* 0x0FC */ dDlst_TimerScrnDraw_c* mp_tm_scrn; /* 0x100 */ JKRExpHeap* mpHeap; /* 0x104 */ u8 field_0x104[4]; /* 0x108 */ request_of_phase_process_class mPhase; @@ -92,42 +146,6 @@ private: /* 0x16C */ u8 mDeleteCheck; /* 0x16C */ u8 field_0x16D; /* 0x16E */ u8 mIsReady; - -public: - /* 8025CA0C */ void _create(); - /* 8025CF04 */ void _execute(); - /* 8025D33C */ int _draw(); - /* 8025D3BC */ void _delete(); - /* 8025D524 */ int deleteCheck(); - /* 8025D618 */ void start(int, s16); - /* 8025D538 */ void start(int); - /* 8025D7C0 */ int stock_start(s16); - /* 8025D708 */ bool stock_start(); - /* 8025D7E8 */ int stop(u8); - /* 8025D86C */ int restart(u8); - /* 8025D920 */ int end(int); - /* 8025D9E0 */ int deleteRequest(); - /* 8025D9F0 */ int getTimeMs(); - /* 8025DA54 */ int getLimitTimeMs(); - /* 8025DA9C */ int getRestTimeMs(); - /* 8025DB10 */ int isStart(); - /* 802613DC */ int createGetIn(cXyz); - - s32 createStart(u16 param_0) { - return ((dDlst_TimerScrnDraw_c*)field_0xfc)->createStart(param_0); - } - - void show() { - ((dDlst_TimerScrnDraw_c*)field_0xfc)->show(); - } - - void hide() { - ((dDlst_TimerScrnDraw_c*)field_0xfc)->hide(); - } - - u8 isReadyFlag() { - return mIsReady; - } }; #endif /* D_D_TIMER_H */ diff --git a/include/d/menu/d_menu_save.h b/include/d/menu/d_menu_save.h index fa344b3f13c..324e43473cb 100644 --- a/include/d/menu/d_menu_save.h +++ b/include/d/menu/d_menu_save.h @@ -262,6 +262,7 @@ public: /* 802844D0 */ virtual ~dMenu_save_c(); u8 getSaveStatus() { return mSaveStatus; } + u8 getEndStatus() { return mEndStatus; } void setUseType(u8 type) { mUseType = type; } private: diff --git a/include/d/menu/d_menu_window.h b/include/d/menu/d_menu_window.h index 2d252e73a93..87341948673 100644 --- a/include/d/menu/d_menu_window.h +++ b/include/d/menu/d_menu_window.h @@ -249,6 +249,7 @@ public: bool isFadeNowCheck() { return mDoGph_gInf_c::getFader()->getStatus() == 1; } private: + /* 0x0FC */ int field_0xfc; /* 0x100 */ JKRExpHeap* mpHeap; /* 0x104 */ STControl* mpStick; /* 0x108 */ CSTControl* mpCStick; diff --git a/include/d/meter/d_meter2.h b/include/d/meter/d_meter2.h index 3e10104ce9c..02e8c4ce49d 100644 --- a/include/d/meter/d_meter2.h +++ b/include/d/meter/d_meter2.h @@ -229,6 +229,7 @@ public: u16 getSubContentsStringType() { return mSubContentsStringType; } private: + /* 0x0FC */ int field_0xfc; /* 0x100 */ JKRExpHeap* mpHeap; /* 0x104 */ JKRExpHeap* mpSubHeap; /* 0x108 */ void* field_0x108; diff --git a/include/d/meter/d_meter2_draw.h b/include/d/meter/d_meter2_draw.h index 511e5ecdece..e5ae5b2d28a 100644 --- a/include/d/meter/d_meter2_draw.h +++ b/include/d/meter/d_meter2_draw.h @@ -351,7 +351,7 @@ private: /* 0x524 */ int field_0x524[2][2]; /* 0x534 */ J2DAnmTransformKey* mPikariBck; /* 0x538 */ J2DAnmColorKey* mPikariBpk; - /* 0x53C */ J2DAnmColorKey* field_0x53c[3]; + /* 0x53C */ J2DAnmColorKey* mpOxygenBpk[3]; /* 0x548 */ JUtility::TColor field_0x548; /* 0x54C */ JUtility::TColor field_0x54c; /* 0x550 */ f32 field_0x550; @@ -367,36 +367,17 @@ private: /* 0x578 */ f32 field_0x578; /* 0x57C */ f32 field_0x57c; /* 0x580 */ f32 field_0x580; - /* 0x584 */ f32 field_0x584; - /* 0x588 */ f32 field_0x588; - /* 0x58C */ f32 field_0x58c; - /* 0x590 */ f32 field_0x590; - /* 0x594 */ f32 field_0x594; - /* 0x598 */ f32 field_0x598; - /* 0x59C */ f32 field_0x59c; - /* 0x5A0 */ f32 field_0x5a0; - /* 0x5A4 */ f32 field_0x5a4; - /* 0x5A8 */ f32 field_0x5a8; - /* 0x5AC */ f32 field_0x5ac; - /* 0x5B0 */ f32 field_0x5b0; - /* 0x5B4 */ f32 field_0x5b4; - /* 0x5B8 */ f32 field_0x5b8; - /* 0x5BC */ f32 field_0x5bc; - /* 0x5C0 */ f32 field_0x5c0; - /* 0x5C4 */ f32 field_0x5c4; - /* 0x5C8 */ f32 field_0x5c8; - /* 0x5CC */ f32 field_0x5cc; - /* 0x5D0 */ f32 field_0x5d0; - /* 0x5D4 */ f32 field_0x5d4; - /* 0x5D8 */ f32 field_0x5d8; - /* 0x5DC */ f32 field_0x5dc; - /* 0x5E0 */ f32 field_0x5e0; - /* 0x5E4 */ f32 field_0x5e4; - /* 0x5E8 */ f32 field_0x5e8; - /* 0x5EC */ f32 field_0x5ec; - /* 0x5F0 */ f32 field_0x5f0; - /* 0x5F4 */ u8 field_0x5f4[0x8]; - /* 0x5FC */ f32 field_0x5fc[3]; + /* 0x584 */ f32 field_0x584[3]; + /* 0x590 */ f32 field_0x590[3]; + /* 0x59C */ f32 field_0x59c[3]; + /* 0x5A8 */ f32 field_0x5a8[3]; + /* 0x5B4 */ f32 field_0x5b4[3]; + /* 0x5C0 */ f32 field_0x5c0[3]; + /* 0x5CC */ f32 field_0x5cc[3]; + /* 0x5D8 */ f32 field_0x5d8[3]; + /* 0x5E4 */ f32 field_0x5e4[3]; + /* 0x5F0 */ f32 field_0x5f0[3]; + /* 0x5FC */ f32 mMeterAlphaRate[3]; /* 0x608 */ f32 field_0x608; /* 0x60C */ f32 field_0x60c; /* 0x610 */ f32 field_0x610[3]; @@ -429,7 +410,7 @@ private: /* 0x738 */ f32 field_0x738; /* 0x73C */ f32 field_0x73c; /* 0x740 */ u16 field_0x740; - /* 0x742 */ u16 field_0x742[3]; + /* 0x742 */ s16 field_0x742[3]; /* 0x748 */ u8 field_0x748[0xC]; /* 0x756 */ u16 field_0x754; /* 0x756 */ s16 field_0x756; diff --git a/include/d/meter/d_meter2_info.h b/include/d/meter/d_meter2_info.h index 3088f044877..f75483179f7 100644 --- a/include/d/meter/d_meter2_info.h +++ b/include/d/meter/d_meter2_info.h @@ -159,6 +159,8 @@ public: dMeter2_c* getMeterClass() { return mMeterClass; } u8 getMiniGameItemSetFlag() { return mMiniGameItemSetFlag; } s16 getMsgKeyWaitTimer() { return mMsgKeyWaitTimer; } + u8 getGameOverType() { return mGameOverType; } + void setGameOverType(u8 i_gameoverType) { mGameOverType = i_gameoverType; } public: /* 0x04 */ u8 unk4[4]; @@ -505,6 +507,14 @@ inline void dMeter2Info_setFloatingFlow(u16 param_0, s16 param_1, bool param_2) g_meter2_info.setFloatingFlow(param_0, param_1, param_2); } +inline u8 dMeter2Info_getGameOverType() { + return g_meter2_info.getGameOverType(); +} + +inline void dMeter2Info_setGameOverType(u8 i_gameoverType) { + g_meter2_info.setGameOverType(i_gameoverType); +} + char* dMeter2Info_getNumberTextureName(int pIndex); void dMeter2Info_recieveLetter(); u8 dMeter2Info_getNewLetterNum(); diff --git a/include/d/msg/d_msg_class.h b/include/d/msg/d_msg_class.h index ffcac0294a6..8ac1d507e5e 100644 --- a/include/d/msg/d_msg_class.h +++ b/include/d/msg/d_msg_class.h @@ -17,7 +17,6 @@ public: /* 0xF4 */ u32 field_0xf4; /* 0xF8 */ u16 mMode; /* 0xFA */ u8 mSelectedChoiceIdx; - /* 0xFC */ int field_0xfc; -}; // Size: 0x100 +}; // Size: 0xFC #endif /* D_MSG_D_MSG_CLASS_H */ diff --git a/include/d/msg/d_msg_object.h b/include/d/msg/d_msg_object.h index 45fe7786065..7f7c74f6f2d 100644 --- a/include/d/msg/d_msg_object.h +++ b/include/d/msg/d_msg_object.h @@ -162,6 +162,7 @@ public: u8 getSelectPushFlag() { return mSelectPushFlag; } u8 getSelectCancelPos() { return mSelectCancelPos; } + /* 0x0FC */ int field_0xfc; /* 0x100 */ msg_class* field_0x100; /* 0x104 */ dMsgScrnBase_c* mpScrnDraw; /* 0x108 */ dMsgString_c* mpMsgString; diff --git a/include/d/pane/d_pane_class.h b/include/d/pane/d_pane_class.h index 418abda8bc2..3265b1268e7 100644 --- a/include/d/pane/d_pane_class.h +++ b/include/d/pane/d_pane_class.h @@ -36,8 +36,10 @@ public: } void translate(f32 x, f32 y) { getPanePtr()->translate(x, y); } - void scale(f32 h, f32 v) { getPanePtr()->scale(h, v); } + void resize(f32 x, f32 y) { getPanePtr()->resize(x, y); } + void move(f32 x, f32 y) { getPanePtr()->move(x, y); } + void scaleAnimeStart(s16 v) { mScaleAnime = v; } void colorAnimeStart(s16 start) { mColorAnime = start; } @@ -60,6 +62,7 @@ public: f32 getInitPosY() { return mInitPos.y; } JUtility::TColor getInitBlack() { return mInitBlack; } + JUtility::TColor getInitWhite() { return mInitWhite; } private: /* 0x1C */ void* mpFirstStackSize; diff --git a/include/d/save/d_save.h b/include/d/save/d_save.h index a31380e64b3..387be9e51b8 100644 --- a/include/d/save/d_save.h +++ b/include/d/save/d_save.h @@ -683,6 +683,12 @@ public: void setTotalTime(s64 i_time) { mTotalTime = i_time; } s64 getTotalTime() const { return mTotalTime; } + void addDeathCount() { + if (mDeathCount < 0xFFFF) { + mDeathCount++; + } + } + private: /* 0x00 */ u32 unk0; /* 0x04 */ u32 unk4; diff --git a/include/f_op/f_op_msg_mng.h b/include/f_op/f_op_msg_mng.h index 67db9e21e1c..8e115fd7005 100644 --- a/include/f_op/f_op_msg_mng.h +++ b/include/f_op/f_op_msg_mng.h @@ -7,7 +7,7 @@ struct msg_process_profile_definition { /* 0x00 */ leaf_process_profile_definition mBase; - /* 0x24 */ leafdraw_method_class* mSubMtd; // Subclass methods + /* 0x24 */ leafdraw_method_class* mSubMtd; // Subclass methods }; struct fopMsg_prm_class { @@ -38,6 +38,9 @@ typedef int (*fopMsgCreateFunc)(void*); JKRExpHeap* fopMsgM_createExpHeap(u32, JKRHeap*); u32 fopMsgM_Create(s16, fopMsgCreateFunc, void*); +s32 fopMsgM_create(s16 param_0, fopAc_ac_c* param_1, cXyz* param_2, u32* param_3, u32* param_4, + fopMsgCreateFunc createFunc); +void fopMsgM_Delete(void* process); fopMsg_prm_class* fopMsgM_GetAppend(void* msg); void fopMsgM_setMessageID(unsigned int); void fopMsgM_destroyExpHeap(JKRExpHeap*); @@ -48,9 +51,11 @@ msg_class* fopMsgM_SearchByID(unsigned int param_0); char* fopMsgM_messageGet(char* msg, u32 string_id); s32 fop_Timer_create(s16 param_0, u8 param_1, u32 param_2, u8 param_3, u8 param_4, f32 param_5, f32 param_6, f32 param_7, f32 param_8, fopMsgCreateFunc createFunc); -inline s32 fopMsgM_Timer_create(s16 param_0, u8 param_1, u32 param_2, u8 param_3, u8 param_4, f32 param_5, - f32 param_6, f32 param_7, f32 param_8, fopMsgCreateFunc createFunc) { - return fop_Timer_create(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, createFunc); +inline s32 fopMsgM_Timer_create(s16 param_0, u8 param_1, u32 param_2, u8 param_3, u8 param_4, + f32 param_5, f32 param_6, f32 param_7, f32 param_8, + fopMsgCreateFunc createFunc) { + return fop_Timer_create(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, + param_8, createFunc); } #endif diff --git a/include/m_Do/m_Do_graphic.h b/include/m_Do/m_Do_graphic.h index d989cefe34e..1607cbc14e4 100644 --- a/include/m_Do/m_Do_graphic.h +++ b/include/m_Do/m_Do_graphic.h @@ -55,6 +55,8 @@ public: static void waitBlanking(int wait) { JFWDisplay::getManager()->waitBlanking(wait); } static f32 getWidthF() { return 608.0f; } static f32 getHeightF() { return 448.0f; } + static f32 getWidth() { return 608.0f; } + static f32 getHeight() { return 448.0f; } static f32 getMinYF() { return 0.0f; } static f32 getMinXF() { return 0.0f; } static int getMinY() { return 0; } @@ -66,6 +68,7 @@ public: static void setFadeRate(f32 rate) { mFadeRate = rate; } static f32 getFadeRate() { return mFadeRate; } static bloom_c* getBloom() { return &m_bloom; } + static GXColor& getFadeColor() { return mFadeColor; } static GXTexObj mFrameBufferTexObj; static GXTexObj mZbufferTexObj; diff --git a/libs/SSystem/SComponent/c_angle.cpp b/libs/SSystem/SComponent/c_angle.cpp index aaa73099882..676dcd79586 100644 --- a/libs/SSystem/SComponent/c_angle.cpp +++ b/libs/SSystem/SComponent/c_angle.cpp @@ -22,71 +22,71 @@ const cSAngle cSAngle::_270(static_cast(-0x4000)); /* 80270F68-80270F98 0030+00 s=0 e=33 z=2 None .text __ct__7cSAngleFRC7cSAngle */ cSAngle::cSAngle(const cSAngle& angle) { - this->Val(angle); + Val(angle); } /* 80270F98-80270FC8 0030+00 s=14 e=50 z=4 None .text __ct__7cSAngleFs */ cSAngle::cSAngle(s16 angle) { - this->Val(angle); + Val(angle); } /* 80270FC8-80270FF8 0030+00 s=0 e=22 z=0 None .text __ct__7cSAngleFf */ -cSAngle::cSAngle(float angle) { - this->Val(angle); +cSAngle::cSAngle(f32 angle) { + Val(angle); } /* 80270FF8-80271004 000C+00 s=2 e=6 z=0 None .text Val__7cSAngleFRC7cSAngle */ void cSAngle::Val(const cSAngle& other) { - this->mAngle = other.mAngle; + mAngle = other.mAngle; } /* 80271004-8027100C 0008+00 s=4 e=7 z=0 None .text Val__7cSAngleFs */ void cSAngle::Val(s16 val) { - this->mAngle = val; + mAngle = val; } /* 8027100C-80271030 0024+00 s=1 e=8 z=0 None .text Val__7cSAngleFf */ -void cSAngle::Val(float f) { - this->mAngle = 182.04445f * f; +void cSAngle::Val(f32 degree) { + mAngle = cAngle::Degree_to_SAngle(degree); } /* 80271030-80271064 0034+00 s=0 e=11 z=0 None .text Degree__7cSAngleCFv */ -float cSAngle::Degree(void) const { - return (360.0f / 65536.0f) * this->mAngle; +f32 cSAngle::Degree() const { + return cAngle::SAngle_to_Degree(mAngle); } /* 80271064-80271098 0034+00 s=3 e=0 z=0 None .text Radian__7cSAngleCFv */ -float cSAngle::Radian(void) const { - return 9.58738E-5f * this->mAngle; +f32 cSAngle::Radian() const { + return cAngle::SAngle_to_Radian(mAngle); } /* 80271098-802710CC 0034+00 s=0 e=1 z=0 None .text Norm__7cSAngleCFv */ -float cSAngle::Norm(void) const { - return 3.0517578E-5f * this->mAngle; +f32 cSAngle::Norm() const { + return cAngle::SAngle_to_Normal(mAngle); } /* 802710CC-802710E8 001C+00 s=0 e=5 z=1 None .text Abs__7cSAngleCFv */ -s16 cSAngle::Abs(void) const { +s16 cSAngle::Abs() const { return mAngle >= 0 ? mAngle : -mAngle; } /* 802710E8-802710F8 0010+00 s=2 e=22 z=2 None .text Inv__7cSAngleCFv */ -s16 cSAngle::Inv(void) const { +s16 cSAngle::Inv() const { return mAngle - 0x8000; } /* 802710F8-80271120 0028+00 s=0 e=6 z=1 None .text Sin__7cSAngleCFv */ -float cSAngle::Sin(void) const { - return sin(this->Radian()); +f32 cSAngle::Sin() const { + return sin(Radian()); } /* 80271120-80271148 0028+00 s=0 e=8 z=1 None .text Cos__7cSAngleCFv */ -float cSAngle::Cos(void) const { - return cos(this->Radian()); +f32 cSAngle::Cos() const { + return cos(Radian()); } /* 80271148-80271174 002C+00 s=2 e=8 z=0 None .text __mi__7cSAngleCFv */ -cSAngle cSAngle::operator-(void) const { +cSAngle cSAngle::operator-() const { return cSAngle(static_cast(-mAngle)); } @@ -111,149 +111,134 @@ void cSAngle::operator-=(const cSAngle& other) { } /* 802711FC-80271228 002C+00 s=0 e=5 z=0 None .text __pl__7cSAngleCFs */ -cSAngle cSAngle::operator+(short other) const { +cSAngle cSAngle::operator+(s16 other) const { return cSAngle(static_cast(mAngle + other)); } /* 80271228-80271254 002C+00 s=0 e=9 z=3 None .text __mi__7cSAngleCFs */ -cSAngle cSAngle::operator-(short other) const { +cSAngle cSAngle::operator-(s16 other) const { return cSAngle(static_cast(mAngle - other)); } /* 80271254-80271264 0010+00 s=0 e=1 z=0 None .text __apl__7cSAngleFs */ -void cSAngle::operator+=(short other) { +void cSAngle::operator+=(s16 other) { mAngle += other; } /* 80271264-802712B4 0050+00 s=0 e=31 z=0 None .text __ml__7cSAngleCFf */ -cSAngle cSAngle::operator*(float f1) const { +cSAngle cSAngle::operator*(f32 f1) const { return cSAngle(static_cast(mAngle * f1)); } /* 802712B4-802712F4 0040+00 s=0 e=3 z=0 None .text __amu__7cSAngleFf */ -void cSAngle::operator*=(float f1) { - this->mAngle *= f1; +void cSAngle::operator*=(f32 f1) { + mAngle *= f1; } /* 802712F4-80271320 002C+00 s=0 e=2 z=0 None .text __pl__FsRC7cSAngle */ -cSAngle operator+(short other, const cSAngle& angle) { +cSAngle operator+(s16 other, const cSAngle& angle) { return cSAngle(static_cast(other + angle.Val())); } /* 80271320-8027134C 002C+00 s=0 e=5 z=0 None .text __mi__FsRC7cSAngle */ -cSAngle operator-(short other, const cSAngle& angle) { +cSAngle operator-(s16 other, const cSAngle& angle) { return cSAngle(static_cast(other - angle.Val())); } /* 8027134C-8027137C 0030+00 s=0 e=3 z=0 None .text __ct__7cDegreeFf */ -cDegree::cDegree(float f) { - this->Val(f); -} - -struct cAngle { - template - static T Adjust(T f1, T f2, T f3); -}; - -template -T cAngle::Adjust(T f1, T f2, T f3) { - while (f1 >= f3) { - f1 -= f3 - f2; - } - while (f1 < f2) { - f1 += f3 - f2; - } - return f1; +cDegree::cDegree(f32 f) { + Val(f); } /* 8027137C-802713BC 0040+00 s=1 e=0 z=0 None .text Formal__7cDegreeFv */ -cDegree& cDegree::Formal(void) { +cDegree& cDegree::Formal() { mDegree = cAngle::Adjust(mDegree, -180.0f, 180.0f); - // mDegree = cAngle_NS_Adjust(mDegree, -180.0f, 180.0f); return *this; } /* 802713BC-802713E0 0024+00 s=1 e=0 z=0 None .text Val__7cDegreeFf */ -void cDegree::Val(float f) { +void cDegree::Val(f32 f) { mDegree = f; - this->Formal(); + Formal(); } /* 802713E0-802713F0 0010+00 s=3 e=0 z=0 None .text Radian__7cDegreeCFv */ -float cDegree::Radian(void) const { - return 0.017453292f * mDegree; +f32 cDegree::Radian() const { + return cAngle::Degree_to_Radian(mDegree); } /* 802713F0-80271418 0028+00 s=0 e=1 z=0 None .text Sin__7cDegreeCFv */ -float cDegree::Sin(void) const { - return sin(this->Radian()); +f32 cDegree::Sin() const { + return sin(Radian()); } /* 80271418-80271440 0028+00 s=0 e=2 z=0 None .text Cos__7cDegreeCFv */ -float cDegree::Cos(void) const { - return cos(this->Radian()); +f32 cDegree::Cos() const { + return cos(Radian()); } /* 80271440-80271468 0028+00 s=0 e=1 z=0 None .text Tan__7cDegreeCFv */ -float cDegree::Tan(void) const { - return tan(this->Radian()); +f32 cDegree::Tan() const { + return tan(Radian()); } /* 80271468-80271498 0030+00 s=1 e=0 z=0 None .text __ct__7cSPolarFRC4cXyz */ cSPolar::cSPolar(const cXyz& xyz) { - this->Val(xyz); + Val(xyz); } /* 80271498-80271558 00C0+00 s=2 e=0 z=0 None .text Formal__7cSPolarFv */ -cSPolar& cSPolar::Formal(void) { +cSPolar& cSPolar::Formal() { if (mRadial < 0.0f) { mRadial = -mRadial; cSAngle tmp(static_cast(-0x8000)); mAngle1.Val(tmp - mAngle1); mAngle2.Val(mAngle2.Inv()); } + if (mAngle1.Val() < 0 && mAngle1.Val() != -0x8000) { mAngle1.Val(-mAngle1); mAngle2.Val(mAngle2.Inv()); } + return *this; } /* 80271558-802715BC 0064+00 s=1 e=0 z=0 None .text Val__7cSPolarFfss */ -void cSPolar::Val(float f, short s1, short s2) { +void cSPolar::Val(f32 f, s16 s1, s16 s2) { mRadial = f; mAngle1 = cSAngle(s1); mAngle2 = cSAngle(s2); - this->Formal(); + Formal(); } -inline double square(float f) { +inline double square(f32 f) { return f * f; } /* 802715BC-802716EC 0130+00 s=1 e=0 z=0 None .text Val__7cSPolarFRC4cXyz */ void cSPolar::Val(const cXyz& xyz) { - float x, y, z, tmp4; + f32 x, y, z, tmp4; x = xyz.x; y = xyz.y; z = xyz.z; double tmp = square(z) + square(x); double tmp2 = square(y) + tmp; - tmp4 = (tmp > 0.0) ? (float)sqrt(tmp) : 0.0f; - mRadial = (tmp2 > 0.0) ? (float)sqrt(tmp2) : 0.0f; - mAngle1.Val(static_cast(cM_atan2f(tmp4, y) * 10430.378f)); - mAngle2.Val(static_cast(cM_atan2f(x, z) * 10430.378f)); - this->Formal(); + tmp4 = (tmp > 0.0) ? (f32)sqrt(tmp) : 0.0f; + mRadial = (tmp2 > 0.0) ? (f32)sqrt(tmp2) : 0.0f; + mAngle1.Val(cAngle::Radian_to_SAngle(cM_atan2f(tmp4, y))); + mAngle2.Val(cAngle::Radian_to_SAngle(cM_atan2f(x, z))); + Formal(); } /* 802716EC-802717B4 00C8+00 s=1 e=1 z=0 None .text Xyz__7cSPolarCFv */ -cXyz cSPolar::Xyz(void) const { - float ang1Cos; - float ang2Cos; - float ang1Sin = mRadial * (float)sin(mAngle1.Radian()); - ang2Cos = (float)cos(mAngle2.Radian()); - ang1Cos = mRadial * (float)cos(mAngle1.Radian()); - float ang2Sin = sin(mAngle2.Radian()); +cXyz cSPolar::Xyz() const { + f32 ang1Cos; + f32 ang2Cos; + f32 ang1Sin = mRadial * (f32)sin(mAngle1.Radian()); + ang2Cos = (f32)cos(mAngle2.Radian()); + ang1Cos = mRadial * (f32)cos(mAngle1.Radian()); + f32 ang2Sin = sin(mAngle2.Radian()); return cXyz(ang1Sin * ang2Sin, ang1Cos, ang1Sin * ang2Cos); } @@ -264,36 +249,37 @@ void cSPolar::Globe(cSGlobe* globe) const { /* 802717F0-80271820 0030+00 s=0 e=6 z=0 None .text __ct__7cSGlobeFRC7cSGlobe */ cSGlobe::cSGlobe(const cSGlobe& other) { - this->Val(other); + Val(other); } /* 80271820-80271850 0030+00 s=0 e=3 z=0 None .text __ct__7cSGlobeFfss */ -cSGlobe::cSGlobe(float f, short s1, short s2) { - this->Val(f, s1, s2); +cSGlobe::cSGlobe(f32 f, s16 s1, s16 s2) { + Val(f, s1, s2); } /* 80271850-80271880 0030+00 s=1 e=4 z=0 None .text __ct__7cSGlobeFfRC7cSAngleRC7cSAngle */ -cSGlobe::cSGlobe(float f, const cSAngle& a1, const cSAngle& a2) { - this->Val(f, a1, a2); +cSGlobe::cSGlobe(f32 f, const cSAngle& a1, const cSAngle& a2) { + Val(f, a1, a2); } /* 80271880-802718B0 0030+00 s=0 e=35 z=3 None .text __ct__7cSGlobeFRC4cXyz */ cSGlobe::cSGlobe(const cXyz& xyz) { - this->Val(xyz); + Val(xyz); } /* 802718B0-8027196C 00BC+00 s=5 e=0 z=0 None .text Formal__7cSGlobeFv */ -cSGlobe& cSGlobe::Formal(void) { +cSGlobe& cSGlobe::Formal() { if (mRadius < 0.0f) { mRadius = -mRadius; mAzimuth = -mAzimuth; mInclination.Val(mInclination.Inv()); } + if (mAzimuth.Val() < -0x4000 || 0x4000 < mAzimuth.Val()) { - // mAzimuth.mirrorAtMaxNeg(); mAzimuth = cSAngle((s16)-0x8000) - mAzimuth; mInclination.Val(mInclination.Inv()); } + return *this; } @@ -302,36 +288,36 @@ void cSGlobe::Val(const cSGlobe& other) { mRadius = other.mRadius; mAzimuth = other.mAzimuth; mInclination = other.mInclination; - this->Formal(); + Formal(); } /* 802719A4-80271A08 0064+00 s=2 e=3 z=0 None .text Val__7cSGlobeFfss */ -void cSGlobe::Val(float f, short s1, short s2) { +void cSGlobe::Val(f32 f, s16 s1, s16 s2) { mRadius = f; mAzimuth = cSAngle(s1); mInclination = cSAngle(s2); - this->Formal(); + Formal(); } /* 80271A08-80271A70 0068+00 s=1 e=11 z=0 None .text Val__7cSGlobeFfRC7cSAngleRC7cSAngle */ -void cSGlobe::Val(float f, const cSAngle& a1, const cSAngle& a2) { +void cSGlobe::Val(f32 f, const cSAngle& a1, const cSAngle& a2) { mRadius = f; mAzimuth = cSAngle(a1.Val()); mInclination = cSAngle(a2.Val()); - this->Formal(); + Formal(); } /* 80271A70-80271AB4 0044+00 s=1 e=38 z=0 None .text Val__7cSGlobeFRC4cXyz */ void cSGlobe::Val(const cXyz& xyz) { cSPolar csp(xyz); csp.Globe(this); - this->Formal(); + Formal(); } /* 80271AB4-80271AF4 0040+00 s=1 e=38 z=0 None .text Xyz__7cSGlobeCFv */ -cXyz cSGlobe::Xyz(void) const { +cXyz cSGlobe::Xyz() const { cSPolar csp; - this->Polar(&csp); + Polar(&csp); return csp.Xyz(); } @@ -340,18 +326,14 @@ void cSGlobe::Polar(cSPolar* csp) const { csp->Val(mRadius, 0x4000 - mAzimuth.Val(), mInclination.Val()); } -/* ############################################################################################## */ -/* 8045523C-80455240 00383C 0004+00 1/1 0/0 0/0 .sdata2 @2744 */ -SECTION_SDATA2 static f32 lit_2744 = 1.0f; - /* 80271B30-80271B7C 004C+00 s=0 e=3 z=0 None .text Norm__7cSGlobeCFv */ -cXyz cSGlobe::Norm(void) const { +cXyz cSGlobe::Norm() const { cSGlobe glob(1.0f, mAzimuth, mInclination); return glob.Xyz(); } /* 80271B7C-80271BA8 002C+00 s=0 e=2 z=0 None .text Invert__7cSGlobeFv */ -cSGlobe& cSGlobe::Invert(void) { +cSGlobe& cSGlobe::Invert() { mRadius = -mRadius; - return this->Formal(); + return Formal(); } diff --git a/src/d/d_cam_param.cpp b/src/d/d_cam_param.cpp index c8569314ea6..389d7e4db6e 100644 --- a/src/d/d_cam_param.cpp +++ b/src/d/d_cam_param.cpp @@ -1,159 +1,115 @@ -// -// Generated By: dol2asm -// Translation Unit: d/d_cam_param -// +/** + * d_cam_param.cpp + * + */ #include "d/d_cam_param.h" -#include "dol2asm.h" -#include "dolphin/types.h" +#include "SSystem/SComponent/c_math.h" #include "d/com/d_com_inf_game.h" +#include "dol2asm.h" // // Forward References: // -extern "C" void rationalBezierRatio__8dCamMathFff(); -extern "C" void zoomFovy__8dCamMathFff(); -extern "C" void __dt__7cDegreeFv(); -extern "C" void xyzRotateX__8dCamMathFR4cXyz7cSAngle(); -extern "C" void xyzRotateY__8dCamMathFR4cXyz7cSAngle(); -extern "C" void xyzHorizontalDistance__8dCamMathFR4cXyzR4cXyz(); -extern "C" void __ct__9dCstick_cFv(); -extern "C" bool Shift__9dCstick_cFUl(); -extern "C" void __ct__11dCamBGChk_cFv(); -extern "C" void __ct__11dCamParam_cFl(); extern "C" void __dt__11dCamParam_cFv(); -extern "C" void Change__11dCamParam_cFl(); -extern "C" void SearchStyle__11dCamParam_cFUl(); -extern "C" void __ct__11dCamSetup_cFv(); extern "C" void __dt__11dCamSetup_cFv(); -extern "C" void CheckLatitudeRange__11dCamSetup_cFPs(); -extern "C" void PlayerHideDist__11dCamSetup_cFv(); extern "C" void __dt__9dCstick_cFv(); -extern "C" extern char const* const d_d_cam_param__stringBase0; // // External References: // -extern "C" void mDoMtx_XrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void getRes__14dRes_control_cFPCcPCcP11dRes_info_ci(); -extern "C" void EventRecoverNotime__9dCamera_cFv(); -extern "C" void dCam_getBody__Fv(); -extern "C" void cM_atan2f__Fff(); -extern "C" void __ct__7cDegreeFf(); -extern "C" void Sin__7cDegreeCFv(); -extern "C" void Cos__7cDegreeCFv(); extern "C" void __dl__FPv(); // // Declarations: // -/* ############################################################################################## */ -/* 804527C8-804527D0 000DC8 0004+04 2/2 0/0 0/0 .sdata2 @3769 */ -SECTION_SDATA2 static f32 lit_3769[1 + 1 /* padding */] = { - 0.0f, - /* padding */ - 0.0f, -}; - -/* 804527D0-804527D8 000DD0 0008+00 1/1 0/0 0/0 .sdata2 @3770 */ -SECTION_SDATA2 static f64 lit_3770 = 1.0; - -/* 804527D8-804527E0 000DD8 0008+00 1/1 0/0 0/0 .sdata2 @3771 */ -SECTION_SDATA2 static f64 lit_3771 = -1.0; - -/* 804527E0-804527E8 000DE0 0008+00 1/1 0/0 0/0 .sdata2 @3772 */ -SECTION_SDATA2 static f64 lit_3772 = 2.0; - -/* 804527E8-804527F0 000DE8 0008+00 1/1 0/0 0/0 .sdata2 @3773 */ -SECTION_SDATA2 static f64 lit_3773 = 4.0; - -/* 804527F0-804527F8 000DF0 0008+00 1/1 0/0 0/0 .sdata2 @3774 */ -SECTION_SDATA2 static u8 lit_3774[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 804527F8-80452800 000DF8 0008+00 1/1 0/0 0/0 .sdata2 @3775 */ -SECTION_SDATA2 static f64 lit_3775 = 1e-07; - -/* 80452800-80452808 000E00 0008+00 1/1 0/0 0/0 .sdata2 @3776 */ -SECTION_SDATA2 static f64 lit_3776 = -1e-07; - -/* 80452808-80452810 000E08 0008+00 1/1 0/0 0/0 .sdata2 @3777 */ -SECTION_SDATA2 static f64 lit_3777 = 1.0000000116860974e-07; - /* 8008813C-80088284 082A7C 0148+00 0/0 12/12 0/0 .text rationalBezierRatio__8dCamMathFff */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamMath::rationalBezierRatio(f32 param_0, f32 param_1) { - nofralloc -#include "asm/d/d_cam_param/rationalBezierRatio__8dCamMathFff.s" +f32 dCamMath::rationalBezierRatio(f32 param_0, f32 param_1) { + f64 var_f31; + f32 var_f1 = param_0; + + if (var_f1 >= 0.0f) { + var_f31 = 1.0; + } else { + var_f31 = -1.0; + var_f1 = -var_f1; + } + + f64 temp_f2 = 2.0 * var_f1; + f64 temp_f2_2 = ((temp_f2 * param_1) - temp_f2) - (2.0 * param_1); + f64 temp_f29 = -temp_f2_2; + f64 temp_f28 = temp_f29 - 1.0; + f64 var_f1_2 = (temp_f2_2 * temp_f2_2) - (4.0 * temp_f28 * var_f1); + + if (var_f1_2 > 0.0) { + var_f1_2 = sqrt(var_f1_2); + } else { + var_f1_2 = 0.0; + } + + f64 temp = temp_f29 - var_f1_2; + f64 temp_f2_3 = temp_f28 * 2.0; + if (temp_f2_3 > 1e-07 || temp_f2_3 < -1e-07) { + f64 temp_f2_4 = temp / temp_f2_3; + f64 temp_f3 = temp_f2_4 * temp_f2_4; + f64 temp_f4 = 1.0 - temp_f2_4; + f64 temp_f1 = temp_f3 + ((temp_f4 * temp_f4) + (param_1 * (2.0 * temp_f4 * temp_f2_4))); + + if (temp_f1 > 1.0000000116860974e-07) { + return var_f31 * (temp_f3 / temp_f1); + } + return 0.0f; + } + + return 0.0f; } -#pragma pop /* ############################################################################################## */ /* 80452810-80452814 000E10 0004+00 2/2 0/0 0/0 .sdata2 @3791 */ -SECTION_SDATA2 static f32 lit_3791 = 1.0f; - -/* 80452814-80452818 000E14 0004+00 1/1 0/0 0/0 .sdata2 @3807 */ -SECTION_SDATA2 static f32 lit_3807 = 57.2957763671875f; +SECTION_SDATA2 static f32 lit_3791 = 1.0f; // placed in a weird order, so can't remove until fixed /* 80088284-800882E0 082BC4 005C+00 0/0 1/1 0/0 .text zoomFovy__8dCamMathFff */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamMath::zoomFovy(f32 param_0, f32 param_1) { - nofralloc -#include "asm/d/d_cam_param/zoomFovy__8dCamMathFff.s" -} -#pragma pop +f32 dCamMath::zoomFovy(f32 param_0, f32 param_1) { + cDegree deg(param_0); -/* 800882E0-8008831C 082C20 003C+00 0/0 1/1 0/0 .text __dt__7cDegreeFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cDegree::~cDegree() { -extern "C" asm void __dt__7cDegreeFv() { - nofralloc -#include "asm/d/d_cam_param/__dt__7cDegreeFv.s" + f32 radian = cM_atan2f(deg.Sin(), param_1 * deg.Cos()); + return cAngle::r2d(radian); } -#pragma pop /* 8008831C-80088384 082C5C 0068+00 0/0 1/1 0/0 .text xyzRotateX__8dCamMathFR4cXyz7cSAngle */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamMath::xyzRotateX(cXyz& param_0, cSAngle param_1) { - nofralloc -#include "asm/d/d_cam_param/xyzRotateX__8dCamMathFR4cXyz7cSAngle.s" +cXyz dCamMath::xyzRotateX(cXyz& i_xyz, cSAngle i_angle) { + Mtx m; + cXyz rot_xyz; + + s16 angle = i_angle.Val(); + mDoMtx_XrotS(m, angle); + PSMTXMultVec(m, &i_xyz, &rot_xyz); + return rot_xyz; } -#pragma pop /* 80088384-800883EC 082CC4 0068+00 0/0 13/13 0/0 .text xyzRotateY__8dCamMathFR4cXyz7cSAngle */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamMath::xyzRotateY(cXyz& param_0, cSAngle param_1) { - nofralloc -#include "asm/d/d_cam_param/xyzRotateY__8dCamMathFR4cXyz7cSAngle.s" +cXyz dCamMath::xyzRotateY(cXyz& i_xyz, cSAngle i_angle) { + Mtx m; + cXyz rot_xyz; + + s16 angle = i_angle.Val(); + mDoMtx_YrotS(m, angle); + PSMTXMultVec(m, &i_xyz, &rot_xyz); + return rot_xyz; } -#pragma pop /* 800883EC-80088434 082D2C 0048+00 0/0 9/9 0/0 .text * xyzHorizontalDistance__8dCamMathFR4cXyzR4cXyz */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamMath::xyzHorizontalDistance(cXyz& param_0, cXyz& param_1) { - nofralloc -#include "asm/d/d_cam_param/xyzHorizontalDistance__8dCamMathFR4cXyzR4cXyz.s" +f32 dCamMath::xyzHorizontalDistance(cXyz& i_posA, cXyz& i_posB) { + f64 x = i_posA.x - i_posB.x; + f64 z = i_posA.z - i_posB.z; + + return sqrt((x * x) + (z * z)); } -#pragma pop /* ############################################################################################## */ /* 803AC500-803AC50C 009620 000C+00 2/2 0/0 0/0 .data __vt__11dCamSetup_c */ @@ -179,98 +135,56 @@ SECTION_DATA extern void* __vt__9dCstick_c[3 + 1 /* padding */] = { NULL, }; -/* 80452818-8045281C 000E18 0004+00 3/3 0/0 0/0 .sdata2 @3991 */ -SECTION_SDATA2 static f32 lit_3991 = 1.0f / 5.0f; - -/* 8045281C-80452820 000E1C 0004+00 1/1 0/0 0/0 .sdata2 @3992 */ -SECTION_SDATA2 static f32 lit_3992 = 19.0f / 20.0f; - /* 80088434-8008845C 082D74 0028+00 1/1 0/0 0/0 .text __ct__9dCstick_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dCstick_c::dCstick_c() { - nofralloc -#include "asm/d/d_cam_param/__ct__9dCstick_cFv.s" +dCstick_c::dCstick_c() { + mThresholdLow = 0.2f; + mThresholdHigh = 0.95f; + mInputSpeed = 6; } -#pragma pop /* 8008845C-80088464 082D9C 0008+00 0/0 1/1 0/0 .text Shift__9dCstick_cFUl */ bool dCstick_c::Shift(u32 param_0) { return false; } -/* ############################################################################################## */ -/* 80452820-80452824 000E20 0004+00 1/1 0/0 0/0 .sdata2 @4001 */ -SECTION_SDATA2 static f32 lit_4001 = 32.0f; - -/* 80452824-80452828 000E24 0004+00 2/2 0/0 0/0 .sdata2 @4002 */ -SECTION_SDATA2 static f32 lit_4002 = 25.0f; - -/* 80452828-8045282C 000E28 0004+00 2/2 0/0 0/0 .sdata2 @4003 */ -SECTION_SDATA2 static f32 lit_4003 = 2.0f / 5.0f; - -/* 8045282C-80452830 000E2C 0004+00 1/1 0/0 0/0 .sdata2 @4004 */ -SECTION_SDATA2 static f32 lit_4004 = 3.0f / 5.0f; - -/* 80452830-80452834 000E30 0004+00 1/1 0/0 0/0 .sdata2 @4005 */ -SECTION_SDATA2 static f32 lit_4005 = 3.0f; - -/* 80452834-80452838 000E34 0004+00 2/2 0/0 0/0 .sdata2 @4006 */ -SECTION_SDATA2 static f32 lit_4006 = 15.0f; - -/* 80452838-8045283C 000E38 0004+00 2/2 0/0 0/0 .sdata2 @4007 */ -SECTION_SDATA2 static f32 lit_4007 = 0.5f; - -/* 8045283C-80452840 000E3C 0004+00 2/2 0/0 0/0 .sdata2 @4008 */ -SECTION_SDATA2 static f32 lit_4008 = 3.0f / 10.0f; - -/* 80452840-80452844 000E40 0004+00 2/2 0/0 0/0 .sdata2 @4009 */ -SECTION_SDATA2 static f32 lit_4009 = 10.0f; - -/* 80452844-80452848 000E44 0004+00 2/2 0/0 0/0 .sdata2 @4010 */ -SECTION_SDATA2 static f32 lit_4010 = 1.0f / 10.0f; - -/* 80452848-8045284C 000E48 0004+00 2/2 0/0 0/0 .sdata2 @4011 */ -SECTION_SDATA2 static f32 lit_4011 = 0.75f; - -/* 8045284C-80452850 000E4C 0004+00 2/2 0/0 0/0 .sdata2 @4012 */ -SECTION_SDATA2 static f32 lit_4012 = 80.0f; - -/* 80452850-80452854 000E50 0004+00 1/1 0/0 0/0 .sdata2 @4013 */ -SECTION_SDATA2 static f32 lit_4013 = 2.0f / 25.0f; - -/* 80452854-80452858 000E54 0004+00 2/2 0/0 0/0 .sdata2 @4014 */ -SECTION_SDATA2 static f32 lit_4014 = 120.0f; - /* 80088464-800884F0 082DA4 008C+00 1/1 0/0 0/0 .text __ct__11dCamBGChk_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dCamBGChk_c::dCamBGChk_c() { - nofralloc -#include "asm/d/d_cam_param/__ct__11dCamBGChk_cFv.s" -} -#pragma pop +dCamBGChk_c::dCamBGChk_c() { + mFloorMargin = 32.0f; -/* ############################################################################################## */ -/* 8037A7E0-8037A7E0 006E40 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8037A7E0 = "camstyle.dat"; -/* @stringBase0 padding */ -SECTION_DEAD static char const* const pad_8037A7ED = "\0\0"; -#pragma pop + mChkInfo[0].mDistance = lit_3791; + mChkInfo[0].mChkAngle = 25.0f; + mChkInfo[0].mWeightH = 0.4f; + mChkInfo[0].mWeightL = 0.6f; + + mChkInfo[1].mDistance = 3.0f; + mChkInfo[1].mChkAngle = 15.0f; + mChkInfo[1].mWeightH = 0.5f; + mChkInfo[1].mWeightL = 0.3f; + + mFwdBackMargin = 10.0f; + mFwdCushion = 0.1f; + field_0x2c = 0.2f; + mGazeBackMargin = 10.0f; + mCornerCushion = 0.75f; + mWallCushion = 0.5f; + mWallUpDistance = 80.0f; + mWallBackCushion = 0.08f; + mCornerAngleMax = 120.0f; +} /* 800884F0-8008858C 082E30 009C+00 0/0 1/1 0/0 .text __ct__11dCamParam_cFl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dCamParam_c::dCamParam_c(s32 param_0) { - nofralloc -#include "asm/d/d_cam_param/__ct__11dCamParam_cFl.s" +dCamParam_c::dCamParam_c(s32 i_styleID) { + u8* cam_data = (u8*)dComIfG_getObjectRes(dComIfGp_getCameraParamFileName(0), "camstyle.dat"); + + mCamStyleData = (dCamStyleData::StyleData*)(cam_data + 8); + mStyleNum = ((dCamStyleData*)cam_data)->mStyleNum; + Change(i_styleID); + + mMapToolFovy = 0xFF; + mMapToolArg0 = 0xFF; + mMapToolArg1 = 0xFF; + mMapToolArg2 = -1; } -#pragma pop /* 8008858C-800885D4 082ECC 0048+00 1/0 1/1 0/0 .text __dt__11dCamParam_cFv */ #pragma push @@ -284,104 +198,118 @@ extern "C" asm void __dt__11dCamParam_cFv() { #pragma pop /* 800885D4-80088620 082F14 004C+00 1/1 7/7 0/0 .text Change__11dCamParam_cFl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamParam_c::Change(s32 param_0) { - nofralloc -#include "asm/d/d_cam_param/Change__11dCamParam_cFl.s" +int dCamParam_c::Change(s32 i_styleID) { + if (i_styleID >= 0 && i_styleID < mStyleNum) { + mStyleID = i_styleID; + mCurrentStyle = &mCamStyleData[mStyleID]; + return 1; + } + + mStyleID = 0; + mCurrentStyle = mCamStyleData; + return 0; } -#pragma pop /* 80088620-80088668 082F60 0048+00 0/0 4/4 0/0 .text SearchStyle__11dCamParam_cFUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamParam_c::SearchStyle(u32 param_0) { - nofralloc -#include "asm/d/d_cam_param/SearchStyle__11dCamParam_cFUl.s" +int dCamParam_c::SearchStyle(u32 param_0) { + int styleID = -1; + + for (int i = 0; i < mStyleNum; i++) { + if (param_0 == mCamStyleData[i].field_0x0) { + styleID = i; + break; + } + } + + return styleID; } -#pragma pop /* ############################################################################################## */ /* 80452858-8045285C 000E58 0004+00 1/1 0/0 0/0 .sdata2 @4058 */ -SECTION_SDATA2 static f32 lit_4058 = 0.25f; - -/* 8045285C-80452860 000E5C 0004+00 1/1 0/0 0/0 .sdata2 @4119 */ -SECTION_SDATA2 static f32 lit_4119 = 100000.0f; - -/* 80452860-80452864 000E60 0004+00 1/1 0/0 0/0 .sdata2 @4120 */ -SECTION_SDATA2 static f32 lit_4120 = 1.0f / 20.0f; - -/* 80452864-80452868 000E64 0004+00 1/1 0/0 0/0 .sdata2 @4121 */ -SECTION_SDATA2 static f32 lit_4121 = -60.0f; - -/* 80452868-8045286C 000E68 0004+00 1/1 0/0 0/0 .sdata2 @4122 */ -SECTION_SDATA2 static f32 lit_4122 = 33.0f / 100.0f; - -/* 8045286C-80452870 000E6C 0004+00 1/1 0/0 0/0 .sdata2 @4123 */ -SECTION_SDATA2 static f32 lit_4123 = 1.0f / 50.0f; - -/* 80452870-80452874 000E70 0004+00 1/1 0/0 0/0 .sdata2 @4124 */ -SECTION_SDATA2 static f32 lit_4124 = 100.0f; - -/* 80452874-80452878 000E74 0004+00 1/1 0/0 0/0 .sdata2 @4125 */ -SECTION_SDATA2 static f32 lit_4125 = 7.0f / 25.0f; - -/* 80452878-8045287C 000E78 0004+00 1/1 0/0 0/0 .sdata2 @4126 */ -SECTION_SDATA2 static f32 lit_4126 = 3.0f / 20.0f; - -/* 8045287C-80452880 000E7C 0004+00 1/1 0/0 0/0 .sdata2 @4127 */ -SECTION_SDATA2 static f32 lit_4127 = 0.004999999888241291f; - -/* 80452880-80452884 000E80 0004+00 1/1 0/0 0/0 .sdata2 @4128 */ -SECTION_SDATA2 static f32 lit_4128 = 3.0f / 50.0f; - -/* 80452884-80452888 000E84 0004+00 1/1 0/0 0/0 .sdata2 @4129 */ -SECTION_SDATA2 static f32 lit_4129 = 70.0f; - -/* 80452888-8045288C 000E88 0004+00 1/1 0/0 0/0 .sdata2 @4130 */ -SECTION_SDATA2 static f32 lit_4130 = 60.0f; - -/* 8045288C-80452890 000E8C 0004+00 1/1 0/0 0/0 .sdata2 @4131 */ -SECTION_SDATA2 static f32 lit_4131 = 35.0f; - -/* 80452890-80452894 000E90 0004+00 1/1 0/0 0/0 .sdata2 @4132 */ -SECTION_SDATA2 static f32 lit_4132 = 65.0f; - -/* 80452894-80452898 000E94 0004+00 1/1 0/0 0/0 .sdata2 @4133 */ -SECTION_SDATA2 static f32 lit_4133 = 30.0f; - -/* 80452898-8045289C 000E98 0004+00 1/1 0/0 0/0 .sdata2 @4134 */ -SECTION_SDATA2 static f32 lit_4134 = 27.0f; - -/* 8045289C-804528A0 000E9C 0004+00 1/1 0/0 0/0 .sdata2 @4135 */ -SECTION_SDATA2 static f32 lit_4135 = 45.0f; - -/* 804528A0-804528A4 000EA0 0004+00 1/1 0/0 0/0 .sdata2 @4136 */ -SECTION_SDATA2 static f32 lit_4136 = 3500.0f; - -/* 804528A4-804528A8 000EA4 0004+00 1/1 0/0 0/0 .sdata2 @4137 */ -SECTION_SDATA2 static f32 lit_4137 = 4.0f; - -/* 804528A8-804528AC 000EA8 0004+00 1/1 0/0 0/0 .sdata2 @4138 */ -SECTION_SDATA2 static f32 lit_4138 = 1200.0f; - -/* 804528AC-804528B0 000EAC 0004+00 1/1 0/0 0/0 .sdata2 @4139 */ -SECTION_SDATA2 static f32 lit_4139 = 17.0f / 20.0f; - -/* 804528B0-804528B4 000EB0 0004+00 1/1 0/0 0/0 .sdata2 @4140 */ -SECTION_SDATA2 static f32 lit_4140 = 50.0f; +SECTION_SDATA2 static f32 lit_4058 = 0.25f; // placed in a weird order, so can't remove until fixed /* 80088668-800888B8 082FA8 0250+00 0/0 1/1 0/0 .text __ct__11dCamSetup_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dCamSetup_c::dCamSetup_c() { - nofralloc -#include "asm/d/d_cam_param/__ct__11dCamSetup_cFv.s" +dCamSetup_c::dCamSetup_c() { + f32 temp_1 = lit_3791; + + mDrawNear = temp_1; + mDrawFar = 100000.0f; + field_0xc = 1; + mModeSwitchType = -1; + mForceType = -1; + mCusCus = 0.2f; + field_0x24 = 0.05f; + field_0x60 = 80.0f; + field_0x5c = -60.0f; + field_0x28 = 0.33f; + field_0x2c = 0.02f; + field_0x50 = 100.0f; + field_0x30 = 0.75f; + mBaseCushion = 0.28f; + mJumpCushion = temp_1; + field_0x58 = 0.15f; + field_0x44 = 0.005f; + field_0x54 = 0.06f; + mCurveWeight = temp_1; + field_0x34 = 25.0f; + mSubjLinkCullDist = 70.0f; + mParallelDist = 60.0f; + mTrimVistaHeight = 35.0f; + mTrimCineScopeHeight = 65.0f; + field_0xb0 = 150; + field_0xb4 = 60.0f; + mManualStartCThreshold = 0.3f; + mManualEndVal = 0.2f; + mFalseValue = 0.1f; + mFalseAngle = 30.0f; + mDebugFlags = 1; + + field_0xa = 0x118; + field_0xa |= 0x200; + field_0xa |= 0x400; + + mChargeLatitude = 27.0f; + mChargeTimer = 90; + mChargeBRatio = 0.5f; + mLockonChangeTimer = 40; + mLockonChangeCushion = lit_4058; + field_0x6c = 45.0f; + mForceLockOffDist = 3500.0f; + mForceLockOffTimer = 90; + mThrowTimer = 30; + mThrowVAngle = 25.0f; + mThrowCushion = 0.05f; + mThrowCtrOffset = 10.0f; + field_0x78 = 0.5f; + field_0x7c = 0.4f; + field_0x80 = 10.0f; + field_0x84 = 4.0f; + field_0xd4 = 60.0f; + field_0xd8 = 100.0f; + mWindShakeCtr = 15.0f; + mWindShakeFvy = 0.3f; + mMapToolCamShortTimer = 60; + mMapToolCamLongTimer = 120; + mDebugFlags |= 0x4800; + field_0x15c = 0.0f; + field_0x160 = 0.0f; + mDebugFlags |= 0x800; + mWaitRollTimer = 120; + mWaitRollSpeed = 0.02f; + field_0x16c = 1200.0f; + field_0xe0 = 0.06f; + field_0xec = 25; + field_0xf4 = 0.85f; + field_0xf8 = temp_1; + field_0xf0 = 12; + field_0xe4 = 50.0f; + field_0xe8 = 0.0f; + mScreensaverFirstWaitTimer = 30; + mScreensaverWaitTimer = 600; + mScreensaverExecTimer = 120; + + dCam_getBody()->EventRecoverNotime(); } -#pragma pop /* 800888B8-80088918 0831F8 0060+00 1/0 1/1 0/0 .text __dt__11dCamSetup_cFv */ #pragma push @@ -394,38 +322,32 @@ extern "C" asm void __dt__11dCamSetup_cFv() { } #pragma pop -/* ############################################################################################## */ -/* 804528B4-804528B8 000EB4 0004+00 1/1 0/0 0/0 .sdata2 @4173 */ -SECTION_SDATA2 static f32 lit_4173 = 182.04444885253906f; - /* 80088918-80088988 083258 0070+00 0/0 1/1 0/0 .text CheckLatitudeRange__11dCamSetup_cFPs */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamSetup_c::CheckLatitudeRange(s16* param_0) { - nofralloc -#include "asm/d/d_cam_param/CheckLatitudeRange__11dCamSetup_cFPs.s" +bool dCamSetup_c::CheckLatitudeRange(s16* param_0) { + s16 temp0 = cAngle::d2s(field_0x60); + s16 temp1 = cAngle::d2s(field_0x5c); + + if (*param_0 > temp0) { + *param_0 = temp0; + return false; + } + + if (*param_0 < temp1) { + *param_0 = temp1; + return false; + } + + return true; } -#pragma pop /* 80088988-800889B0 0832C8 0028+00 0/0 1/1 0/0 .text PlayerHideDist__11dCamSetup_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamSetup_c::PlayerHideDist() { - nofralloc -#include "asm/d/d_cam_param/PlayerHideDist__11dCamSetup_cFv.s" +f32 dCamSetup_c::PlayerHideDist() { + if (daPy_py_c::i_checkNowWolf()) { + return 120.0f; + } + + return mSubjLinkCullDist; } -#pragma pop /* 800889B0-800889F8 0832F0 0048+00 1/0 0/0 0/0 .text __dt__9dCstick_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dCstick_c::~dCstick_c() { - nofralloc -#include "asm/d/d_cam_param/__dt__9dCstick_cFv.s" -} -#pragma pop - -/* 8037A7E0-8037A7E0 006E40 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +dCstick_c::~dCstick_c() {} diff --git a/src/d/d_door_param2.cpp b/src/d/d_door_param2.cpp index 8c98dacc821..ba9fcd64f31 100644 --- a/src/d/d_door_param2.cpp +++ b/src/d/d_door_param2.cpp @@ -1,257 +1,107 @@ -// -// Generated By: dol2asm -// Translation Unit: d/d_door_param2 -// +/** + * d_door_param2.cpp + * + */ #include "d/d_door_param2.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Types: -// - -struct fopAc_ac_c {}; - -struct door_param2_c { - /* 8003A188 */ void getKind(fopAc_ac_c*); - /* 8003A194 */ void getDoorModel(fopAc_ac_c*); - /* 8003A1A0 */ void getFrontOption(fopAc_ac_c*); - /* 8003A1AC */ void getBackOption(fopAc_ac_c*); - /* 8003A1B8 */ void getFRoomNo(fopAc_ac_c*); - /* 8003A1C4 */ void getBRoomNo(fopAc_ac_c*); - /* 8003A1D0 */ void getSwbit(fopAc_ac_c*); - /* 8003A1DC */ void getSwbit2(fopAc_ac_c*); - /* 8003A1E8 */ void getSwbit3(fopAc_ac_c*); - /* 8003A1F4 */ void isMsgDoor(fopAc_ac_c*); - /* 8003A200 */ void getEventNo(fopAc_ac_c*); - /* 8003A20C */ void getEventNo2(fopAc_ac_c*); - /* 8003A218 */ void getMsgNo(fopAc_ac_c*); - /* 8003A224 */ void getExitNo(fopAc_ac_c*); - /* 8003A230 */ void getFLightInf(fopAc_ac_c*); - /* 8003A23C */ void getBLightInf(fopAc_ac_c*); - /* 8003A248 */ void getMFLightInf(fopAc_ac_c*); - /* 8003A254 */ void getMBLightInf(fopAc_ac_c*); -}; - -// -// Forward References: -// - -extern "C" void getKind__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getDoorModel__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getFrontOption__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getBackOption__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getFRoomNo__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getBRoomNo__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getSwbit__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getSwbit2__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getSwbit3__13door_param2_cFP10fopAc_ac_c(); -extern "C" void isMsgDoor__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getEventNo__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getEventNo2__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getMsgNo__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getExitNo__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getFLightInf__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getBLightInf__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getMFLightInf__13door_param2_cFP10fopAc_ac_c(); -extern "C" void getMBLightInf__13door_param2_cFP10fopAc_ac_c(); - -// -// External References: -// - -// -// Declarations: -// /* 8003A188-8003A194 034AC8 000C+00 0/0 0/0 17/17 .text getKind__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getKind(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getKind__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getKind(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 0, 5); } -#pragma pop /* 8003A194-8003A1A0 034AD4 000C+00 0/0 0/0 2/2 .text getDoorModel__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getDoorModel(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getDoorModel__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getDoorModel(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 5, 3); } -#pragma pop /* 8003A1A0-8003A1AC 034AE0 000C+00 0/0 0/0 17/17 .text * getFrontOption__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getFrontOption(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getFrontOption__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getFrontOption(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 8, 2); } -#pragma pop /* 8003A1AC-8003A1B8 034AEC 000C+00 0/0 0/0 14/14 .text * getBackOption__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getBackOption(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getBackOption__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getBackOption(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 10, 3); } -#pragma pop /* 8003A1B8-8003A1C4 034AF8 000C+00 0/0 0/0 19/19 .text getFRoomNo__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getFRoomNo(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getFRoomNo__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getFRoomNo(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 13, 6); } -#pragma pop /* 8003A1C4-8003A1D0 034B04 000C+00 0/0 0/0 10/10 .text getBRoomNo__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getBRoomNo(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getBRoomNo__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getBRoomNo(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 19, 6); } -#pragma pop /* 8003A1D0-8003A1DC 034B10 000C+00 0/0 0/0 25/25 .text getSwbit__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getSwbit(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getSwbit__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getSwbit(fopAc_ac_c* i_actor) { + return i_actor->orig.angle.z & 0xFF; } -#pragma pop /* 8003A1DC-8003A1E8 034B1C 000C+00 0/0 0/0 12/12 .text getSwbit2__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getSwbit2(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getSwbit2__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getSwbit2(fopAc_ac_c* i_actor) { + return (i_actor->orig.angle.z >> 8) & 0xFF; } -#pragma pop /* 8003A1E8-8003A1F4 034B28 000C+00 0/0 0/0 3/3 .text getSwbit3__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getSwbit3(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getSwbit3__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getSwbit3(fopAc_ac_c* i_actor) { + return (i_actor->orig.angle.x >> 8) & 0xFF; } -#pragma pop /* 8003A1F4-8003A200 034B34 000C+00 0/0 0/0 4/4 .text isMsgDoor__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::isMsgDoor(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/isMsgDoor__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::isMsgDoor(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 31, 1); } -#pragma pop /* 8003A200-8003A20C 034B40 000C+00 0/0 0/0 3/3 .text getEventNo__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getEventNo(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getEventNo__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getEventNo(fopAc_ac_c* i_actor) { + return i_actor->orig.angle.x & 0xFF; } -#pragma pop /* 8003A20C-8003A218 034B4C 000C+00 0/0 0/0 2/2 .text getEventNo2__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getEventNo2(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getEventNo2__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getEventNo2(fopAc_ac_c* i_actor) { + return (i_actor->orig.angle.x >> 8) & 0xFF; } -#pragma pop /* 8003A218-8003A224 034B58 000C+00 0/0 0/0 2/2 .text getMsgNo__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getMsgNo(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getMsgNo__13door_param2_cFP10fopAc_ac_c.s" +u16 door_param2_c::getMsgNo(fopAc_ac_c* i_actor) { + return i_actor->orig.angle.x; } -#pragma pop /* 8003A224-8003A230 034B64 000C+00 0/0 0/0 6/6 .text getExitNo__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getExitNo(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getExitNo__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getExitNo(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 25, 6); } -#pragma pop /* 8003A230-8003A23C 034B70 000C+00 0/0 0/0 1/1 .text getFLightInf__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getFLightInf(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getFLightInf__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getFLightInf(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 25, 3); } -#pragma pop /* 8003A23C-8003A248 034B7C 000C+00 0/0 0/0 1/1 .text getBLightInf__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getBLightInf(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getBLightInf__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getBLightInf(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 28, 3); } -#pragma pop /* 8003A248-8003A254 034B88 000C+00 0/0 0/0 1/1 .text getMFLightInf__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getMFLightInf(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getMFLightInf__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getMFLightInf(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 19, 3); } -#pragma pop /* 8003A254-8003A260 034B94 000C+00 0/0 0/0 1/1 .text getMBLightInf__13door_param2_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void door_param2_c::getMBLightInf(fopAc_ac_c* param_0) { - nofralloc -#include "asm/d/d_door_param2/getMBLightInf__13door_param2_cFP10fopAc_ac_c.s" +u8 door_param2_c::getMBLightInf(fopAc_ac_c* i_actor) { + return fopAcM_GetParamBit(i_actor, 22, 3); } -#pragma pop diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index 772ac395b58..e52dd6bcdc7 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -6,13 +6,14 @@ #include "d/d_drawlist.h" #include "JSystem/J3DGraphBase/J3DShape.h" #include "JSystem/J3DGraphBase/J3DSys.h" +#include "d/com/d_com_inf_game.h" #include "dol2asm.h" #include "dolphin/mtx/mtx44.h" #include "dolphin/mtx/mtxvec.h" #include "dolphin/types.h" -#include "m_Do/m_Do_mtx.h" -#include "m_Do/m_Do_lib.h" #include "m_Do/m_Do_graphic.h" +#include "m_Do/m_Do_lib.h" +#include "m_Do/m_Do_mtx.h" // // Types: @@ -50,16 +51,6 @@ struct dDlst_2DM_c { /* 80052C58 */ void draw(); }; -struct cBgS_ShdwDraw { - /* 80267F88 */ cBgS_ShdwDraw(); - /* 80267FD0 */ ~cBgS_ShdwDraw(); - /* 80268048 */ void Set(cXyz&, cXyz&); -}; - -struct cBgS { - /* 80074840 */ void ShdwDraw(cBgS_ShdwDraw*); -}; - struct ShdwDrawPoly_c { /* 80054A6C */ ~ShdwDrawPoly_c(); }; @@ -226,13 +217,9 @@ extern "C" extern void* __vt__12dDlst_base_c[3]; extern "C" extern void* __vt__9J3DPacket[5]; extern "C" u8 now__14mDoMtx_stack_c[48]; extern "C" u8 mClipper__14mDoLib_clipper[92]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; extern "C" extern u8 g_envHIO[68]; extern "C" u8 sincosTable___5JMath[65536]; extern "C" u8 mBackColor__13mDoGph_gInf_c[4]; -extern "C" extern u8 g_clearColor[4]; -extern "C" extern u32 g_blackColor; -extern "C" extern u32 g_whiteColor; extern "C" f32 mSystemFar__14mDoLib_clipper; extern "C" f32 mFovyRate__14mDoLib_clipper; extern "C" u8 sOldVcdVatCmd__8J3DShape[4]; @@ -242,8 +229,7 @@ extern "C" u8 sOldVcdVatCmd__8J3DShape[4]; // /* 80051AC0-80051ADC 04C400 001C+00 0/0 3/3 0/0 .text setViewPort__14dDlst_window_cFffffff */ -void dDlst_window_c::setViewPort(f32 xOrig, f32 yOrig, f32 width, f32 height, f32 nearZ, - f32 farZ) { +void dDlst_window_c::setViewPort(f32 xOrig, f32 yOrig, f32 width, f32 height, f32 nearZ, f32 farZ) { mXOrig = xOrig; mYOrig = yOrig; mWidth = width; @@ -346,779 +332,104 @@ extern "C" asm void draw__12dDlst_2DT2_cFv() { /* ############################################################################################## */ /* 803A87A0-803A87C0 0058C0 000C+14 2/2 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12 + 20 /* padding */] = { - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* 803A87C0-803A8800 0058E0 003C+04 0/0 0/0 0/0 .data l_frontZMat */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_frontZMat[60 + 4 /* padding */] = { - 0x61, - 0x40, - 0x00, - 0x00, - 0x07, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x01, - 0x61, - 0x00, - 0x00, - 0x40, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_frontZMat[] ALIGN_DECL(32) = { + 0x61, 0x40, 0x00, 0x00, 0x07, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A8800-803A882C 005920 002A+02 0/0 0/0 0/0 .data l_frontNoZSubMat */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_frontNoZSubMat[42 + 2 /* padding */] = { - 0x61, - 0x40, - 0x00, - 0x00, - 0x06, - 0x61, - 0x41, - 0x00, - 0x09, - 0x35, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, +SECTION_DATA static u8 l_frontNoZSubMat[] ALIGN_DECL(32) = { + 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x09, 0x35, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A882C-803A88A0 00594C 0060+14 0/1 0/0 0/0 .data l_shadowVolPos */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_shadowVolPos[96 + 20 /* padding */] = { - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xC3, - 0x96, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xC3, - 0x96, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xC3, - 0x96, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xC3, - 0x96, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static Vec l_shadowVolPos[] = { + {-1.0f, -1.0f, 0.0f}, {-1.0f, -1.0f, -300.0f}, {-1.0f, 1.0f, 0.0f}, {-1.0f, 1.0f, -300.0f}, + {1.0f, -1.0f, 0.0f}, {1.0f, -1.0f, -300.0f}, {1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, -300.0f}, }; #pragma pop /* 803A88A0-803A88E0 0059C0 003B+05 0/0 0/0 0/0 .data l_shadowVolDL */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_shadowVolDL[59 + 5 /* padding */] = { - 0x80, - 0x00, - 0x18, - 0x06, - 0x02, - 0x03, - 0x07, - 0x00, - 0x04, - 0x05, - 0x01, - 0x06, - 0x04, - 0x00, - 0x02, - 0x07, - 0x05, - 0x04, - 0x06, - 0x03, - 0x01, - 0x05, - 0x07, - 0x02, - 0x00, - 0x01, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_shadowVolDL[] ALIGN_DECL(32) = { + 0x80, 0x00, 0x18, 0x06, 0x02, 0x03, 0x07, 0x00, 0x04, 0x05, 0x01, 0x06, 0x04, 0x00, 0x02, + 0x07, 0x05, 0x04, 0x06, 0x03, 0x01, 0x05, 0x07, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A88E0-803A8940 005A00 005A+06 1/1 0/0 0/0 .data l_shadowProjMat */ -SECTION_DATA static u8 l_shadowProjMat[90 + 6 /* padding */] = { - 0x61, - 0x28, - 0x38, - 0x03, - 0xC0, - 0x61, - 0xC0, - 0x08, - 0xFF, - 0xFF, - 0x61, - 0xC1, - 0x08, - 0xE6, - 0x70, - 0x61, - 0x43, - 0x00, - 0x00, - 0x01, - 0x61, - 0x40, - 0x00, - 0x00, - 0x07, - 0x61, - 0x41, - 0x00, - 0x04, - 0xAD, - 0x61, - 0xF3, - 0x64, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x01, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x00, - 0x61, - 0x00, - 0x00, - 0x40, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_shadowProjMat[] ALIGN_DECL(32) = { + 0x61, 0x28, 0x38, 0x03, 0xC0, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1, 0x08, 0xE6, 0x70, + 0x61, 0x43, 0x00, 0x00, 0x01, 0x61, 0x40, 0x00, 0x00, 0x07, 0x61, 0x41, 0x00, 0x04, 0xAD, + 0x61, 0xF3, 0x64, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, + 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* 803A8940-803A89A0 005A60 005A+06 0/0 0/0 0/0 .data l_shadowVolMat */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_shadowVolMat[90 + 6 /* padding */] = { - 0x61, - 0x28, - 0x38, - 0x00, - 0x00, - 0x61, - 0xC0, - 0x08, - 0xFF, - 0xFC, - 0x61, - 0xC1, - 0x08, - 0xFF, - 0x90, - 0x61, - 0x43, - 0x00, - 0x00, - 0x41, - 0x61, - 0x40, - 0x00, - 0x00, - 0x0D, - 0x61, - 0x41, - 0x00, - 0x01, - 0x35, - 0x61, - 0xF3, - 0x7F, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x01, - 0x61, - 0x00, - 0x00, - 0x80, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_shadowVolMat[] ALIGN_DECL(32) = { + 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFC, 0x61, 0xC1, 0x08, 0xFF, 0x90, + 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x0D, 0x61, 0x41, 0x00, 0x01, 0x35, + 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A89A0-803A8A00 005AC0 0055+0B 0/1 0/0 0/0 .data l_clearMat */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_clearMat[85 + 11 /* padding */] = { - 0x61, - 0x28, - 0x38, - 0x00, - 0x00, - 0x61, - 0xC0, - 0x08, - 0xFF, - 0xFF, - 0x61, - 0xC1, - 0x08, - 0xFF, - 0xA0, - 0x61, - 0x40, - 0x00, - 0x00, - 0x06, - 0x61, - 0x41, - 0x00, - 0x00, - 0x14, - 0x61, - 0xF3, - 0x7F, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x01, - 0x61, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_clearMat[] ALIGN_DECL(32) = { + 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1, 0x08, 0xFF, 0xA0, + 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x00, 0x14, 0x61, 0xF3, 0x7F, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, + 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A8A00-803A8A60 005B20 0055+0B 0/1 0/0 0/0 .data l_frontMat */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_frontMat[85 + 11 /* padding */] = { - 0x61, - 0x28, - 0x38, - 0x00, - 0x00, - 0x61, - 0xC0, - 0x08, - 0xFF, - 0xFF, - 0x61, - 0xC1, - 0x08, - 0xFF, - 0x90, - 0x61, - 0x43, - 0x00, - 0x00, - 0x41, - 0x61, - 0x40, - 0x00, - 0x00, - 0x07, - 0x61, - 0x41, - 0x00, - 0x01, - 0x15, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x01, - 0x61, - 0x00, - 0x00, - 0x40, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_frontMat[] ALIGN_DECL(32) = { + 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1, 0x08, 0xFF, 0x90, + 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x07, 0x61, 0x41, 0x00, 0x01, 0x15, + 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, + 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A8A60-803A8A9C 005B80 003C+00 0/1 0/0 0/0 .data l_backSubMat */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_backSubMat[60] = { +SECTION_DATA static u8 l_backSubMat[] ALIGN_DECL(32) = { 0x61, 0x41, 0x00, 0x09, 0x35, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1129,804 +440,105 @@ SECTION_DATA static u8 l_backSubMat[60] = { /* 803A8A9C-803A8B60 005BBC 00A8+1C 0/1 0/0 0/0 .data l_simpleShadowPos */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_simpleShadowPos[168 + 28 /* padding */] = { - 0x00, - 0x00, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0xBF, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - 0x3F, - 0x80, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static Vec l_simpleShadowPos[] = { + {0.0f, -1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {1.0f, -1.0f, -1.0f}, {1.0f, 0.0f, -1.0f}, + {-1.0f, -1.0f, -1.0f}, {-1.0f, 0.0f, -1.0f}, {-1.0f, -1.0f, 1.0f}, {-1.0f, 0.0f, 1.0f}, + {1.0f, -1.0f, 1.0f}, {1.0f, 0.0f, 1.0f}, {-1.0f, 1.0f, -1.0f}, {1.0f, 1.0f, -1.0f}, + {1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, 1.0f}, }; #pragma pop /* 803A8B60-803A8BC0 005C80 0058+08 0/1 0/0 0/0 .data l_shadowVolumeDL */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_shadowVolumeDL[88 + 8 /* padding */] = { - 0x98, - 0x00, - 0x05, - 0x03, - 0x09, - 0x01, - 0x07, - 0x05, - 0x98, - 0x00, - 0x05, - 0x04, - 0x06, - 0x00, - 0x08, - 0x02, - 0x98, - 0x00, - 0x04, - 0x04, - 0x05, - 0x06, - 0x07, - 0x98, - 0x00, - 0x04, - 0x02, - 0x03, - 0x04, - 0x05, - 0x98, - 0x00, - 0x04, - 0x08, - 0x09, - 0x02, - 0x03, - 0x98, - 0x00, - 0x04, - 0x06, - 0x07, - 0x08, - 0x09, - 0x98, - 0x00, - 0x03, - 0x01, - 0x05, - 0x03, - 0x98, - 0x00, - 0x03, - 0x00, - 0x02, - 0x04, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_shadowVolumeDL[] ALIGN_DECL(32) = { + 0x98, 0x00, 0x05, 0x03, 0x09, 0x01, 0x07, 0x05, 0x98, 0x00, 0x05, 0x04, 0x06, 0x00, 0x08, + 0x02, 0x98, 0x00, 0x04, 0x04, 0x05, 0x06, 0x07, 0x98, 0x00, 0x04, 0x02, 0x03, 0x04, 0x05, + 0x98, 0x00, 0x04, 0x08, 0x09, 0x02, 0x03, 0x98, 0x00, 0x04, 0x06, 0x07, 0x08, 0x09, 0x98, + 0x00, 0x03, 0x01, 0x05, 0x03, 0x98, 0x00, 0x03, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A8BC0-803A8C20 005CE0 0055+0B 0/1 0/0 0/0 .data l_shadowSealTexDL */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_shadowSealTexDL[85 + 11 /* padding */] = { - 0x61, - 0x28, - 0x38, - 0x03, - 0xC0, - 0x61, - 0x40, - 0x00, - 0x00, - 0x06, - 0x61, - 0x41, - 0x00, - 0x06, - 0x15, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x01, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x00, - 0x61, - 0x00, - 0x00, - 0x40, - 0x01, - 0x80, - 0x00, - 0x04, - 0x0A, - 0x00, - 0x00, - 0x0B, - 0x01, - 0x00, - 0x0C, - 0x01, - 0x01, - 0x0D, - 0x00, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_shadowSealTexDL[] ALIGN_DECL(32) = { + 0x61, 0x28, 0x38, 0x03, 0xC0, 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x06, 0x15, + 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, + 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x04, 0x0A, 0x00, 0x00, 0x0B, + 0x01, 0x00, 0x0C, 0x01, 0x01, 0x0D, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A8C20-803A8C80 005D40 0055+0B 0/1 0/0 0/0 .data l_shadowSealTex2DL */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_shadowSealTex2DL[85 + 11 /* padding */] = { - 0x61, - 0x28, - 0x38, - 0x03, - 0xC0, - 0x61, - 0x40, - 0x00, - 0x00, - 0x06, - 0x61, - 0x41, - 0x00, - 0x06, - 0x15, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x01, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x00, - 0x61, - 0x00, - 0x00, - 0x40, - 0x01, - 0x80, - 0x00, - 0x04, - 0x0A, - 0x00, - 0x00, - 0x0B, - 0x02, - 0x00, - 0x0C, - 0x02, - 0x01, - 0x0D, - 0x00, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_shadowSealTex2DL[] ALIGN_DECL(32) = { + 0x61, 0x28, 0x38, 0x03, 0xC0, 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x06, 0x15, + 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, + 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x04, 0x0A, 0x00, 0x00, 0x0B, + 0x02, 0x00, 0x0C, 0x02, 0x01, 0x0D, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A8C80-803A8D00 005DA0 0069+17 0/1 0/0 0/0 .data l_shadowSealDL */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_shadowSealDL[105 + 23 /* padding */] = { - 0x10, - 0x00, - 0x00, - 0x10, - 0x0E, - 0x00, - 0x00, - 0x05, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x10, - 0x00, - 0x00, - 0x05, - 0x00, - 0x61, - 0x28, - 0x38, - 0x00, - 0x00, - 0x61, - 0xC0, - 0x08, - 0xFF, - 0xFF, - 0x61, - 0xC1, - 0x08, - 0xFF, - 0xB0, - 0x61, - 0x40, - 0x00, - 0x00, - 0x06, - 0x61, - 0x41, - 0x00, - 0x06, - 0xED, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x01, - 0x61, - 0x00, - 0x00, - 0x40, - 0x10, - 0x80, - 0x00, - 0x04, - 0x0A, - 0x0B, - 0x0C, - 0x0D, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, +SECTION_DATA static u8 l_shadowSealDL[] ALIGN_DECL(32) = { + 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, + 0x00, 0x05, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1, + 0x08, 0xFF, 0xB0, 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x06, 0xED, 0x10, 0x00, + 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, + 0x01, 0x61, 0x00, 0x00, 0x40, 0x10, 0x80, 0x00, 0x04, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop /* 803A8D00-803A8D7C 005E20 007B+01 1/1 0/0 0/0 .data l_matDL$5404 */ -SECTION_DATA static u8 l_matDL[123 + 1 /* padding */] = { - 0x10, - 0x00, - 0x00, - 0x10, - 0x0E, - 0x00, - 0x00, - 0x04, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x10, - 0x00, - 0x00, - 0x04, - 0x00, - 0x61, - 0x28, - 0x38, - 0x00, - 0x00, - 0x61, - 0xC0, - 0x08, - 0xFF, - 0xF2, - 0x61, - 0xC1, - 0x08, - 0xFF, - 0x90, - 0x61, - 0x43, - 0x00, - 0x00, - 0x41, - 0x61, - 0xF3, - 0x7F, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x3F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x00, - 0x10, - 0x09, - 0x00, - 0x00, - 0x00, - 0x01, - 0x61, - 0x00, - 0x00, - 0x40, - 0x10, - 0x61, - 0xEE, - 0x00, - 0x00, - 0x00, - 0x61, - 0xEF, - 0x00, - 0x00, - 0x00, - 0x61, - 0xF0, - 0x00, - 0x00, - 0x00, - 0x61, - 0xF1, - 0x00, - 0x00, - 0x00, - 0x61, - 0xF2, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, +SECTION_DATA static u8 l_matDL[] ALIGN_DECL(32) = { + 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, + 0x04, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xF2, 0x61, 0xC1, 0x08, 0xFF, + 0x90, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, + 0x40, 0x10, 0x61, 0xEE, 0x00, 0x00, 0x00, 0x61, 0xEF, 0x00, 0x00, 0x00, 0x61, 0xF0, 0x00, 0x00, + 0x00, 0x61, 0xF1, 0x00, 0x00, 0x00, 0x61, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* 803A8D7C-803A8D8C 005E9C 0010+00 1/1 0/0 0/0 .data l_imageDrawColor$5405 */ -SECTION_DATA static GXColor l_imageDrawColor[4] = {{0xFF, 0x00, 0x00, 0x00}, - {0x00, 0xFF, 0x00, 0x00}, - {0x00, 0x00, 0xFF, 0x00}, - {0x00, 0x00, 0x00, 0xFF}}; +SECTION_DATA static GXColor l_imageDrawColor[4] = { + {255, 0, 0, 0}, + {0, 255, 0, 0}, + {0, 0, 255, 0}, + {0, 0, 0, 255}, +}; /* 803A8D8C-803A8D9C 005EAC 0010+00 0/1 0/0 0/0 .data l_tevColorChan$5438 */ #pragma push #pragma force_active on -SECTION_DATA static GXTevColor l_tevColorChan[4] = {GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, - GX_CH_ALPHA}; +SECTION_DATA static GXTevColor l_tevColorChan[4] = { + GX_CH_RED, + GX_CH_GREEN, + GX_CH_BLUE, + GX_CH_ALPHA, +}; #pragma pop /* 803A8D9C-803A8DCC 005EBC 0030+00 0/0 0/0 0/0 .data mtx_adj$5842 */ #pragma push #pragma force_active on -SECTION_DATA static u8 mtx_adj[48] = { - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +SECTION_DATA static Mtx mtx_adj = { + {0.5f, 0.0f, 0.0f, 0.5f}, + {0.0f, -0.5f, 0.0f, 0.5f}, + {0.0f, 0.0f, 1.0f, 0.0f}, }; #pragma pop @@ -2759,52 +1371,20 @@ dDlst_shadowSimple_c::dDlst_shadowSimple_c() { /* ############################################################################################## */ /* 8037A178-8037A1A4 0067D8 002A+02 1/1 0/0 0/0 .rodata l_drawlistSize$5656 */ SECTION_RODATA static u16 const l_drawlistSize[21] = { - 0x0001, - 0x0001, - 0x0001, - 0x0080, - 0x0001, - 0x0001, - 0x0001, - 0x0080, - 0x0100, - 0x0001, - 0x0100, - 0x0001, - 0x0020, - 0x0010, - 0x0010, - 0x0020, - 0x0020, - 0x0100, - 0x0001, - 0x0004, - 0x0004, + 0x0001, 0x0001, 0x0001, 0x0080, 0x0001, 0x0001, 0x0001, 0x0080, 0x0100, 0x0001, 0x0100, + 0x0001, 0x0020, 0x0010, 0x0010, 0x0020, 0x0020, 0x0100, 0x0001, 0x0004, 0x0004, }; COMPILER_STRIP_GATE(0x8037A178, &l_drawlistSize); /* 8037A1A4-8037A1B0 006804 0009+03 1/1 0/0 0/0 .rodata l_nonSortId$5662 */ SECTION_RODATA static u8 const l_nonSortId[9] = { - 0x00, - 0x01, - 0x02, - 0x04, - 0x05, - 0x06, - 0x09, - 0x12, - 0x0D, + 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x09, 0x12, 0x0D, }; COMPILER_STRIP_GATE(0x8037A1A4, &l_nonSortId); /* 804520C4-804520CC 0006C4 0006+02 1/1 0/0 0/0 .sdata2 l_zSortId$5668 */ SECTION_SDATA2 static u8 l_zSortId[6] = { - 0x08, - 0x0A, - 0x0C, - 0x0E, - 0x10, - 0x11, + 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x11, }; /* 80056390-8005648C 050CD0 00FC+00 0/0 1/1 0/0 .text init__12dDlst_list_cFv */ @@ -2812,7 +1392,7 @@ SECTION_SDATA2 static u8 l_zSortId[6] = { void dDlst_list_c::init() { J3DDrawBuffer** buffer = mDrawBuffers; const u16* size = l_drawlistSize; - + for (int i = 0; i < 21; i++) { u32 bufSize = *size; size++; @@ -2959,7 +1539,7 @@ u8 dDlst_list_c::mWipe; f32 dDlst_list_c::mWipeRate; /* 80450ED8-80450EE0 0003D8 0004+04 2/2 0/0 0/0 .sbss mWipeSpeed__12dDlst_list_c */ -f32 dDlst_list_c::mWipeSpeed[1 + 1 /* padding */]; +f32 dDlst_list_c::mWipeSpeed; /* 804520D0-804520D4 0006D0 0004+00 1/1 0/0 0/0 .sdata2 @5809 */ SECTION_SDATA2 static f32 lit_5809 = 608.0f; @@ -2972,24 +1552,35 @@ SECTION_SDATA2 static f32 lit_5811 = 2.436000108718872f; /* 8005681C-800568D8 05115C 00BC+00 1/1 0/0 0/0 .text wipeIn__12dDlst_list_cFfR8_GXColor */ +// matches with literals +#ifdef NONMATCHING +void dDlst_list_c::wipeIn(f32 i_wipeSpeed, GXColor& i_wipeColor) { + mWipe = true; + mWipeSpeed = i_wipeSpeed; + mWipeColor = i_wipeColor; + mWipeRate = i_wipeSpeed >= 0.0f ? 0.0f : 1.0f; + + JKRArchive* main2d = dComIfGp_getMain2DArchive(); + ResTIMG* texture = (ResTIMG*)JKRArchive::getGlbResource('TIMG', "wipe_00.bti", main2d); + + mWipeDlst.init(texture, mDoGph_gInf_c::getMinX(), mDoGph_gInf_c::getMinY(), + mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0, 1, 1, 2.0f, 2.436f); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dDlst_list_c::wipeIn(f32 param_0, _GXColor& param_1) { +asm void dDlst_list_c::wipeIn(f32 i_wipeSpeed, GXColor& i_wipeColor) { nofralloc #include "asm/d/d_drawlist/wipeIn__12dDlst_list_cFfR8_GXColor.s" } #pragma pop +#endif /* 800568D8-80056900 051218 0028+00 0/0 1/1 0/0 .text wipeIn__12dDlst_list_cFf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dDlst_list_c::wipeIn(f32 param_0) { - nofralloc -#include "asm/d/d_drawlist/wipeIn__12dDlst_list_cFf.s" +void dDlst_list_c::wipeIn(f32 i_wipeSpeed) { + wipeIn(-i_wipeSpeed, g_blackColor); } -#pragma pop /* ############################################################################################## */ /* 804520DC-804520E0 0006DC 0004+00 1/1 0/0 0/0 .sdata2 @5838 */ @@ -3060,6 +1651,6 @@ SECTION_DATA extern void* __vt__13dDlst_2DTri_c[3] = { /* 80450EE0-80450EE8 0003E0 0008+00 0/0 1/1 0/0 .sbss None */ extern u8 data_80450EE0[8]; -u8 data_80450EE0[8]; +u8 data_80450EE0[8] ALIGN_DECL(8); /* 8037A1B0-8037A1B0 006810 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/d/d_gameover.cpp b/src/d/d_gameover.cpp index 6385a1aa39b..db84dfce6f1 100644 --- a/src/d/d_gameover.cpp +++ b/src/d/d_gameover.cpp @@ -4,128 +4,23 @@ // #include "d/d_gameover.h" +#include "d/com/d_com_inf_game.h" +#include "d/d_procname.h" +#include "d/menu/d_menu_save.h" +#include "d/meter/d_meter_HIO.h" #include "dol2asm.h" -#include "dolphin/types.h" +#include "f_op/f_op_msg_mng.h" // // Types: // -struct request_of_phase_process_class {}; - -struct mDoRst { - static u8 mResetData[4 + 4 /* padding */]; -}; - -struct mDoGph_gInf_c { - static u8 mFadeColor[4]; - static u8 mFader[4]; - static u8 mFrameBufferTimg[4]; - static u8 mFrameBufferTex[4]; - static u8 mZbufferTex[4]; - static f32 mFadeRate; -}; - -struct dSv_player_item_c { - /* 80032FB8 */ void setItem(int, u8); - /* 80033030 */ void getItem(int, bool) const; -}; - -struct dSv_player_get_item_c { - /* 80033EC8 */ void isFirstBit(u8) const; -}; - -struct dSv_event_flag_c { - static u8 saveBitLabels[1644 + 4 /* padding */]; -}; - -struct dSv_event_c { - /* 800349A4 */ void offEventBit(u16); - /* 800349BC */ void isEventBit(u16) const; -}; - -struct dRes_info_c {}; - -struct dRes_control_c { - /* 8003C1E4 */ void getResInfo(char const*, dRes_info_c*, int); -}; - -struct JUtility { - struct TColor {}; -}; - struct dMsgScrnLight_c { /* 80245934 */ dMsgScrnLight_c(u8, u8); /* 80245F90 */ void draw(f32*, f32, f32, f32, f32, f32, f32, JUtility::TColor, JUtility::TColor); -}; -struct JMSMesgEntry_c {}; - -struct dMeter2Info_c { - /* 8021C250 */ void getString(u32, char*, JMSMesgEntry_c*); - /* 8021E0C4 */ void resetMiniGameItem(bool); -}; - -struct dMenu_save_c { - /* 8019C314 */ ~dMenu_save_c(); - /* 801EF6A0 */ dMenu_save_c(); - /* 801EF7AC */ void _create(); - /* 801F09AC */ void _open(); - /* 801F0B28 */ void _delete(); - /* 801F1048 */ void _move(); - /* 801F69FC */ void _draw2(); -}; - -class dGov_HIO_c { -public: - /* 8019AFE0 */ dGov_HIO_c(); - /* 8019C06C */ virtual ~dGov_HIO_c(); - - /* 0x04 */ s8 field_0x4; - /* 0x08 */ f32 mScale; - /* 0x0C */ f32 mAlpha; - /* 0x10 */ f32 mAnimSpeed; - /* 0x14 */ GXColor mBlack; - /* 0x18 */ GXColor mWhite; -}; // Size: 0x1C - -struct dDlst_base_c {}; - -struct dDlst_list_c { - /* 80056794 */ void set(dDlst_base_c**&, dDlst_base_c**&, dDlst_base_c*); -}; - -struct dDlst_Gameover_CAPTURE_c { - /* 8019ACF8 */ void draw(); - /* 8019C2CC */ ~dDlst_Gameover_CAPTURE_c(); -}; - -struct dDlst_GameOverScrnDraw_c { - /* 8019B940 */ dDlst_GameOverScrnDraw_c(JKRArchive*); - /* 8019BBFC */ ~dDlst_GameOverScrnDraw_c(); - /* 8019BCB0 */ void setBackAlpha(f32); - /* 8019BCF4 */ void draw(); -}; - -struct JFWDisplay { - static u8 sManager[4]; -}; - -struct J2DTextBox { - /* 80300660 */ void setString(char const*, ...); -}; - -struct J2DGrafContext {}; - -struct J2DScreen { - /* 802F8498 */ J2DScreen(); - /* 802F8648 */ void setPriority(char const*, u32, JKRArchive*); - /* 802F8ED4 */ void draw(f32, f32, J2DGrafContext const*); -}; - -struct J2DPicture { - /* 802FC800 */ J2DPicture(u64, JGeometry::TBox2 const&, ResTIMG const*, ResTLUT const*); + /* 0x00 */ u8 field_0x0[0x24]; }; // @@ -221,26 +116,19 @@ extern "C" void _savegpr_29(); extern "C" void _restgpr_24(); extern "C" void _restgpr_28(); extern "C" void _restgpr_29(); -extern "C" void strcmp(); -extern "C" extern u8 g_mDoMtx_identity[48 + 24 /* padding */]; extern "C" extern void* g_fopMsg_Method[5 + 1 /* padding */]; extern "C" extern void* __vt__12dDlst_base_c[3]; extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */]; extern "C" extern void* __vt__14mDoHIO_entry_c[3]; extern "C" extern void* __vt__16dDlst_MenuSave_c[4]; extern "C" extern void* __vt__23dDlst_MenuSaveExplain_c[4 + 18 /* padding */]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" extern u8 g_meter2_info[248]; extern "C" u8 mFadeColor__13mDoGph_gInf_c[4]; -extern "C" extern u8 g_clearColor[4]; -extern "C" extern u32 g_blackColor; extern "C" u8 mFader__13mDoGph_gInf_c[4]; extern "C" u8 mFrameBufferTimg__13mDoGph_gInf_c[4]; extern "C" u8 mFrameBufferTex__13mDoGph_gInf_c[4]; extern "C" u8 mZbufferTex__13mDoGph_gInf_c[4]; extern "C" f32 mFadeRate__13mDoGph_gInf_c; extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */]; -extern "C" extern u8 g_menuHIO[8]; extern "C" u8 sManager__10JFWDisplay[4]; // @@ -264,6 +152,65 @@ SECTION_SDATA2 static f32 lit_3870 = 10.0f; /* 8019ACF8-8019AFE0 195638 02E8+00 1/0 0/0 0/0 .text draw__24dDlst_Gameover_CAPTURE_cFv */ +// matches with literals +#ifdef NONMATCHING +void dDlst_Gameover_CAPTURE_c::draw() { + GXTexObj tex_obj; + Mtx44 m; + + GXSetTexCopySrc(0, 0, 608, 448); + GXSetTexCopyDst(304, 224, GX_TF_RGB565, 1); + GXCopyTex(mDoGph_gInf_c::mZbufferTex, 0); + GXPixModeSync(); + GXInitTexObj(&tex_obj, mDoGph_gInf_c::mFrameBufferTex, 304, 224, + (GXTexFmt)mDoGph_gInf_c::mFrameBufferTimg->format, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXInitTexObjLOD(&tex_obj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, + GX_ANISO_1); + GXLoadTexObj(&tex_obj, GX_TEXMAP0); + GXSetNumChans(0); + GXSetNumTexGens(1); + GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60, GX_FALSE, 125); + GXSetNumTevStages(1); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetZCompLoc(1); + GXSetZMode(GX_FALSE, GX_ALWAYS, GX_FALSE); + GXSetBlendMode(GX_BM_NONE, GX_BL_ZERO, GX_BL_ZERO, GX_LO_OR); + GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0); + GXSetFog(GX_FOG_NONE, 0.0f, 0.0f, 0.0f, 0.0f, g_clearColor); + GXSetFogRangeAdj(GX_FALSE, 0, NULL); + GXSetCullMode(GX_CULL_NONE); + GXSetDither(1); + C_MTXOrtho(m, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f); + GXSetProjection(m, GX_ORTHOGRAPHIC); + GXLoadPosMtxImm(g_mDoMtx_identity, GX_PNMTX0); + GXSetCurrentMtx(0); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_DIRECT); + GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGB8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGB8, 0); + + GXBegin(GX_QUADS, GX_VTXFMT0, 4); + + GXPosition3s8(0, 0, -5); + GXTexCoord2s8(0, 0); + + GXPosition3s8(1, 0, -5); + GXTexCoord2s8(1, 0); + + GXPosition3s8(1, 1, -5); + GXTexCoord2s8(1, 1); + + GXPosition3s8(0, 1, -5); + GXTexCoord2s8(0, 1); + + i_GXEnd(); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -272,6 +219,7 @@ asm void dDlst_Gameover_CAPTURE_c::draw() { #include "asm/d/d_gameover/draw__24dDlst_Gameover_CAPTURE_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 803BBB50-803BBB5C 018C70 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ @@ -380,6 +328,13 @@ SECTION_DATA static u8 init_process[108] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; +/* typedef void (dGameover_c::*initFunc)(); +SECTION_DATA initFunc init_process[] = { + &dGameover_c::playerAnmWait_init, &dGameover_c::dispFadeOut_init, &dGameover_c::dispWait_init, + &dGameover_c::demoFadeIn_init, &dGameover_c::demoFadeOut_init, &dGameover_c::saveOpen_init, + &dGameover_c::saveMove_init, &dGameover_c::saveClose_init, &dGameover_c::deleteWait_init, +}; */ + /* 803BBC34-803BBC40 -00001 000C+00 0/1 0/0 0/0 .data @3892 */ #pragma push #pragma force_active on @@ -481,10 +436,16 @@ SECTION_DATA static u8 move_process[108] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; +/* typedef void (dGameover_c::*moveFunc)(); +SECTION_DATA moveFunc move_process[] = { + &dGameover_c::playerAnmWait_proc, &dGameover_c::dispFadeOut_proc, &dGameover_c::dispWait_proc, + &dGameover_c::demoFadeIn_proc, &dGameover_c::demoFadeOut_proc, &dGameover_c::saveOpen_proc, + &dGameover_c::saveMove_proc, &dGameover_c::saveClose_proc, &dGameover_c::deleteWait_proc, +}; */ + /* 803BBD0C-803BBD2C 018E2C 0020+00 1/1 0/0 0/0 .data offset$4331 */ -SECTION_DATA static u8 offset[32] = { - 0xC3, 0x0A, 0x00, 0x00, 0xC2, 0xC0, 0x00, 0x00, 0xC2, 0x60, 0x00, 0x00, 0xC1, 0x90, 0x00, 0x00, - 0x42, 0x28, 0x00, 0x00, 0x42, 0x96, 0x00, 0x00, 0x42, 0xDC, 0x00, 0x00, 0x43, 0x0F, 0x00, 0x00, +SECTION_DATA static f32 offset[8] = { + -138.0f, -96.0f, -56.0f, -18.0f, 42.0f, 75.0f, 110.0f, 143.0f, }; /* 803BBD2C-803BBD40 -00001 0014+00 1/0 0/0 0/0 .data l_dGameover_Method */ @@ -533,21 +494,22 @@ SECTION_DATA extern void* __vt__10dGov_HIO_c[3 + 3 /* padding */] = { NULL, }; -/* 80453B8C-80453B90 00218C 0004+00 1/1 0/0 0/0 .sdata2 @3878 */ -SECTION_SDATA2 static f32 lit_3878 = 27.0f / 10.0f; - -/* 80453B90-80453B94 002190 0004+00 1/1 0/0 0/0 .sdata2 @3879 */ -SECTION_SDATA2 static f32 lit_3879 = 1.0f / 5.0f; - /* 8019AFE0-8019B044 195920 0064+00 1/1 0/0 0/0 .text __ct__10dGov_HIO_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dGov_HIO_c::dGov_HIO_c() { - nofralloc -#include "asm/d/d_gameover/__ct__10dGov_HIO_cFv.s" +dGov_HIO_c::dGov_HIO_c() { + mScale = 2.7f; + mAlpha = lit_3869; + mAnimSpeed = 0.2f; + + mBlack.r = 0; + mBlack.g = 0; + mBlack.b = 0; + mBlack.a = 0; + + mWhite.r = 255; + mWhite.g = 220; + mWhite.b = 125; + mWhite.a = 255; } -#pragma pop /* ############################################################################################## */ /* 80394C28-80394C28 021288 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ @@ -566,207 +528,288 @@ SECTION_DATA extern void* __vt__24dDlst_Gameover_CAPTURE_c[4] = { }; /* 8019B044-8019B2F4 195984 02B0+00 1/1 0/0 0/0 .text _create__11dGameover_cFv */ +#ifdef NONMATCHING +int dGameover_c::_create() { + int phase = dComIfG_resLoad(&mPhase, "Gover"); + + if (dComIfGp_isPauseFlag() || + (dComIfGp_isHeapLockFlag() != 0 && dComIfGp_isHeapLockFlag() != 6) || + dComIfGp_getMesgStatus() != 0) + { + return 0; + } + + if (phase == cPhs_COMPLEATE_e) { + if (dMeter2Info_getGameOverType() == 0) { + mDoGph_gInf_c::setFadeColor(*(JUtility::TColor*)&g_blackColor); + dComIfGs_addDeathCount(); + } + + dRes_info_c* resInfo = dComIfG_getObjectResInfo("Gover"); + + mpHeap = dComIfGp_getExpHeap2D(); + dComIfGp_setHeapLockFlag(6); + JKRHeap* old_heap = mDoExt_setCurrentHeap(mpHeap); + mpHeap->getTotalFreeSize(); + + dgo_screen_c = new dDlst_GameOverScrnDraw_c(resInfo->getArchive()); + dMs_c = new dMenu_save_c(); + + if (dMeter2Info_getGameOverType() == 1) { + if (!strcmp(dComIfGp_getLastPlayStageName(), "D_MN10A")) { + // Last stage was Stallord Arena + // Remove Ooccoo from inventory + dComIfGs_setItem(SLOT_18, NO_ITEM); + dComIfGs_resetLastWarpAcceptStage(); + } + + dMs_c->setUseType(3); + } else if (dMeter2Info_getGameOverType() == 2) { + dMs_c->setUseType(4); + } else { + dMs_c->setUseType(2); + } + + dMs_c->_create(); + dgo_capture_c = new dDlst_Gameover_CAPTURE_c(); + + mDoExt_setCurrentHeap(old_heap); + field_0x116 = g_menuHIO.mGameover; + + if (dMeter2Info_getGameOverType() == 1 || dMeter2Info_getGameOverType() == 2) { + mIsDemoSave = true; + mProc = PROC_DEMO_FADE_IN; + dgo_screen_c->setBackAlpha(1.0f); + } else { + mIsDemoSave = false; + mProc = PROC_PLAYER_ANM_WAIT; + } + + (this->*init_process[mProc])(); + return cPhs_COMPLEATE_e; + } + + return phase; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dGameover_c::_create() { +asm int dGameover_c::_create() { nofralloc #include "asm/d/d_gameover/_create__11dGameover_cFv.s" } #pragma pop +#endif /* 8019B2F4-8019B384 195C34 0090+00 1/1 0/0 0/0 .text _execute__11dGameover_cFv */ +// matches with sinit +#ifdef NONMATCHING +int dGameover_c::_execute() { + JKRHeap* old_heap = mDoExt_setCurrentHeap(mpHeap); + u8 old_proc = mProc; + + (this->*move_process[mProc])(); + if (mProc != old_proc) { + (this->*init_process[mProc])(); + } + + mDoExt_setCurrentHeap(old_heap); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dGameover_c::_execute() { +asm int dGameover_c::_execute() { nofralloc #include "asm/d/d_gameover/_execute__11dGameover_cFv.s" } #pragma pop +#endif /* 8019B384-8019B388 195CC4 0004+00 1/0 0/0 0/0 .text playerAnmWait_init__11dGameover_cFv */ -void dGameover_c::playerAnmWait_init() { - /* empty function */ -} +void dGameover_c::playerAnmWait_init() {} /* 8019B388-8019B3A0 195CC8 0018+00 1/0 0/0 0/0 .text playerAnmWait_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::playerAnmWait_proc() { - nofralloc -#include "asm/d/d_gameover/playerAnmWait_proc__11dGameover_cFv.s" +void dGameover_c::playerAnmWait_proc() { + if (mIsDemoSave) { + mProc = PROC_DISP_FADE_OUT; + } } -#pragma pop /* 8019B3A0-8019B3E8 195CE0 0048+00 1/0 0/0 0/0 .text dispFadeOut_init__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::dispFadeOut_init() { - nofralloc -#include "asm/d/d_gameover/dispFadeOut_init__11dGameover_cFv.s" +void dGameover_c::dispFadeOut_init() { + mTimer = 30; + mDoGph_gInf_c::startFadeOut(15); } -#pragma pop /* 8019B3E8-8019B40C 195D28 0024+00 1/0 0/0 0/0 .text dispFadeOut_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::dispFadeOut_proc() { - nofralloc -#include "asm/d/d_gameover/dispFadeOut_proc__11dGameover_cFv.s" +void dGameover_c::dispFadeOut_proc() { + if (mTimer != 0) { + mTimer--; + } else { + mProc = PROC_DISP_WAIT; + } } -#pragma pop /* 8019B40C-8019B454 195D4C 0048+00 1/0 0/0 0/0 .text dispWait_init__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::dispWait_init() { - nofralloc -#include "asm/d/d_gameover/dispWait_init__11dGameover_cFv.s" +void dGameover_c::dispWait_init() { + mTimer = 90; + mDoGph_gInf_c::startFadeIn(30); } -#pragma pop /* 8019B454-8019B478 195D94 0024+00 1/0 0/0 0/0 .text dispWait_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::dispWait_proc() { - nofralloc -#include "asm/d/d_gameover/dispWait_proc__11dGameover_cFv.s" +void dGameover_c::dispWait_proc() { + if (mTimer != 0) { + mTimer--; + } else { + mProc = PROC_SAVE_OPEN; + } } -#pragma pop /* 8019B478-8019B484 195DB8 000C+00 1/0 0/0 0/0 .text demoFadeIn_init__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::demoFadeIn_init() { - nofralloc -#include "asm/d/d_gameover/demoFadeIn_init__11dGameover_cFv.s" +void dGameover_c::demoFadeIn_init() { + mTimer = 0; } -#pragma pop /* 8019B484-8019B4D8 195DC4 0054+00 1/0 0/0 0/0 .text demoFadeIn_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::demoFadeIn_proc() { - nofralloc -#include "asm/d/d_gameover/demoFadeIn_proc__11dGameover_cFv.s" +void dGameover_c::demoFadeIn_proc() { + mTimer++; + dgo_screen_c->setBackAlpha(lit_3869); + + if (mTimer >= 30) { + mProc = PROC_SAVE_OPEN; + } } -#pragma pop /* 8019B4D8-8019B4E4 195E18 000C+00 1/0 0/0 0/0 .text demoFadeOut_init__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::demoFadeOut_init() { - nofralloc -#include "asm/d/d_gameover/demoFadeOut_init__11dGameover_cFv.s" +void dGameover_c::demoFadeOut_init() { + mTimer = 30; } -#pragma pop - -/* ############################################################################################## */ -/* 80453B94-80453B98 002194 0004+00 1/1 0/0 0/0 .sdata2 @4069 */ -SECTION_SDATA2 static f32 lit_4069 = 900.0f; - -/* 80453B98-80453BA0 002198 0008+00 1/1 0/0 0/0 .sdata2 @4071 */ -SECTION_SDATA2 static f64 lit_4071 = 4503601774854144.0 /* cast s32 to float */; /* 8019B4E4-8019B560 195E24 007C+00 1/0 0/0 0/0 .text demoFadeOut_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::demoFadeOut_proc() { - nofralloc -#include "asm/d/d_gameover/demoFadeOut_proc__11dGameover_cFv.s" +void dGameover_c::demoFadeOut_proc() { + mTimer--; + dgo_screen_c->setBackAlpha((mTimer * mTimer) / 900.0f); + + if (mTimer <= 0) { + mProc = PROC_DELETE_WAIT; + } } -#pragma pop /* 8019B560-8019B564 195EA0 0004+00 1/0 0/0 0/0 .text saveOpen_init__11dGameover_cFv */ -void dGameover_c::saveOpen_init() { - /* empty function */ -} +void dGameover_c::saveOpen_init() {} /* 8019B564-8019B5A4 195EA4 0040+00 1/0 0/0 0/0 .text saveOpen_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::saveOpen_proc() { - nofralloc -#include "asm/d/d_gameover/saveOpen_proc__11dGameover_cFv.s" +void dGameover_c::saveOpen_proc() { + if (dMs_c->_open()) { + mProc = PROC_SAVE_MOVE; + } } -#pragma pop /* 8019B5A4-8019B5A8 195EE4 0004+00 1/0 0/0 0/0 .text saveMove_init__11dGameover_cFv */ -void dGameover_c::saveMove_init() { - /* empty function */ -} +void dGameover_c::saveMove_init() {} /* 8019B5A8-8019B5F0 195EE8 0048+00 1/0 0/0 0/0 .text saveMove_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::saveMove_proc() { - nofralloc -#include "asm/d/d_gameover/saveMove_proc__11dGameover_cFv.s" +void dGameover_c::saveMove_proc() { + dMs_c->_move(); + + if (dMs_c->getSaveStatus() == 3) { + mProc = PROC_SAVE_CLOSE; + } } -#pragma pop /* 8019B5F0-8019B5F4 195F30 0004+00 1/0 0/0 0/0 .text saveClose_init__11dGameover_cFv */ -void dGameover_c::saveClose_init() { - /* empty function */ -} +void dGameover_c::saveClose_init() {} /* 8019B5F4-8019B7BC 195F34 01C8+00 1/0 0/0 0/0 .text saveClose_proc__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::saveClose_proc() { - nofralloc -#include "asm/d/d_gameover/saveClose_proc__11dGameover_cFv.s" +void dGameover_c::saveClose_proc() { + if (dMs_c->getEndStatus() == 0) { + dComIfGp_setGameoverStatus(3); + dComIfGp_offPauseFlag(); + mDoRst::onReset(); + } else if (dMs_c->getEndStatus() == 1) { + if (dMeter2Info_getGameOverType() == 1 || dMeter2Info_getGameOverType() == 2) { + dComIfGp_setGameoverStatus(1); + } else { + dComIfGp_setGameoverStatus(2); + } + + dComIfGp_offPauseFlag(); + + // Reset Monkey lantern steal sequence flags if player hasn't regained lantern + if (!i_dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[226])) { + dComIfGs_offEventBit(dSv_event_flag_c::saveBitLabels[224]); + dComIfGs_offEventBit(dSv_event_flag_c::saveBitLabels[225]); + } + + // Reset Lantern and oil status back into inventory if gameover during monkey steal sequence + if (i_dComIfGs_isItemFirstBit(KANTERA) && dComIfGs_getItem(SLOT_1, true) == NO_ITEM) { + dComIfGs_setItem(SLOT_1, KANTERA); + dComIfGs_setOil(dMeter2Info_getOilGaugeBackUp()); + } + + dMeter2Info_resetMiniGameItem(false); + } + + if (dMeter2Info_getGameOverType() == 1 && dMeter2Info_getGameOverType() == 2 && + dComIfGp_getGameoverStatus() == 1) + { + mProc = PROC_DEMO_FADE_OUT; + } else { + mProc = PROC_DELETE_WAIT; + } } -#pragma pop /* 8019B7BC-8019B7C0 1960FC 0004+00 1/0 0/0 0/0 .text deleteWait_init__11dGameover_cFv */ -void dGameover_c::deleteWait_init() { - /* empty function */ -} +void dGameover_c::deleteWait_init() {} /* 8019B7C0-8019B7C4 196100 0004+00 1/0 0/0 0/0 .text deleteWait_proc__11dGameover_cFv */ -void dGameover_c::deleteWait_proc() { - /* empty function */ -} +void dGameover_c::deleteWait_proc() {} /* 8019B7C4-8019B864 196104 00A0+00 1/1 0/0 0/0 .text _draw__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::_draw() { - nofralloc -#include "asm/d/d_gameover/_draw__11dGameover_cFv.s" +int dGameover_c::_draw() { + if (dgo_capture_c != NULL && dComIfGp_isPauseFlag()) { + dComIfGd_set2DOpa(dgo_capture_c); + } + + if (mIsDemoSave && mProc >= PROC_DISP_WAIT) { + if (dgo_screen_c != NULL) { + dComIfGd_set2DOpa(dgo_screen_c); + } + dMs_c->_draw2(); + } + + return 1; } -#pragma pop /* 8019B864-8019B940 1961A4 00DC+00 1/1 0/0 0/0 .text _delete__11dGameover_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dGameover_c::_delete() { - nofralloc -#include "asm/d/d_gameover/_delete__11dGameover_cFv.s" +int dGameover_c::_delete() { + JKRHeap* old_heap = mDoExt_setCurrentHeap(mpHeap); + + if (dgo_screen_c != NULL) { + delete dgo_screen_c; + dgo_screen_c = NULL; + } + + dMs_c->_delete(); + delete dMs_c; + delete dgo_capture_c; + + mpHeap->freeAll(); + dComIfGp_offHeapLockFlag(0); + mDoExt_setCurrentHeap(old_heap); + + dComIfG_resDelete(&mPhase, "Gover"); + return 1; } -#pragma pop /* ############################################################################################## */ /* 80394C28-80394C28 021288 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ @@ -786,6 +829,46 @@ SECTION_SDATA2 static f32 lit_4291 = 660.0f; /* 8019B940-8019BBFC 196280 02BC+00 1/1 0/0 0/0 .text * __ct__24dDlst_GameOverScrnDraw_cFP10JKRArchive */ +// matches with literals +#ifdef NONMATCHING +dDlst_GameOverScrnDraw_c::dDlst_GameOverScrnDraw_c(JKRArchive* i_archive) { + mpScreen = new J2DScreen(); + mpScreen->setPriority("zelda_game_over.blo", 0x100000, i_archive); + dPaneClass_showNullPane(mpScreen); + + mFadeColor.set(0, 0, 0, 0); + + if (dMeter2Info_getGameOverType() != 0) { + mpScreen->search('n_base')->hide(); + + if (mDoGph_gInf_c::getFadeRate() == 1.0f) { + mFadeColor = mDoGph_gInf_c::getFadeColor(); + } + } + + mpScreen->search('base_b')->hide(); + + JUtility::TColor img_white(mFadeColor); + JUtility::TColor img_black(mFadeColor); + img_white.a = 0; + img_black.a = 255; + + ResTIMG* img = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', "tt_block8x8.bti"); + mpBackImg = + new J2DPicture('PICT01', JGeometry::TBox2(0.0f, 486.0f, 0.0f, 660.0f), img, NULL); + mpBackImg->setBlackWhite(img_white, img_black); + + J2DTextBox* gold_tbox = (J2DTextBox*)mpScreen->search('gold_00'); + gold_tbox->setFont(mDoExt_getSubFont()); + + char string[64]; + dMeter2Info_getString(0x381, string, NULL); + gold_tbox->setString(string); + + mpLight = new dMsgScrnLight_c(6, 0xFF); + field_0x10 = 0.0f; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -794,39 +877,21 @@ asm dDlst_GameOverScrnDraw_c::dDlst_GameOverScrnDraw_c(JKRArchive* param_0) { #include "asm/d/d_gameover/__ct__24dDlst_GameOverScrnDraw_cFP10JKRArchive.s" } #pragma pop +#endif /* 8019BBFC-8019BCB0 19653C 00B4+00 1/0 0/0 0/0 .text __dt__24dDlst_GameOverScrnDraw_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dDlst_GameOverScrnDraw_c::~dDlst_GameOverScrnDraw_c() { - nofralloc -#include "asm/d/d_gameover/__dt__24dDlst_GameOverScrnDraw_cFv.s" +dDlst_GameOverScrnDraw_c::~dDlst_GameOverScrnDraw_c() { + delete mpBackImg; + delete mpScreen; + dComIfGp_getMain2DArchive()->removeResourceAll(); } -#pragma pop - -/* ############################################################################################## */ -/* 80453BA8-80453BAC 0021A8 0004+00 1/1 0/0 0/0 .sdata2 @4316 */ -SECTION_SDATA2 static f32 lit_4316 = 255.0f; /* 8019BCB0-8019BCF4 1965F0 0044+00 3/3 0/0 0/0 .text setBackAlpha__24dDlst_GameOverScrnDraw_cFf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dDlst_GameOverScrnDraw_c::setBackAlpha(f32 param_0) { - nofralloc -#include "asm/d/d_gameover/setBackAlpha__24dDlst_GameOverScrnDraw_cFf.s" +void dDlst_GameOverScrnDraw_c::setBackAlpha(f32 i_alpha) { + mpBackImg->setAlpha(i_alpha * 255.0f); } -#pragma pop - -/* ############################################################################################## */ -/* 8042CA20-8042CA2C 059740 000C+00 1/1 0/0 0/0 .bss @3882 */ -static u8 lit_3882[12]; - -/* 8042CA2C-8042CA48 05974C 001C+00 2/2 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[28]; /* 80453BAC-80453BB0 0021AC 0004+00 1/1 0/0 0/0 .sdata2 @4374 */ SECTION_SDATA2 static f32 lit_4374 = 608.0f; @@ -846,82 +911,119 @@ SECTION_SDATA2 static f32 lit_4377[1 + 1 /* padding */] = { /* 8019BCF4-8019BF3C 196634 0248+00 1/0 0/0 0/0 .text draw__24dDlst_GameOverScrnDraw_cFv */ +// matches with literals / sinit +#ifdef NONMATCHING +/* ############################################################################################## */ +/* 8042CA20-8042CA2C 059740 000C+00 1/1 0/0 0/0 .bss @3882 */ +static u8 lit_3882[12]; + +/* 8042CA2C-8042CA48 05974C 001C+00 2/2 0/0 0/0 .bss l_HIO */ +static dGov_HIO_c l_HIO; + +void dDlst_GameOverScrnDraw_c::draw() { + J2DGrafContext* graf_ctx = dComIfGp_getCurrentGrafPort(); + graf_ctx->setup2D(); + + if (dMeter2Info_getGameOverType() == 1 || dMeter2Info_getGameOverType() == 2) { + if (mDoGph_gInf_c::getFadeRate() == 1.0f) { + mFadeColor = mDoGph_gInf_c::getFadeColor(); + } + + JUtility::TColor img_black(mFadeColor); + JUtility::TColor img_white(mFadeColor); + img_black.a = 0; + img_white.a = 255; + + mpBackImg->setBlackWhite(img_black, img_white); + mpBackImg->draw(0.0f, 0.0f, 608.0f, 448.0f, false, false, false); + } else { + JUtility::TColor img_black; + JUtility::TColor img_white; + + img_black.r = l_HIO.mBlack.r; + img_black.g = l_HIO.mBlack.g; + img_black.b = l_HIO.mBlack.b; + img_black.a = l_HIO.mBlack.a; + + img_white.r = l_HIO.mWhite.r; + img_white.g = l_HIO.mWhite.g; + img_white.b = l_HIO.mWhite.b; + img_white.a = l_HIO.mWhite.a; + + mpBackImg->draw(0.0f, 0.0f, 608.0f, 448.0f, false, false, false); + + for (int i = 0; i < 8; i++) { + mpLight->draw(&field_0x10, offset[i] + 304.0f, 224.0f, l_HIO.mScale, l_HIO.mScale, + l_HIO.mAlpha, l_HIO.mAnimSpeed, img_black, img_white); + } + } + + mpScreen->draw(0.0f, 0.0f, graf_ctx); +} +#else +/* ############################################################################################## */ +/* 8042CA20-8042CA2C 059740 000C+00 1/1 0/0 0/0 .bss @3882 */ +static u8 lit_3882[12]; + +/* 8042CA2C-8042CA48 05974C 001C+00 2/2 0/0 0/0 .bss l_HIO */ +static u8 l_HIO[28]; + #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dDlst_GameOverScrnDraw_c::draw() { +// asm void dDlst_GameOverScrnDraw_c::draw() { +extern "C" asm void draw__24dDlst_GameOverScrnDraw_cFv() { nofralloc #include "asm/d/d_gameover/draw__24dDlst_GameOverScrnDraw_cFv.s" } #pragma pop +#endif /* 8019BF3C-8019BF5C 19687C 0020+00 1/0 0/0 0/0 .text dGameover_Draw__FP11dGameover_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void dGameover_Draw(dGameover_c* param_0) { - nofralloc -#include "asm/d/d_gameover/dGameover_Draw__FP11dGameover_c.s" +static int dGameover_Draw(dGameover_c* i_this) { + return i_this->_draw(); } -#pragma pop /* 8019BF5C-8019BF7C 19689C 0020+00 1/0 0/0 0/0 .text dGameover_Execute__FP11dGameover_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void dGameover_Execute(dGameover_c* param_0) { - nofralloc -#include "asm/d/d_gameover/dGameover_Execute__FP11dGameover_c.s" +static int dGameover_Execute(dGameover_c* i_this) { + return i_this->_execute(); } -#pragma pop /* 8019BF7C-8019BF84 1968BC 0008+00 1/0 0/0 0/0 .text dGameover_IsDelete__FP11dGameover_c */ -static bool dGameover_IsDelete(dGameover_c* param_0) { - return true; +static int dGameover_IsDelete(dGameover_c* i_this) { + return 1; } /* 8019BF84-8019BFA4 1968C4 0020+00 1/0 0/0 0/0 .text dGameover_Delete__FP11dGameover_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void dGameover_Delete(dGameover_c* param_0) { - nofralloc -#include "asm/d/d_gameover/dGameover_Delete__FP11dGameover_c.s" +static int dGameover_Delete(dGameover_c* i_this) { + return i_this->_delete(); } -#pragma pop /* 8019BFA4-8019BFC4 1968E4 0020+00 1/0 0/0 0/0 .text dGameover_Create__FP9msg_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void dGameover_Create(msg_class* param_0) { - nofralloc -#include "asm/d/d_gameover/dGameover_Create__FP9msg_class.s" +static int dGameover_Create(msg_class* i_this) { + return static_cast(i_this)->_create(); } -#pragma pop /* 8019BFC4-8019C008 196904 0044+00 0/0 2/2 0/0 .text d_GameOver_Create__FUc */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm s32 d_GameOver_Create(u8 param_0) { - nofralloc -#include "asm/d/d_gameover/d_GameOver_Create__FUc.s" +s32 d_GameOver_Create(u8 i_gameoverType) { + dMeter2Info_setGameOverType(i_gameoverType); + return fopMsgM_create(PROC_GAMEOVER, NULL, NULL, NULL, NULL, NULL); } -#pragma pop /* 8019C008-8019C06C 196948 0064+00 0/0 1/1 0/0 .text d_GameOver_Delete__FRUi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void d_GameOver_Delete(unsigned int& param_0) { - nofralloc -#include "asm/d/d_gameover/d_GameOver_Delete__FRUi.s" +bool d_GameOver_Delete(unsigned int& i_id) { + if (i_id != UINT32_MAX) { + fopMsgM_Delete(fopMsgM_SearchByID(i_id)); + i_id = -1; + dMeter2Info_setGameOverType(0); + return true; + } + + return false; } -#pragma pop /* 8019C06C-8019C0C8 1969AC 005C+00 2/1 0/0 0/0 .text __dt__10dGov_HIO_cFv */ #pragma push @@ -938,8 +1040,7 @@ extern "C" asm void __dt__10dGov_HIO_cFv() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void __sinit_d_gameover_cpp() { - nofralloc +asm void __sinit_d_gameover_cpp(){nofralloc #include "asm/d/d_gameover/__sinit_d_gameover_cpp.s" } #pragma pop @@ -964,7 +1065,8 @@ asm dDlst_Gameover_CAPTURE_c::~dDlst_Gameover_CAPTURE_c() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm dMenu_save_c::~dMenu_save_c() { +// asm dMenu_save_c::~dMenu_save_c() { +extern "C" asm void __dt__12dMenu_save_cFv() { nofralloc #include "asm/d/d_gameover/__dt__12dMenu_save_cFv.s" } diff --git a/src/d/d_timer.cpp b/src/d/d_timer.cpp index a887623e67a..7edfb5108bc 100644 --- a/src/d/d_timer.cpp +++ b/src/d/d_timer.cpp @@ -5,9 +5,9 @@ #include "d/d_timer.h" #include "d/com/d_com_inf_game.h" -#include "f_op/f_op_msg_mng.h" +#include "d/d_procname.h" #include "dol2asm.h" -#include "dolphin/types.h" +#include "f_op/f_op_msg_mng.h" #include "m_Do/m_Do_lib.h" // @@ -195,18 +195,12 @@ asm void dTimer_c::_execute() { /* 8025D33C-8025D3BC 257C7C 0080+00 1/1 0/0 0/0 .text _draw__8dTimer_cFv */ int dTimer_c::_draw() { - int ret; - if (dComIfGp_isPauseFlag() || dMsgObject_isTalkNowCheck()) { - ret = 1; - } else { - dComIfGd_set2DOpa((dDlst_base_c*)field_0xfc); - ret = 1; + return 1; } - - return ret; - + dComIfGd_set2DOpa(mp_tm_scrn); + return 1; } /* 8025D3BC-8025D524 257CFC 0168+00 1/1 0/0 0/0 .text _delete__8dTimer_cFv */ @@ -252,7 +246,7 @@ bool dTimer_c::stock_start() { OSTime current_time = dLib_time_c::getTime(); mTime1 = current_time; mTime2 = current_time; - + mTime1 -= OS_TIMER_CLOCK_MS * dComIfG_getTimerNowTimeMs(); } return mDeleteCheck == 5; @@ -275,61 +269,54 @@ int dTimer_c::stock_start(s16 param_0) { mDeleteCheck = 5; return 1; } + return 0; } /* 8025D7E8-8025D86C 258128 0084+00 3/3 1/1 0/0 .text stop__8dTimer_cFUc */ int dTimer_c::stop(u8 param_0) { - int ret; - if (field_0x16A == 1 || field_0x16B != 0) { - ret = 0; + return 0; } else if (mDeleteCheck != 4) { - ret = 0; + return 0; } else { mTime3 = dLib_time_c::getTime(); field_0x16A = 1; field_0x16B = param_0; - ret = 1; + return 1; } - - return ret; } /* 8025D86C-8025D920 2581AC 00B4+00 1/1 1/1 0/0 .text restart__8dTimer_cFUc */ int dTimer_c::restart(u8 param_0) { if (field_0x16A != 1 || field_0x16B != param_0) { return 0; + } else if (mDeleteCheck != 4 && mDeleteCheck != 2) { + return 0; } else { - if (mDeleteCheck != 4 && mDeleteCheck != 2) { - return 0; - } else { - mTime2 = dLib_time_c::getTime(); - mTime5 += mTime2 - mTime3; - field_0x16A = 0; - field_0x16B = 0; - return 1; - } + mTime2 = dLib_time_c::getTime(); + mTime5 += mTime2 - mTime3; + field_0x16A = 0; + field_0x16B = 0; + return 1; } } /* 8025D920-8025D9E0 258260 00C0+00 0/0 1/1 0/0 .text end__8dTimer_cFi */ int dTimer_c::end(int param_0) { - int ret; if (mDeleteCheck != 4) { - ret = 0; - - } else { - mTime6 = dLib_time_c::getTime(); - mDeleteCheck = 6; - dComIfG_setTimerNowTimeMs((mTime6 - mTime1 - mTime5) / OS_TIMER_CLOCK_MS); - if (param_0 != -1) { - field_0x158 = param_0; - } - ret = 1; + return 0; } - return ret; + mTime6 = dLib_time_c::getTime(); + mDeleteCheck = 6; + dComIfG_setTimerNowTimeMs((mTime6 - mTime1 - mTime5) / OS_TIMER_CLOCK_MS); + + if (param_0 != -1) { + field_0x158 = param_0; + } + + return 1; } /* 8025D9E0-8025D9F0 258320 0010+00 0/0 1/1 0/0 .text deleteRequest__8dTimer_cFv */ @@ -353,8 +340,8 @@ int dTimer_c::getLimitTimeMs() { int dTimer_c::getRestTimeMs() { OSTime tmpTime2 = mTime2 - mTime1 - mTime5; // OSTime tmpTime = (mTime5) - mLimitTime; - - return (tmpTime2 - mLimitTime) / OS_TIMER_CLOCK_MS; + + return (tmpTime2 - mLimitTime) / OS_TIMER_CLOCK_MS; } #else #pragma push @@ -372,6 +359,7 @@ int dTimer_c::isStart() { if (field_0x16A != 1 && mDeleteCheck == 4) { return 1; } + return 0; } /* ############################################################################################## */ @@ -422,10 +410,10 @@ dDlst_TimerScrnDraw_c::dDlst_TimerScrnDraw_c() { field_0x3D0 = -1; field_0x3D4 = 0; - field_0x3B0 = 0; // fix - field_0x3B4 = 0; // fix - field_0x3B8 = 0; // fix - field_0x3BC = 0; // fix + field_0x3B0 = 0; // fix + field_0x3B4 = 0; // fix + field_0x3B8 = 0; // fix + field_0x3BC = 0; // fix field_0x3DE = 0; field_0x3DF = 0; @@ -790,43 +778,39 @@ asm void dDlst_TimerScrnDraw_c::drawPikari(int param_0) { #pragma pop /* 80260F04-80260F24 25B844 0020+00 1/0 0/0 0/0 .text dTimer_Draw__FP8dTimer_c */ -static void dTimer_Draw(dTimer_c* i_timer) { - i_timer->_draw(); +static void dTimer_Draw(dTimer_c* i_this) { + i_this->_draw(); } /* 80260F24-80260F44 25B864 0020+00 1/0 0/0 0/0 .text dTimer_Execute__FP8dTimer_c */ -static void dTimer_Execute(dTimer_c* i_timer) { - i_timer->_execute(); +static void dTimer_Execute(dTimer_c* i_this) { + i_this->_execute(); } /* 80260F44-80260F4C 25B884 0008+00 1/0 0/0 0/0 .text dTimer_IsDelete__FP8dTimer_c */ -static bool dTimer_IsDelete(dTimer_c* i_timer) { +static bool dTimer_IsDelete(dTimer_c* i_this) { return true; } /* 80260F4C-80260F6C 25B88C 0020+00 1/0 0/0 0/0 .text dTimer_Delete__FP8dTimer_c */ -static void dTimer_Delete(dTimer_c* i_timer) { - i_timer->_delete(); +static void dTimer_Delete(dTimer_c* i_this) { + i_this->_delete(); } /* 80260F6C-80260F8C 25B8AC 0020+00 1/0 0/0 0/0 .text dTimer_Create__FP9msg_class */ -static void dTimer_Create(msg_class* i_timer) { - ((dTimer_c*)i_timer)->_create(); +static void dTimer_Create(msg_class* i_this) { + ((dTimer_c*)i_this)->_create(); } /* 80260F8C-80261034 25B8CC 00A8+00 0/0 1/1 9/9 .text dTimer_createTimer__FlUlUcUcffff */ -s32 dTimer_createTimer(s32 param_0, u32 param_1, u8 param_2, u8 param_3, f32 param_4, - f32 param_5, f32 param_6, f32 param_7) { - s32 ret; - +s32 dTimer_createTimer(s32 param_0, u32 param_1, u8 param_2, u8 param_3, f32 param_4, f32 param_5, + f32 param_6, f32 param_7) { if (dComIfG_getTimerMode() == -1) { - ret = fopMsgM_Timer_create(0x315,param_0,param_1,param_2,param_3,param_4,param_5,param_6,param_7,0); + return fopMsgM_Timer_create(PROC_TIMER, param_0, param_1, param_2, param_3, param_4, + param_5, param_6, param_7, 0); } - else { - ret = -1; - } - - return ret; + + return -1; } /* ############################################################################################## */ /* 8039A3D8-8039A3D8 026A38 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ @@ -852,12 +836,16 @@ SECTION_SDATA2 static f32 lit_5547 = 419.0f; /* 80261034-80261100 25B974 00CC+00 0/0 1/1 0/0 .text dTimer_createStockTimer__Fv */ s32 dTimer_createStockTimer() { if (dComIfG_getTimerMode() != -1) { - if ((dComIfG_getTimerMode() == 3 || dComIfG_getTimerMode() == 4) && strcmp(dComIfGp_getStartStageName(),"F_SP115")) { + if ((dComIfG_getTimerMode() == 3 || dComIfG_getTimerMode() == 4) && + strcmp(dComIfGp_getStartStageName(), "F_SP115")) + { dComIfG_setTimerMode(-1); return -1; } else { u8 timer_type = dComIfG_getTimerType(); - return fopMsgM_Timer_create(0x315,10,0,timer_type,0,FLOAT_LABEL(lit_5544),FLOAT_LABEL(lit_5545),FLOAT_LABEL(lit_5546),FLOAT_LABEL(lit_5547),0); + return fopMsgM_Timer_create(PROC_TIMER, 10, 0, timer_type, 0, FLOAT_LABEL(lit_5544), + FLOAT_LABEL(lit_5545), FLOAT_LABEL(lit_5546), + FLOAT_LABEL(lit_5547), 0); } } else { return -1; @@ -868,7 +856,7 @@ s32 dTimer_createStockTimer() { u32 dTimer_createGetIn2D(s32 param_0, cXyz param_1) { if (dComIfG_getTimerPtr()) { cXyz tmp; - mDoLib_project(¶m_1,&tmp); + mDoLib_project(¶m_1, &tmp); param_0 = dComIfG_getTimerPtr()->createGetIn(tmp); } else { param_0 = 0; @@ -890,28 +878,20 @@ static int dTimer_createStart2D(s32 param_0, u16 param_1) { /* 802611F0-80261244 25BB30 0054+00 0/0 0/0 5/5 .text dTimer_isStart__Fv */ int dTimer_isStart() { - int ret; - if (dComIfG_getTimerPtr()) { - ret = dComIfG_getTimerPtr()->isStart(); - } else { - ret = 0; + return dComIfG_getTimerPtr()->isStart(); } - return ret; - + return 0; } + /* 80261244-80261298 25BB84 0054+00 0/0 0/0 2/2 .text dTimer_getRestTimeMs__Fv */ int dTimer_getRestTimeMs() { - int ret; - if (dComIfG_getTimerPtr()) { - ret = dComIfG_getTimerPtr()->getRestTimeMs(); - } else { - ret = 0; + return dComIfG_getTimerPtr()->getRestTimeMs(); } - return ret; + return 0; } /* 80261298-802612EC 25BBD8 0054+00 0/0 0/0 2/2 .text dTimer_show__Fv */ @@ -930,15 +910,11 @@ void dTimer_hide() { /* 80261340-80261394 25BC80 0054+00 0/0 0/0 1/1 .text dTimer_isReadyFlag__Fv */ u32 dTimer_isReadyFlag() { - u32 ret; - if (dComIfG_getTimerPtr()) { - ret = dComIfG_getTimerPtr()->isReadyFlag(); - } else { - ret = 0; + return dComIfG_getTimerPtr()->isReadyFlag(); } - return ret; + return 0; } /* 80261394-802613DC 25BCD4 0048+00 1/0 0/0 0/0 .text __dt__21dDlst_TimerScrnDraw_cFv */ diff --git a/src/d/meter/d_meter2.cpp b/src/d/meter/d_meter2.cpp index 869e615b7ff..315b13bea9f 100644 --- a/src/d/meter/d_meter2.cpp +++ b/src/d/meter/d_meter2.cpp @@ -809,18 +809,22 @@ void dMeter2_c::moveLife() { field_0x204 = g_drawHIO.mLifeGaugePosX; setDraw = true; } + if (field_0x208 != g_drawHIO.mLifeGaugePosY) { field_0x208 = g_drawHIO.mLifeGaugePosY; setDraw = true; } + if (field_0x20c != g_drawHIO.mLifeGaugeScale) { field_0x20c = g_drawHIO.mLifeGaugeScale; setDraw = true; } + if (field_0x210 != g_drawHIO.mHeartScale) { field_0x210 = g_drawHIO.mHeartScale; setDraw = true; } + if (field_0x214 != g_drawHIO.mLargeHeartScale) { field_0x214 = g_drawHIO.mLargeHeartScale; setDraw = true; diff --git a/src/d/meter/d_meter2_draw.cpp b/src/d/meter/d_meter2_draw.cpp index d47a40a9b68..32d6b2b72eb 100644 --- a/src/d/meter/d_meter2_draw.cpp +++ b/src/d/meter/d_meter2_draw.cpp @@ -637,8 +637,8 @@ dMeter2Draw_c::~dMeter2Draw_c() { mpMagicFrameR = NULL; for (int i = 0; i < 3; i++) { - delete field_0x53c[i]; - field_0x53c[i] = NULL; + delete mpOxygenBpk[i]; + mpOxygenBpk[i] = NULL; } delete mpMagicMeter; @@ -961,7 +961,8 @@ void dMeter2Draw_c::exec(u32 param_0) { if (param_0 & 0x1000000) { if (mButtonsPosX != g_drawHIO.mRingHUDButtonsPosX || - mButtonsPosY != g_drawHIO.mRingHUDButtonsPosY) { + mButtonsPosY != g_drawHIO.mRingHUDButtonsPosY) + { mButtonsPosX = g_drawHIO.mRingHUDButtonsPosX; mButtonsPosY = g_drawHIO.mRingHUDButtonsPosY; mpButtonParent->paneTrans(g_drawHIO.mRingHUDButtonsPosX, g_drawHIO.mRingHUDButtonsPosY); @@ -973,7 +974,8 @@ void dMeter2Draw_c::exec(u32 param_0) { } } else { if (mButtonsPosX != g_drawHIO.mMainHUDButtonsPosX || - mButtonsPosY != g_drawHIO.mMainHUDButtonsPosY) { + mButtonsPosY != g_drawHIO.mMainHUDButtonsPosY) + { mButtonsPosX = g_drawHIO.mMainHUDButtonsPosX; mButtonsPosY = g_drawHIO.mMainHUDButtonsPosY; mpButtonParent->paneTrans(g_drawHIO.mMainHUDButtonsPosX, g_drawHIO.mMainHUDButtonsPosY); @@ -1004,6 +1006,57 @@ SECTION_SDATA2 static f32 lit_4923[1 + 1 /* padding */] = { SECTION_SDATA2 static f64 lit_4925 = 4503601774854144.0 /* cast s32 to float */; /* 8021151C-80211BEC 20BE5C 06D0+00 1/0 0/0 0/0 .text draw__13dMeter2Draw_cFv */ +#ifdef NONMATCHING +void dMeter2Draw_c::draw() { + J2DGrafContext* graf = dComIfGp_getCurrentGrafPort(); + + mpScreen->draw(0.0f, 0.0f, graf); + drawKanteraScreen(1); + drawKanteraScreen(2); + + for (int i = 0; i < 2; i++) { + if (mpItemXY[i] != NULL) { + for (int j = 0; j < 3; j++) { + JGeometry::TVec3 vtx1 = pane->getPanePtr()->getGlbVtx(0); + JGeometry::TVec3 vtx2 = pane->getPanePtr()->getGlbVtx(3); + + // mpItemNumTex[i][j]-> + } + } + } + + for (int i = 0; i < 2; i++) { + mpKanteraMeter[i]->drawSelf(); + } + + if (!dComIfGp_isPauseFlag() && mpButtonParent->getAlphaRate() != 0.0f) { + if (field_0x608 > 0.0f) { + drawPikari(mpBTextA, &field_0x608, g_drawHIO.mAButtonHighlightScale, + g_drawHIO.mAButtonHighlightFrontOuter, g_drawHIO.mAButtonHighlightFrontInner, + g_drawHIO.mAButtonHighlightBackOuter, g_drawHIO.mAButtonHighlightBackInner, + g_drawHIO.mAButtonHighlightAnimSpeed, field_0x759); + } + + if (field_0x60c > 0.0f) { + drawPikari(mpBTextB, &field_0x60c, g_drawHIO.mBButtonHighlightScale, + g_drawHIO.mBButtonHighlightFrontOuter, g_drawHIO.mBButtonHighlightFrontInner, + g_drawHIO.mBButtonHighlightBackOuter, g_drawHIO.mBButtonHighlightBackInner, + g_drawHIO.mBButtonHighlightAnimSpeed, field_0x75a); + } + + for (int i = 0; i < 2; i++) { + if (field_0x60c > 0.0f) { + drawPikari(mpBTextXY[i], &field_0x620[i], g_drawHIO.mXYButtonHighlightScale, + g_drawHIO.mXYButtonHighlightFrontOuter, g_drawHIO.mXYButtonHighlightFrontInner, + g_drawHIO.mXYButtonHighlightBackOuter, g_drawHIO.XYButtonHighlightBackInner, + g_drawHIO.mXYButtonHighlightAnimSpeed, field_0x768[i]); + } + } + } + + // TODO +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1012,6 +1065,7 @@ asm void dMeter2Draw_c::draw() { #include "asm/d/meter/d_meter2_draw/draw__13dMeter2Draw_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80398320-803983C0 024980 00A0+00 0/1 0/0 0/0 .rodata life_tag$4931 */ @@ -1139,18 +1193,18 @@ void dMeter2Draw_c::initMagic() { void* res = JKRFileLoader::getGlbResource("zelda_game_image_sanso_10percent.bpk", dComIfGp_getMain2DArchive()); - field_0x53c[0] = (J2DAnmColorKey*)J2DAnmLoaderDataBase::load(res); - field_0x53c[0]->searchUpdateMaterialID(mpKanteraScreen); + mpOxygenBpk[0] = (J2DAnmColorKey*)J2DAnmLoaderDataBase::load(res); + mpOxygenBpk[0]->searchUpdateMaterialID(mpKanteraScreen); res = JKRFileLoader::getGlbResource("zelda_game_image_sanso_25percent.bpk", dComIfGp_getMain2DArchive()); - field_0x53c[1] = (J2DAnmColorKey*)J2DAnmLoaderDataBase::load(res); - field_0x53c[1]->searchUpdateMaterialID(mpKanteraScreen); + mpOxygenBpk[1] = (J2DAnmColorKey*)J2DAnmLoaderDataBase::load(res); + mpOxygenBpk[1]->searchUpdateMaterialID(mpKanteraScreen); res = JKRFileLoader::getGlbResource("zelda_game_image_sanso_50percent.bpk", dComIfGp_getMain2DArchive()); - field_0x53c[2] = (J2DAnmColorKey*)J2DAnmLoaderDataBase::load(res); - field_0x53c[2]->searchUpdateMaterialID(mpKanteraScreen); + mpOxygenBpk[2] = (J2DAnmColorKey*)J2DAnmLoaderDataBase::load(res); + mpOxygenBpk[2]->searchUpdateMaterialID(mpKanteraScreen); field_0x558 = 0.0f; mpMagicParent->setAlphaRate(0.0f); @@ -1163,7 +1217,7 @@ void dMeter2Draw_c::initMagic() { } for (int i = 0; i < 3; i++) { - field_0x5fc[i] = 0.0f; + mMeterAlphaRate[i] = 0.0f; field_0x742[i] = 0; } @@ -1486,6 +1540,60 @@ asm void dMeter2Draw_c::setAlphaLifeAnimeMax() { SECTION_SDATA2 static f32 lit_6143 = 0.25f; /* 80214EB4-80215290 20F7F4 03DC+00 1/1 0/0 0/0 .text drawKanteraScreen__13dMeter2Draw_cFUc */ +// matches with literals +#ifdef NONMATCHING +void dMeter2Draw_c::drawKanteraScreen(u8 i_meterType) { + J2DGrafContext* graf = dComIfGp_getCurrentGrafPort(); + + mpMagicParent->setAlphaRate(mMeterAlphaRate[i_meterType]); + + if (i_meterType == 0) { + JUtility::TColor black = mpMagicMeter->getInitBlack(); + black.a = 255; + + mpMagicMeter->setBlackWhite(black, mpMagicMeter->getInitWhite()); + setAlphaMagicChange(true); + } else if (i_meterType == 1) { + mpMagicMeter->setBlackWhite(JUtility::TColor(255, 255, 140, 255), + JUtility::TColor(230, 170, 0, 255)); + setAlphaKanteraChange(true); + } else if (i_meterType == 2) { + f32 oxygen_percent = (f32)dComIfGp_getOxygen() / (f32)dComIfGp_getMaxOxygen(); + + if (oxygen_percent <= 0.25f) { + mpMagicMeter->setBlackWhite(JUtility::TColor(255, 100, 100, 255), + JUtility::TColor(255, 10, 10, 255)); + playOxygenBpkAnimation(mpOxygenBpk[0]); + + if (mMeterAlphaRate[i_meterType] > 0.0f) { + Z2GetAudioMgr()->mSeMgr.seStartLevel(Z2SE_SWIM_TIMER_BLINK_2, NULL, 0, 0, 1.0f, + 1.0f, -1.0f, -1.0f, 0); + } + } else if (oxygen_percent <= 0.5f) { + mpMagicMeter->setBlackWhite(JUtility::TColor(200, 200, 255, 255), + JUtility::TColor(80, 180, 255, 255)); + playOxygenBpkAnimation(mpOxygenBpk[1]); + + if (mMeterAlphaRate[i_meterType] > 0.0f) { + Z2GetAudioMgr()->mSeMgr.seStartLevel(Z2SE_SWIM_TIMER_BLINK_1, NULL, 0, 0, 1.0f, + 1.0f, -1.0f, -1.0f, 0); + } + } else { + mpMagicMeter->setBlackWhite(JUtility::TColor(200, 200, 255, 255), + JUtility::TColor(80, 180, 255, 255)); + } + + setAlphaOxygenChange(true); + } + + mpMagicMeter->resize(field_0x584[i_meterType], field_0x590[i_meterType]); + mpMagicFrameR->move(field_0x59c[i_meterType], field_0x5a8[i_meterType]); + mpMagicBase->resize(field_0x5b4[i_meterType], field_0x5c0[i_meterType]); + mpMagicParent->scale(field_0x5cc[i_meterType], field_0x5d8[i_meterType]); + mpMagicParent->paneTrans(field_0x5e4[i_meterType], field_0x5f0[i_meterType]); + mpKanteraScreen->draw(0.0f, 0.0f, graf); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1494,6 +1602,7 @@ asm void dMeter2Draw_c::drawKanteraScreen(u8 param_0) { #include "asm/d/meter/d_meter2_draw/drawKanteraScreen__13dMeter2Draw_cFUc.s" } #pragma pop +#endif /* ############################################################################################## */ /* 804548B8-804548BC 002EB8 0004+00 1/1 0/0 0/0 .sdata2 @6175 */ @@ -1501,29 +1610,31 @@ SECTION_SDATA2 static f32 lit_6175 = 0.03125f; /* 80215290-80215380 20FBD0 00F0+00 1/1 0/0 0/0 .text drawMagic__13dMeter2Draw_cFssff */ #ifdef NONMATCHING -void dMeter2Draw_c::drawMagic(s16 max_count, s16 now_count, f32 x_pos, f32 y_pos) { - f32 x_diff = mpMagicFrameR->getInitPosX() - mpMagicFrameL->getInitPosX(); +void dMeter2Draw_c::drawMagic(s16 i_maxMagic, s16 i_nowMagic, f32 i_xPos, f32 i_yPos) { + f32 frameL_posX = mpMagicFrameL->getInitPosX(); + f32 frameR_posX = mpMagicFrameR->getInitPosX(); - field_0x584 = mpMagicMeter->getInitSizeX() * (lit_6175 * now_count); - field_0x590 = mpMagicMeter->getInitSizeY(); + field_0x584[0] = (mpMagicMeter->getInitSizeX() * i_nowMagic) * 0.03125f; + field_0x590[0] = mpMagicMeter->getInitSizeY(); - field_0x59c = mpMagicFrameL->getInitPosX() * x_diff * (max_count * lit_6175); - field_0x5a8 = mpMagicFrameL->getInitPosY(); + field_0x59c[0] = + ((f32)i_maxMagic * (frameR_posX - frameL_posX)) * 0.03125f + mpMagicFrameL->getInitPosX(); + field_0x5a8[0] = mpMagicFrameL->getInitPosY(); - field_0x5b4 = mpMagicBase->getInitSizeX() * (max_count * lit_6175); - field_0x5c0 = mpMagicBase->getInitSizeY(); + field_0x5b4[0] = (f32)i_maxMagic * mpMagicBase->getInitSizeX() * 0.03125f; + field_0x5c0[0] = mpMagicBase->getInitSizeY(); - field_0x5cc = g_drawHIO.mMagicMeterScale; - field_0x5d8 = g_drawHIO.mMagicMeterScale; + field_0x5cc[0] = g_drawHIO.mMagicMeterScale; + field_0x5d8[0] = g_drawHIO.mMagicMeterScale; - field_0x5e4 = x_pos; - field_0x5f0 = y_pos; + field_0x5e4[0] = i_xPos; + field_0x5f0[0] = i_yPos; } #else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dMeter2Draw_c::drawMagic(s16 param_0, s16 param_1, f32 param_2, f32 param_3) { +asm void dMeter2Draw_c::drawMagic(s16 i_maxMagic, s16 i_nowMagic, f32 i_xPos, f32 i_yPos) { nofralloc #include "asm/d/meter/d_meter2_draw/drawMagic__13dMeter2Draw_cFssff.s" } @@ -1531,14 +1642,35 @@ asm void dMeter2Draw_c::drawMagic(s16 param_0, s16 param_1, f32 param_2, f32 par #endif /* 80215380-802154A8 20FCC0 0128+00 2/2 0/0 0/0 .text setAlphaMagicChange__13dMeter2Draw_cFb */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dMeter2Draw_c::setAlphaMagicChange(bool param_0) { - nofralloc -#include "asm/d/meter/d_meter2_draw/setAlphaMagicChange__13dMeter2Draw_cFb.s" +void dMeter2Draw_c::setAlphaMagicChange(bool i_forceSet) { + bool meter_parent_alpha_set = false; + bool meter_alpha_set = false; + bool meter_frame_alpha_set = false; + + if (field_0x7a4 != mpMagicParent->getAlphaRate() || i_forceSet) { + field_0x7a4 = mpMagicParent->getAlphaRate(); + meter_parent_alpha_set = true; + } + + if (mMagicMeterAlpha != g_drawHIO.mMagicMeterAlpha || i_forceSet) { + mMagicMeterAlpha = g_drawHIO.mMagicMeterAlpha; + meter_alpha_set = true; + } + + if (mMagicMeterFrameAlpha != g_drawHIO.mMagicMeterFrameAlpha || i_forceSet) { + mMagicMeterFrameAlpha = g_drawHIO.mMagicMeterFrameAlpha; + meter_frame_alpha_set = true; + } + + if (meter_parent_alpha_set || meter_alpha_set || i_forceSet) { + mpMagicMeter->setAlphaRate(mMagicMeterAlpha * field_0x7a4); + } + + if (meter_parent_alpha_set || meter_frame_alpha_set || i_forceSet) { + mpMagicFrameL->setAlphaRate(mMagicMeterFrameAlpha * field_0x7a4); + mpMagicFrameR->setAlphaRate(mMagicMeterFrameAlpha * field_0x7a4); + } } -#pragma pop /* ############################################################################################## */ /* 804548BC-804548C0 002EBC 0004+00 4/4 0/0 0/0 .sdata2 @6210 */ @@ -1552,24 +1684,60 @@ SECTION_SDATA2 static f64 lit_6293 = 4503599627370496.0 /* cast u32 to float */; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dMeter2Draw_c::drawKantera(s32 param_0, s32 param_1, f32 param_2, f32 param_3) { +asm void dMeter2Draw_c::drawKantera(s32 i_maxOil, s32 i_nowOil, f32 i_xPos, f32 i_yPos) { nofralloc #include "asm/d/meter/d_meter2_draw/drawKantera__13dMeter2Draw_cFllff.s" } #pragma pop /* 802155B8-802156E0 20FEF8 0128+00 2/2 1/1 0/0 .text setAlphaKanteraChange__13dMeter2Draw_cFb */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dMeter2Draw_c::setAlphaKanteraChange(bool param_0) { - nofralloc -#include "asm/d/meter/d_meter2_draw/setAlphaKanteraChange__13dMeter2Draw_cFb.s" +void dMeter2Draw_c::setAlphaKanteraChange(bool i_forceSet) { + bool meter_parent_alpha_set = false; + bool meter_alpha_set = false; + bool meter_frame_alpha_set = false; + + if (field_0x7b0 != mpMagicParent->getAlphaRate() || i_forceSet) { + field_0x7b0 = mpMagicParent->getAlphaRate(); + meter_parent_alpha_set = true; + } + + if (mLanternMeterAlpha != g_drawHIO.mLanternMeterAlpha || i_forceSet) { + mLanternMeterAlpha = g_drawHIO.mLanternMeterAlpha; + meter_alpha_set = true; + } + + if (mLanternMeterFrameAlpha != g_drawHIO.mLanternMeterFrameAlpha || i_forceSet) { + mLanternMeterFrameAlpha = g_drawHIO.mLanternMeterFrameAlpha; + meter_frame_alpha_set = true; + } + + if (meter_parent_alpha_set || meter_alpha_set || i_forceSet) { + mpMagicMeter->setAlphaRate(mLanternMeterAlpha * field_0x7b0); + } + + if (meter_parent_alpha_set || meter_frame_alpha_set || i_forceSet) { + mpMagicFrameL->setAlphaRate(mLanternMeterFrameAlpha * field_0x7b0); + mpMagicFrameR->setAlphaRate(mLanternMeterFrameAlpha * field_0x7b0); + } } -#pragma pop /* 802156E0-8021575C 210020 007C+00 0/0 1/1 0/0 .text setAlphaKanteraAnimeMin__13dMeter2Draw_cFv */ +// matches with literals +#ifdef NONMATCHING +void dMeter2Draw_c::setAlphaKanteraAnimeMin() { + if (field_0x742[1] <= 0) { + mMeterAlphaRate[1] = 0.0f; + } else { + field_0x742[1]--; + if (field_0x742[1] < 0) { + field_0x742[1] = 0; + } + + mMeterAlphaRate[1] = (field_0x742[1] / 5.0f) * g_drawHIO.mHUDAlpha; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1578,9 +1746,25 @@ asm void dMeter2Draw_c::setAlphaKanteraAnimeMin() { #include "asm/d/meter/d_meter2_draw/setAlphaKanteraAnimeMin__13dMeter2Draw_cFv.s" } #pragma pop +#endif /* 8021575C-802157E0 21009C 0084+00 0/0 1/1 0/0 .text setAlphaKanteraAnimeMax__13dMeter2Draw_cFv */ +// matches with literals +#ifdef NONMATCHING +void dMeter2Draw_c::setAlphaKanteraAnimeMax() { + if (field_0x742[1] >= 5) { + mMeterAlphaRate[1] = g_drawHIO.mHUDAlpha; + } else { + field_0x742[1]++; + if (field_0x742[1] > 5) { + field_0x742[1] = 5; + } + + mMeterAlphaRate[1] = (field_0x742[1] / 5.0f) * g_drawHIO.mHUDAlpha; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1589,6 +1773,7 @@ asm void dMeter2Draw_c::setAlphaKanteraAnimeMax() { #include "asm/d/meter/d_meter2_draw/setAlphaKanteraAnimeMax__13dMeter2Draw_cFv.s" } #pragma pop +#endif /* 802157E0-802158F0 210120 0110+00 0/0 1/1 0/0 .text drawOxygen__13dMeter2Draw_cFllff */ #pragma push @@ -1601,16 +1786,52 @@ asm void dMeter2Draw_c::drawOxygen(s32 param_0, s32 param_1, f32 param_2, f32 pa #pragma pop /* 802158F0-80215A18 210230 0128+00 1/1 1/1 0/0 .text setAlphaOxygenChange__13dMeter2Draw_cFb */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dMeter2Draw_c::setAlphaOxygenChange(bool param_0) { - nofralloc -#include "asm/d/meter/d_meter2_draw/setAlphaOxygenChange__13dMeter2Draw_cFb.s" +void dMeter2Draw_c::setAlphaOxygenChange(bool i_forceSet) { + bool meter_parent_alpha_set = false; + bool meter_alpha_set = false; + bool meter_frame_alpha_set = false; + + if (field_0x7bc != mpMagicParent->getAlphaRate() || i_forceSet) { + field_0x7bc = mpMagicParent->getAlphaRate(); + meter_parent_alpha_set = true; + } + + if (mOxygenMeterAlpha != g_drawHIO.mOxygenMeterAlpha || i_forceSet) { + mOxygenMeterAlpha = g_drawHIO.mOxygenMeterAlpha; + meter_alpha_set = true; + } + + if (mOxygenMeterFrameAlpha != g_drawHIO.mOxygenMeterFrameAlpha || i_forceSet) { + mOxygenMeterFrameAlpha = g_drawHIO.mOxygenMeterFrameAlpha; + meter_frame_alpha_set = true; + } + + if (meter_parent_alpha_set || meter_alpha_set || i_forceSet) { + mpMagicMeter->setAlphaRate(mOxygenMeterAlpha * field_0x7bc); + } + + if (meter_parent_alpha_set || meter_frame_alpha_set || i_forceSet) { + mpMagicFrameL->setAlphaRate(mOxygenMeterFrameAlpha * field_0x7bc); + mpMagicFrameR->setAlphaRate(mOxygenMeterFrameAlpha * field_0x7bc); + } } -#pragma pop /* 80215A18-80215A94 210358 007C+00 0/0 1/1 0/0 .text setAlphaOxygenAnimeMin__13dMeter2Draw_cFv */ +// matches with literals +#ifdef NONMATCHING +void dMeter2Draw_c::setAlphaOxygenAnimeMin() { + if (field_0x742[2] <= 0) { + mMeterAlphaRate[2] = 0.0f; + } else { + field_0x742[2]--; + if (field_0x742[2] < 0) { + field_0x742[2] = 0; + } + + mMeterAlphaRate[2] = (field_0x742[2] / 5.0f) * g_drawHIO.mHUDAlpha; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1619,8 +1840,24 @@ asm void dMeter2Draw_c::setAlphaOxygenAnimeMin() { #include "asm/d/meter/d_meter2_draw/setAlphaOxygenAnimeMin__13dMeter2Draw_cFv.s" } #pragma pop +#endif /* 80215A94-80215B18 2103D4 0084+00 0/0 1/1 0/0 .text setAlphaOxygenAnimeMax__13dMeter2Draw_cFv */ +// matches with literals +#ifdef NONMATCHING +void dMeter2Draw_c::setAlphaOxygenAnimeMax() { + if (field_0x742[2] >= 5) { + mMeterAlphaRate[2] = g_drawHIO.mHUDAlpha; + } else { + field_0x742[2]++; + if (field_0x742[2] > 5) { + field_0x742[2] = 5; + } + + mMeterAlphaRate[2] = (field_0x742[2] / 5.0f) * g_drawHIO.mHUDAlpha; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1629,6 +1866,7 @@ asm void dMeter2Draw_c::setAlphaOxygenAnimeMax() { #include "asm/d/meter/d_meter2_draw/setAlphaOxygenAnimeMax__13dMeter2Draw_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 804548C8-804548CC 002EC8 0004+00 4/4 0/0 0/0 .sdata2 @6524 */ @@ -1647,9 +1885,7 @@ asm void dMeter2Draw_c::drawLightDrop(u8 param_0, u8 param_1, f32 param_2, f32 p /* 80215DA4-80215DA8 2106E4 0004+00 1/1 1/1 0/0 .text setAlphaLightDropChange__13dMeter2Draw_cFb */ -void dMeter2Draw_c::setAlphaLightDropChange(bool param_0) { - /* empty function */ -} +void dMeter2Draw_c::setAlphaLightDropChange(bool param_0) {} /* 80215DA8-80215E40 2106E8 0098+00 0/0 1/1 0/0 .text getNowLightDropRateCalc__13dMeter2Draw_cFv */ @@ -2192,6 +2428,29 @@ SECTION_SBSS2 static u8 lit_8747[4]; SECTION_SBSS2 static u8 data_80456B9C[4]; /* 8021AF78-8021B0C8 2158B8 0150+00 0/0 1/1 0/0 .text drawKanteraMeter__13dMeter2Draw_cFUcf */ +#ifdef NONMATCHING +void dMeter2Draw_c::drawKanteraMeter(u8 i_button, f32 i_alphaRate) { + CPaneMgr* pane = mpItemXY[i_button]; + f32 local_68[2][2]; + local_68[1][0] = 0.0f; + local_68[1][1] = 0.0f; + local_68[0][0] = 0.0f; + local_68[0][1] = 0.0f; + + if (i_alphaRate == 1.0f) { + i_alphaRate = pane->getAlphaRate(); + } + + JGeometry::TVec3 vtx1 = pane->getPanePtr()->getGlbVtx(0); + JGeometry::TVec3 vtx2 = pane->getPanePtr()->getGlbVtx(3); + + mpKanteraMeter[i_button]->setPos((vtx1.x + vtx2.x) * 0.5f + 9.0f + local_68[1][i_button], + vtx2.y + local_68[0][i_button]); + mpKanteraMeter[i_button]->setScale(0.6f, 0.6f); + mpKanteraMeter[i_button]->setNowGauge(dComIfGs_getMaxOil(), dComIfGs_getOil()); + mpKanteraMeter[i_button]->setAlphaRate(i_alphaRate); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2200,6 +2459,7 @@ asm void dMeter2Draw_c::drawKanteraMeter(u8 param_0, f32 param_1) { #include "asm/d/meter/d_meter2_draw/drawKanteraMeter__13dMeter2Draw_cFUcf.s" } #pragma pop +#endif /* 8021B0C8-8021B104 215A08 003C+00 0/0 3/3 0/0 .text isButtonVisible__13dMeter2Draw_cFv */ @@ -2414,7 +2674,8 @@ SECTION_DEAD static char const* const pad_80398A77 = ""; */ bool dMeter2Draw_c::getCanoeFishing() { if (!strcmp(dComIfGp_getStartStageName(), "F_SP127") && - g_dComIfG_gameInfo.play.mPlayer[0]->checkCanoeRide()) { + g_dComIfG_gameInfo.play.mPlayer[0]->checkCanoeRide()) + { return TRUE; } else { return FALSE;