diff --git a/configure.py b/configure.py index 9d753cb9037..7b42a4e549c 100644 --- a/configure.py +++ b/configure.py @@ -476,7 +476,7 @@ def MatchingFor(*versions): Object(Matching, "d/d_kankyo_data.cpp"), Object(Matching, "d/d_kankyo_wether.cpp"), Object(NonMatching, "d/d_kankyo_rain.cpp"), - Object(NonMatching, "d/d_vibration.cpp"), + Object(Matching, "d/d_vibration.cpp"), Object(Matching, "d/d_vib_pattern.cpp"), Object(NonMatching, "d/d_attention.cpp"), Object(Matching, "d/d_bg_pc.cpp"), @@ -942,7 +942,7 @@ def MatchingFor(*versions): Object(Matching, "JSystem/JUtility/JUTFont.cpp"), Object(Matching, "JSystem/JUtility/JUTResFont.cpp", extra_cflags=['-pragma "nosyminline off"']), Object(Matching, "JSystem/JUtility/JUTDbPrint.cpp"), - Object(NonMatching, "JSystem/JUtility/JUTGamePad.cpp"), + Object(Matching, "JSystem/JUtility/JUTGamePad.cpp"), Object(NonMatching, "JSystem/JUtility/JUTException.cpp"), Object(Matching, "JSystem/JUtility/JUTDirectPrint.cpp"), Object(Matching, "JSystem/JUtility/JUTAssert.cpp"), diff --git a/include/JSystem/JSupport/JSUList.h b/include/JSystem/JSupport/JSUList.h index 60abf9af4d9..7228ff0a101 100644 --- a/include/JSystem/JSupport/JSUList.h +++ b/include/JSystem/JSupport/JSUList.h @@ -168,7 +168,7 @@ class JSUListIterator { T& operator*() { return *this->getObject(); } - T* operator->() { return this->getObject(); } + T* operator->() const { return mLink->getObject(); } // private: JSULink* mLink; diff --git a/include/JSystem/JUtility/JUTException.h b/include/JSystem/JUtility/JUTException.h index 5c6519fb33b..b9b6829ae26 100644 --- a/include/JSystem/JUtility/JUTException.h +++ b/include/JSystem/JUtility/JUTException.h @@ -104,7 +104,7 @@ class JUTException : public JKRThread { void setTraceSuppress(u32 param_0) { mTraceSuppress = param_0; } void setGamePad(JUTGamePad* gamePad) { mGamePad = gamePad; - mGamePadPort = JUTGamePad::Port_Unknown; + mGamePadPort = JUTGamePad::EPortInvalid; } static void setMapFile(const char* map) { diff --git a/include/JSystem/JUtility/JUTGamePad.h b/include/JSystem/JUtility/JUTGamePad.h index 38a731e69a3..f43b17bea9e 100644 --- a/include/JSystem/JUtility/JUTGamePad.h +++ b/include/JSystem/JUtility/JUTGamePad.h @@ -2,38 +2,21 @@ #define JUTGAMEPAD_H #include "JSystem/JKernel/JKRDisposer.h" -#include "dolphin/os/OSTime.h" -#include "dolphin/pad.h" +#include "JSystem/JUtility/JUTAssert.h" +#include typedef void (*callbackFn)(int, void*); -namespace CButton { -enum { - DPAD_LEFT = 0x0001, - DPAD_RIGHT = 0x0002, - DPAD_DOWN = 0x0004, - DPAD_UP = 0x0008, - Z = 0x0010, - R = 0x0020, - L = 0x0040, - A = 0x0100, - B = 0x0200, - X = 0x0400, - Y = 0x0800, - START = 0x1000, -}; -} - -extern bool sResetSwitchPushing__Q210JUTGamePad13C3ButtonReset; - /** * @ingroup jsystem-jutility * */ struct JUTGamePadRecordBase { - virtual void unk0() {} - virtual void unk1(PADStatus* pad) {} - virtual void unk2() {} + virtual ~JUTGamePadRecordBase() {} + virtual void getStatus(PADStatus* pad) = 0; + virtual void write(PADStatus* pad) = 0; + + bool isActive() const { return mActive; } /* 0x4 */ bool mActive; }; @@ -45,35 +28,44 @@ struct JUTGamePadRecordBase { struct JUTGamePad : public JKRDisposer { public: enum EStickMode { - STICK_MODE_1 = 1, + EStickMode1 = 1, }; + enum EWhichStick { - WS_MAIN_STICK, - WS_SUB_STICK, + EMainStick, + ESubStick, }; + enum EPadPort { - Port_Unknown = -1, - Port_1, - Port_2, - Port_3, - Port_4, + EPortInvalid = -1, + EPort1, + EPort2, + EPort3, + EPort4, + }; + + enum EClampMode { + EClampNone, + EClampStick, + EClampCircle, }; JUTGamePad(JUTGamePad::EPadPort port); virtual ~JUTGamePad(); void initList(); - static s32 init(); + static BOOL init(); void clear(); static u32 read(); void assign(); - void checkResetCallback(OSTime unk); + void checkResetCallback(OSTime holdTime); void update(); void stopPatternedRumble() { mRumble.stopPatternedRumble(mPortNum); } + static void checkResetSwitch(); static void clearForReset(); - static JUTGamePad* getGamePad(int pad_index); - static bool recalibrate(u32 pad_mask); + static JUTGamePad* getGamePad(int port); + static bool recalibrate(u32 mask); static void setAnalogMode(u32 mode) { sAnalogMode = mode; @@ -82,59 +74,39 @@ struct JUTGamePad : public JKRDisposer { static void clearResetOccurred() { C3ButtonReset::sResetOccurred = false; } - static void setResetCallback(callbackFn callback, void* param_0) { + static void setResetCallback(callbackFn callback, void* arg) { C3ButtonReset::sCallback = callback; - C3ButtonReset::sCallbackArg = param_0; + C3ButtonReset::sCallbackArg = arg; } u32 getButton() const { return mButton.mButton; } - u32 getTrigger() const { return mButton.mTrigger; } - f32 getMainStickX() const { return mMainStick.mPosX; } - f32 getMainStickY() const { return mMainStick.mPosY; } - f32 getMainStickValue() const { return mMainStick.mValue; } - s16 getMainStickAngle() const { return mMainStick.mAngle; } - f32 getSubStickX() const { return mSubStick.mPosX; } - f32 getSubStickY() const { return mSubStick.mPosY; } - f32 getSubStickValue() const { return mSubStick.mValue; } - s16 getSubStickAngle() const { return mSubStick.mAngle; } - u8 getAnalogA() const { return mButton.mAnalogA; } - u8 getAnalogB() const { return mButton.mAnalogB; } - u8 getAnalogL() const { return mButton.mAnalogL; } - u8 getAnalogR() const { return mButton.mAnalogR; } - s8 getErrorStatus() const { return mErrorStatus; } s16 getPortNum() const { return mPortNum; } JUTGamePadRecordBase* getPadReplay() const { return mPadReplay; } - JUTGamePadRecordBase* getPadRecord() const { return mPadRecord; } u32 testTrigger(u32 button) const { return mButton.mTrigger & button; } bool isPushing3ButtonReset() const { - bool isPushingReset = false; - - if (mPortNum != -1 && mButtonReset.mReset != false) { - isPushingReset = true; - } - return isPushingReset; + return mPortNum != EPortInvalid && mButtonReset.mReset != false; } - inline void stopMotorWave() { mRumble.stopPatternedRumbleAtThePeriod(); } + void stopMotorWave() { mRumble.stopPatternedRumbleAtThePeriod(); } void stopMotor() { mRumble.stopMotor(mPortNum, false); } void stopMotorHard() { mRumble.stopMotorHard(mPortNum); } @@ -143,8 +115,8 @@ struct JUTGamePad : public JKRDisposer { struct CButton { CButton() { clear(); } void clear(); - void update(PADStatus const*, u32 unk); - void setRepeat(u32 unk0, u32 unk1, u32 unk2); + void update(const PADStatus* padStatus, u32 stickStatus); + void setRepeat(u32 mask, u32 delay, u32 rate); /* 0x00 */ u32 mButton; /* 0x04 */ u32 mTrigger; // Pressed Buttons @@ -156,11 +128,11 @@ struct JUTGamePad : public JKRDisposer { /* 0x10 */ f32 mAnalogLf; /* 0x14 */ f32 mAnalogRf; /* 0x18 */ u32 mRepeat; - /* 0x1C */ u32 field_0x1c; - /* 0x20 */ u32 field_0x20; - /* 0x24 */ u32 field_0x24; - /* 0x28 */ u32 field_0x28; - /* 0x2C */ u32 field_0x2c; + /* 0x1C */ u32 mRepeatCount; + /* 0x20 */ u32 mRepeatStart; + /* 0x24 */ u32 mRepeatMask; + /* 0x28 */ u32 mRepeatDelay; + /* 0x2C */ u32 mRepeatRate; }; // Size: 0x30 struct C3ButtonReset { @@ -185,16 +157,16 @@ struct JUTGamePad : public JKRDisposer { CStick() { clear(); } void clear(); void clear(JUTGamePad* pad); - u32 update(s8 unk0, s8 unk1, JUTGamePad::EStickMode mode, JUTGamePad::EWhichStick stick, - u32 unk2); - u32 getButton(u32 unk); + u32 update(s8 x, s8 u, JUTGamePad::EStickMode mode, JUTGamePad::EWhichStick stick, + u32 buttons); + u32 getButton(u32 buttons); /* 0x0 */ f32 mPosX; /* 0x4 */ f32 mPosY; /* 0x8 */ f32 mValue; /* 0xC */ s16 mAngle; - /* 0xE */ s8 field_0xe; - /* 0xF */ s8 field_0xf; + /* 0xE */ s8 mRawX; + /* 0xF */ s8 mRawY; }; // Size: 0x10 void stopMotorWaveHard() { mRumble.stopPatternedRumble(mPortNum); } @@ -214,31 +186,48 @@ struct JUTGamePad : public JKRDisposer { void clear(); void clear(JUTGamePad* pad); - static void startMotor(int channel); - static void stopMotor(int channel, bool stop); - void update(s16 unk0); - void triggerPatternedRumble(u32 unk0); - void startPatternedRumble(void* unk0, ERumble rumble, u32 unk1); - void stopPatternedRumble(s16 pad_port); + static void startMotor(int port); + static void stopMotor(int port, bool hard_stop); + void update(s16 port); + void triggerPatternedRumble(u32 length); + void startPatternedRumble(void* data, ERumble rumble, u32 length); + void stopPatternedRumble(s16 port); void stopPatternedRumbleAtThePeriod(); - static void setEnabled(u32 pad_mask); + static void setEnabled(u32 mask); - void stopMotorHard(int portNo) { stopMotor(portNo, true); } + void stopMotorHard(int port) { stopMotor(port, true); } static bool isEnabled(u32 mask) { return mEnabled & mask; } - static bool isEnabledPort(int port) { return isEnabled(sChannelMask[port]); } - /* 0x00 */ u32 field_0x0; - /* 0x04 */ u32 field_0x4; - /* 0x08 */ u8* field_0x8; - /* 0x0C */ u32 field_0xc; + static bool isEnabledPort(int port) { + JUT_ASSERT(250, 0 <= port && port < 4); + return isEnabled(sChannelMask[port]); + } + + /* 0x00 */ u32 mFrame; + /* 0x04 */ u32 mLength; + /* 0x08 */ u8* mPattern; + /* 0x0C */ u32 mFrameCount; /* 0x10 */ u8* field_0x10; }; // Size: 0x14 - void startMotorWave(void* param_2, CRumble::ERumble rumble, u32 param_4) { - mRumble.startPatternedRumble(param_2, rumble, param_4); + void startMotorWave(void* data, CRumble::ERumble rumble, u32 length) { + mRumble.startPatternedRumble(data, rumble, length); } + static JSUList mPadList; + static bool mListInitialized; + static PADStatus mPadStatus[4]; + static CButton mPadButton[4]; + static CStick mPadMStick[4]; + static CStick mPadSStick[4]; + static EStickMode sStickMode; + static int sClampMode; + static u8 mPadAssign[4]; + static u32 sSuppressPadReset; + static s32 sAnalogMode; + static u32 sRumbleSupported; + /* 0x18 */ CButton mButton; /* 0x48 */ CStick mMainStick; /* 0x58 */ CStick mSubStick; @@ -250,21 +239,8 @@ struct JUTGamePad : public JKRDisposer { /* 0x94 */ JUTGamePadRecordBase* mPadReplay; /* 0x98 */ C3ButtonReset mButtonReset; /* 0x9C */ u8 field_0x9c[4]; - /* 0xA0 */ OSTime mResetTime; + /* 0xA0 */ OSTime mResetHoldStartTime; /* 0xA8 */ u8 field_0xa8; - - static JSUList mPadList; - static bool mListInitialized; - static PADStatus mPadStatus[4]; - static CButton mPadButton[4]; - static CStick mPadMStick[4]; - static CStick mPadSStick[4]; - static EStickMode sStickMode; - static u32 sClampMode; - static u8 mPadAssign[4]; - static u32 sSuppressPadReset; - static s32 sAnalogMode; - static u32 sRumbleSupported; }; /** @@ -273,19 +249,20 @@ struct JUTGamePad : public JKRDisposer { */ struct JUTGamePadLongPress { static JSUList sPatternList; - void checkCallback(int port, u32 timer); + void checkCallback(int port, u32 hold_time); u32 getMaskPattern() const { return mMaskPattern; } u32 getPattern() const { return mPattern; } + bool isValid() const { return mValid; } /* 0x00 */ u8 field_0x0[0x10]; /* 0x10 */ bool mValid; /* 0x11 */ bool field_0x11; /* 0x14 */ u32 mPattern; /* 0x18 */ u32 mMaskPattern; - /* 0x1C */ u32 field_0x1c; - /* 0x20 */ bool field_0x20[4]; - /* 0x28 */ OSTime mTimer[4]; + /* 0x1C */ u32 mThreshold; + /* 0x20 */ bool mLongPressStatus[4]; + /* 0x28 */ OSTime mStartHoldTime[4]; /* 0x48 */ bool field_0x48[4]; /* 0x4C */ void (*mCallback)(s32, JUTGamePadLongPress*, s32); /* 0x50 */ s32 field_0x50; diff --git a/include/d/d_menu_window.h b/include/d/d_menu_window.h index 4b21fb17a48..90dceda47d5 100644 --- a/include/d/d_menu_window.h +++ b/include/d/d_menu_window.h @@ -4,6 +4,8 @@ #include "d/d_drawlist.h" #include "f_op/f_op_msg.h" #include "m_Do/m_Do_graphic.h" +#include "d/d_com_inf_game.h" +#include "JSystem/JUtility/JUTTexture.h" struct CSTControl; class STControl; @@ -29,7 +31,7 @@ BOOL dMw_START_TRIGGER(); class dDlst_MENU_CAPTURE_c : public dDlst_base_c { public: - /* 801FDFCC */ virtual void draw();/* { + virtual void draw() { if (getDrawFlag() == 1) { setDrawFlag(); dComIfGp_onPauseFlag(); @@ -50,7 +52,7 @@ class dDlst_MENU_CAPTURE_c : public dDlst_base_c { 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); - GXColor color = {0xFF, 0xFF, 0xFF, mAlpha}; + const GXColor color = {0, 0, 0, mAlpha}; GXSetTevColor(GX_TEVREG0, color); GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0); GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); @@ -84,8 +86,9 @@ class dDlst_MENU_CAPTURE_c : public dDlst_base_c { GXTexCoord2s8(0, 1); GXEnd(); } - } */ - /* 801FE2E8 */ virtual ~dDlst_MENU_CAPTURE_c(); + } + + virtual ~dDlst_MENU_CAPTURE_c() {} dDlst_MENU_CAPTURE_c() { mFlag = 0; @@ -256,6 +259,7 @@ class dMw_c : public msg_class { void onPauseWindow() { mPauseWindow = true; } void offPauseWindow() { mPauseWindow = false; } + bool isPauseWindow() { return mPauseWindow != false; } void onShowFlag() { mShowFlag |= 1; } void offShowFlag() { mShowFlag &= ~1; } bool isShowFlag() { return mShowFlag & 1 != 0; } @@ -277,12 +281,12 @@ class dMw_c : public msg_class { /* 0x12C */ dMenu_Fishing_c* mpMenuFishing; /* 0x130 */ dMenu_Skill_c* mpMenuSkill; /* 0x134 */ dMenu_Insect_c* mpMenuInsect; - /* 0x138 */ s32 mMemSize; + /* 0x138 */ int mMemSize; /* 0x13C */ f32 mFmapStageTransX; /* 0x140 */ f32 mFmapStageTransZ; /* 0x144 */ u8 field_0x144; - /* 0x145 */ u8 mButtons; - /* 0x146 */ u8 mMenuStatus; + /* 0x145 */ u8 mButtonBits; + /* 0x146 */ u8 mMenuProc; /* 0x147 */ u8 mShowFlag; /* 0x148 */ s8 field_0x148; /* 0x149 */ u8 field_0x149; @@ -302,12 +306,4 @@ class dMw_c : public msg_class { BOOL dMw_LEFT_TRIGGER(); BOOL dMw_RIGHT_TRIGGER(); -static int dMw_Draw(dMw_c*); -static int dMw_Execute(dMw_c*); -static int dMw_IsDelete(dMw_c*); -static int dMw_Delete(dMw_c*); -static int dMw_Create(msg_class*); - -typedef int (*dMw_Method)(dMw_c*); - #endif /* D_MENU_D_MENU_WINDOW_H */ diff --git a/include/d/d_meter2_info.h b/include/d/d_meter2_info.h index 10ade04bbe8..3d3451a0c3c 100644 --- a/include/d/d_meter2_info.h +++ b/include/d/d_meter2_info.h @@ -191,6 +191,7 @@ class dMeter2Info_c { f32 get2DHeight() { return m2DHeight; } u8 getTableMapRegionNo() { return mTableMapRegionNo; } u8 getGoldWolfMapType() { return mGoldWolfMapType; } + bool isWindowAccept(int param_0) { return mWindowAccept & (1 << param_0); } public: /* 0x04 */ u8 unk4[4]; @@ -789,6 +790,10 @@ inline u8 dMeter2Info_getGoldWolfMapType() { return g_meter2_info.getGoldWolfMapType(); } +inline bool dMeter2Info_isWindowAccept(int param_0) { + return g_meter2_info.isWindowAccept(param_0); +} + const char* dMeter2Info_getPlusTextureName(); const char* dMeter2Info_getNumberTextureName(int pIndex); int dMeter2Info_recieveLetter(); diff --git a/include/d/d_vib_pattern.h b/include/d/d_vib_pattern.h index 00d57273266..122015787d1 100644 --- a/include/d/d_vib_pattern.h +++ b/include/d/d_vib_pattern.h @@ -3,11 +3,6 @@ #include "dolphin/types.h" -class dVibration_pattern { -public: - u16 field_0x00; - u16 field_0x02; - u32 field_0x04; -}; + #endif /* D_D_VIB_PATTERN_H */ diff --git a/include/d/d_vibration.h b/include/d/d_vibration.h index 80e2819f371..e4ec6d0007e 100644 --- a/include/d/d_vibration.h +++ b/include/d/d_vibration.h @@ -2,15 +2,59 @@ #define D_D_VIBRATION_H #include "SSystem/SComponent/c_xyz.h" -#include "d/d_vib_pattern.h" + +struct vib_pattern { + /* 0x0 */ u16 rounds; + /* 0x2 */ u16 length; + /* 0x4 */ u32 bits; +}; class dVibration_c { public: + enum { + MODE_PAUSE = -1, + MODE_WAIT, + MODE_RUN, + }; + + enum VIBMODE_SHOCK { + VIBMODE_S_NONE = -1, + VIBMODE_S_CUSTOM, + VIBMODE_S_POWER1, + VIBMODE_S_POWER2, + VIBMODE_S_POWER3, + VIBMODE_S_POWER4, + VIBMODE_S_POWER5, + VIBMODE_S_POWER6, + VIBMODE_S_POWER7, + VIBMODE_S_POWER8, + VIBMODE_S_DOKUTT, + VIBMODE_S_FOR2D, + + VIBMODE_S_MAX + }; + + enum VIBMODE_QUAKE { + VIBMODE_Q_NONE = -1, + VIBMODE_Q_CUSTOM, + VIBMODE_Q_POWER1, + VIBMODE_Q_POWER2, + VIBMODE_Q_POWER3, + VIBMODE_Q_POWER4, + VIBMODE_Q_POWER5, + VIBMODE_Q_POWER6, + VIBMODE_Q_POWER7, + VIBMODE_Q_POWER8, + VIBMODE_Q_HORSE, + + VIBMODE_Q_MAX + }; + /* 8006F268 */ int Run(); - /* 8006FA24 */ bool StartShock(int i_strength, int, cXyz); - /* 8006FC0C */ bool StartQuake(u8 const*, int, int, cXyz); - /* 8006FB10 */ bool StartQuake(int, int, cXyz); - /* 8006FD94 */ int StopQuake(int); + /* 8006FA24 */ bool StartShock(int i_vibmode, int i_flags, cXyz i_pos); + /* 8006FC0C */ bool StartQuake(const u8* i_pattern, int i_rounds, int i_flags, cXyz i_pos); + /* 8006FB10 */ bool StartQuake(int i_vibmode, int i_flags, cXyz i_pos); + /* 8006FD94 */ int StopQuake(int i_flags); /* 8006FE00 */ void Kill(); /* 8006FE5C */ bool CheckQuake(); /* 8006FE84 */ void setDefault(); @@ -18,10 +62,10 @@ class dVibration_c { /* 8006FF38 */ void Pause(); /* 8006FFF8 */ void Remove(); - static dVibration_pattern const MS_patt[11]; - static dVibration_pattern const CS_patt[11]; - static dVibration_pattern const MQ_patt[10]; - static dVibration_pattern const CQ_patt[10]; + static const vib_pattern MS_patt[VIBMODE_S_MAX]; + static const vib_pattern CS_patt[VIBMODE_S_MAX]; + static const vib_pattern MQ_patt[VIBMODE_Q_MAX]; + static const vib_pattern CQ_patt[VIBMODE_Q_MAX]; private: class { @@ -29,31 +73,30 @@ class dVibration_c { class { public: /* 0x00 */ u32 field_0x0; - /* 0x04 */ s32 field_0x4; - /* 0x08 */ s32 field_0x8; - /* 0x0C */ s32 field_0xc; - /* 0x10 */ s32 field_0x10; - /* 0x14 */ s32 field_0x14; - /* 0x18 */ cXyz field_0x18; - /* 0x24 */ s32 field_0x24; + /* 0x04 */ int mVibMode; + /* 0x08 */ u32 mPattern; + /* 0x0C */ s32 mLength; + /* 0x10 */ s32 mRounds; + /* 0x14 */ s32 mFlags; + /* 0x18 */ cXyz mPos; + /* 0x24 */ s32 mFrame; + } mShock, mQuake; + } /* 0x00 */ mCamera; + class { + public: + class { + public: + /* 0x00 */ u32 field_0x0; + /* 0x04 */ int mVibMode; + /* 0x08 */ u32 mPattern; + /* 0x0C */ s32 mLength; + /* 0x10 */ s32 mRounds; + /* 0x14 */ s32 mFrame; + /* 0x18 */ s32 mStopFrame; } mShock, mQuake; - } /* 0x00 */ field_0x0; - /* 0x50 */ u32 field_0x50; - /* 0x54 */ int field_0x54; - /* 0x58 */ s32 field_0x58; - /* 0x5C */ s32 field_0x5c; - /* 0x60 */ s32 field_0x60; - /* 0x64 */ s32 field_0x64; - /* 0x68 */ s32 field_0x68; - /* 0x6C */ u32 field_0x6c; - /* 0x70 */ s32 field_0x70; - /* 0x74 */ u32 field_0x74; - /* 0x78 */ u32 field_0x78; - /* 0x7C */ s32 field_0x7c; - /* 0x80 */ s32 field_0x80; - /* 0x84 */ s32 field_0x84; - /* 0x88 */ s32 field_0x88; - /* 0x8C */ s32 field_0x8c; + } /* 0x50 */ mMotor; + /* 0x88 */ s32 mFrame; + /* 0x8C */ s32 mMode; }; // Size: 0x90 #endif /* D_D_VIBRATION_H */ diff --git a/include/m_Do/m_Do_controller_pad.h b/include/m_Do/m_Do_controller_pad.h index bbe9549547c..4c77bb7888a 100644 --- a/include/m_Do/m_Do_controller_pad.h +++ b/include/m_Do/m_Do_controller_pad.h @@ -20,32 +20,32 @@ class mDoCPd_c { static u32 getTrig(u32 pad) { return getCpadInfo(pad).mPressedButtonFlags; } static u32 getTrigLockL(u32 pad) { return getCpadInfo(pad).mTrigLockL; } static u32 getTrigLockR(u32 pad) { return getCpadInfo(pad).mTrigLockR; } - static u32 getTrigUp(u32 pad) { return getTrig(pad) & CButton::DPAD_UP; } - static u32 getTrigDown(u32 pad) { return getTrig(pad) & CButton::DPAD_DOWN; } - static u32 getTrigLeft(u32 pad) { return getTrig(pad) & CButton::DPAD_LEFT; } - static u32 getTrigRight(u32 pad) { return getTrig(pad) & CButton::DPAD_RIGHT; } - static u32 getTrigL(u32 pad) { return getTrig(pad) & CButton::L; } - static u32 getTrigR(u32 pad) { return getTrig(pad) & CButton::R; } - static u32 getTrigA(u32 pad) { return getTrig(pad) & CButton::A; } - static u32 getTrigB(u32 pad) { return getTrig(pad) & CButton::B; } - static u32 getTrigZ(u32 pad) { return getTrig(pad) & CButton::Z; } - static u32 getTrigY(u32 pad) { return getTrig(pad) & CButton::Y; } - static u32 getTrigX(u32 pad) { return getTrig(pad) & CButton::X; } - static u32 getTrigStart(u32 pad) { return getTrig(pad) & CButton::START; } + static u32 getTrigUp(u32 pad) { return getTrig(pad) & PAD_BUTTON_UP; } + static u32 getTrigDown(u32 pad) { return getTrig(pad) & PAD_BUTTON_DOWN; } + static u32 getTrigLeft(u32 pad) { return getTrig(pad) & PAD_BUTTON_LEFT; } + static u32 getTrigRight(u32 pad) { return getTrig(pad) & PAD_BUTTON_RIGHT; } + static u32 getTrigL(u32 pad) { return getTrig(pad) & PAD_TRIGGER_L; } + static u32 getTrigR(u32 pad) { return getTrig(pad) & PAD_TRIGGER_R; } + static u32 getTrigA(u32 pad) { return getTrig(pad) & PAD_BUTTON_A; } + static u32 getTrigB(u32 pad) { return getTrig(pad) & PAD_BUTTON_B; } + static u32 getTrigZ(u32 pad) { return getTrig(pad) & PAD_TRIGGER_Z; } + static u32 getTrigY(u32 pad) { return getTrig(pad) & PAD_BUTTON_Y; } + static u32 getTrigX(u32 pad) { return getTrig(pad) & PAD_BUTTON_X; } + static u32 getTrigStart(u32 pad) { return getTrig(pad) & PAD_BUTTON_START; } static u32 getHold(u32 pad) { return getCpadInfo(pad).mButtonFlags; } static u32 getHoldLockL(u32 pad) { return getCpadInfo(pad).mHoldLockL; } static u32 getHoldLockR(u32 pad) { return getCpadInfo(pad).mHoldLockR; } - static u32 getHoldUp(u32 pad) { return getHold(pad) & CButton::DPAD_UP; } - static u32 getHoldDown(u32 pad) { return getHold(pad) & CButton::DPAD_DOWN; } - static u32 getHoldLeft(u32 pad) { return getHold(pad) & CButton::DPAD_LEFT; } - static u32 getHoldRight(u32 pad) { return getHold(pad) & CButton::DPAD_RIGHT; } - static u32 getHoldL(u32 pad) { return getHold(pad) & CButton::L; } - static u32 getHoldR(u32 pad) { return getHold(pad) & CButton::R; } - static u32 getHoldA(u32 pad) { return getHold(pad) & CButton::A; } - static u32 getHoldB(u32 pad) { return getHold(pad) & CButton::B; } - static u32 getHoldZ(u32 pad) { return getHold(pad) & CButton::Z; } - static u32 getHoldY(u32 pad) { return getHold(pad) & CButton::Y; } - static u32 getHoldX(u32 pad) { return getHold(pad) & CButton::X; } + static u32 getHoldUp(u32 pad) { return getHold(pad) & PAD_BUTTON_UP; } + static u32 getHoldDown(u32 pad) { return getHold(pad) & PAD_BUTTON_DOWN; } + static u32 getHoldLeft(u32 pad) { return getHold(pad) & PAD_BUTTON_LEFT; } + static u32 getHoldRight(u32 pad) { return getHold(pad) & PAD_BUTTON_RIGHT; } + static u32 getHoldL(u32 pad) { return getHold(pad) & PAD_TRIGGER_L; } + static u32 getHoldR(u32 pad) { return getHold(pad) & PAD_TRIGGER_R; } + static u32 getHoldA(u32 pad) { return getHold(pad) & PAD_BUTTON_A; } + static u32 getHoldB(u32 pad) { return getHold(pad) & PAD_BUTTON_B; } + static u32 getHoldZ(u32 pad) { return getHold(pad) & PAD_TRIGGER_Z; } + static u32 getHoldY(u32 pad) { return getHold(pad) & PAD_BUTTON_Y; } + static u32 getHoldX(u32 pad) { return getHold(pad) & PAD_BUTTON_X; } static f32 getStickX(u32 pad) { return getCpadInfo(pad).mMainStickPosX; } static f32 getStickY(u32 pad) { return getCpadInfo(pad).mMainStickPosY; } static f32 getStickX3D(u32 pad) { return getCpadInfo(pad).mMainStickPosX; } @@ -60,8 +60,8 @@ class mDoCPd_c { static f32 getAnalogR(u32 pad) { return getCpadInfo(pad).mTriggerRight; } static f32 getAnalogL(u32 pad) { return getCpadInfo(pad).mTriggerLeft; } static BOOL isConnect(u32 pad) { return JUTGamePad::getPortStatus(pad) == 0; } - static void startMotorWave(u32 pad, void* param_2, JUTGamePad::CRumble::ERumble param_3, u32 param_4) { - m_gamePad[pad]->startMotorWave(param_2, param_3, param_4); + static void startMotorWave(u32 pad, void* data, JUTGamePad::CRumble::ERumble rumble, u32 length) { + m_gamePad[pad]->startMotorWave(data, rumble, length); } static void stopMotor(u32 pad) { m_gamePad[pad]->stopMotor(); } static void stopMotorWave(u32 pad) { m_gamePad[pad]->stopMotorWave(); } diff --git a/src/JSystem/JUtility/JUTException.cpp b/src/JSystem/JUtility/JUTException.cpp index 8b278a7bb60..f8fb1c0ac63 100644 --- a/src/JSystem/JUtility/JUTException.cpp +++ b/src/JSystem/JUtility/JUTException.cpp @@ -635,10 +635,10 @@ bool JUTException::readPad(u32* out_trigger, u32* out_button) { } while (ms < 0x32); if (mGamePad == (JUTGamePad*)0xffffffff) { - JUTGamePad gamePad0(JUTGamePad::Port_1); - JUTGamePad gamePad1(JUTGamePad::Port_2); - JUTGamePad gamePad2(JUTGamePad::Port_3); - JUTGamePad gamePad3(JUTGamePad::Port_4); + JUTGamePad gamePad0(JUTGamePad::EPort1); + JUTGamePad gamePad1(JUTGamePad::EPort2); + JUTGamePad gamePad2(JUTGamePad::EPort3); + JUTGamePad gamePad3(JUTGamePad::EPort4); JUTGamePad::read(); c3bcnt[0] = @@ -1150,4 +1150,4 @@ JUTException::~JUTException() {} /* ############################################################################################## */ /* 804508F8-80450900 000378 0008+00 0/0 3/3 0/0 .sdata None */ -SECTION_SDATA extern bool sAssertVisible = true; \ No newline at end of file +SECTION_SDATA extern bool sAssertVisible = true; diff --git a/src/JSystem/JUtility/JUTGamePad.cpp b/src/JSystem/JUtility/JUTGamePad.cpp index 44f7eb8747b..29f51daeb20 100644 --- a/src/JSystem/JUtility/JUTGamePad.cpp +++ b/src/JSystem/JUtility/JUTGamePad.cpp @@ -1,110 +1,8 @@ -// -// Generated By: dol2asm -// Translation Unit: JUTGamePad -// - #include "JSystem/JUtility/JUTGamePad.h" -#include "dol2asm.h" -#include "dolphin/os/OSResetSW.h" -#include "math.h" - -// -// Forward References: -// - -extern "C" void __ct__10JUTGamePadFQ210JUTGamePad8EPadPort(); -extern "C" void __dt__10JUTGamePadFv(); -extern "C" void initList__10JUTGamePadFv(); -extern "C" void init__10JUTGamePadFv(); -extern "C" void clear__10JUTGamePadFv(); -extern "C" void read__10JUTGamePadFv(); -extern "C" void assign__10JUTGamePadFv(); -extern "C" void checkResetCallback__10JUTGamePadFx(); -extern "C" void update__10JUTGamePadFv(); -extern "C" void checkResetSwitch__10JUTGamePadFv(); -extern "C" void clearForReset__10JUTGamePadFv(); -extern "C" void clear__Q210JUTGamePad7CButtonFv(); -extern "C" void update__Q210JUTGamePad7CButtonFPC9PADStatusUl(); -extern "C" void clear__Q210JUTGamePad6CStickFv(); -extern "C" void -update__Q210JUTGamePad6CStickFScScQ210JUTGamePad10EStickModeQ210JUTGamePad11EWhichStickUl(); -extern "C" void getButton__Q210JUTGamePad6CStickFUl(); -extern "C" void clear__Q210JUTGamePad7CRumbleFv(); -extern "C" void clear__Q210JUTGamePad7CRumbleFP10JUTGamePad(); -extern "C" void startMotor__Q210JUTGamePad7CRumbleFi(); -extern "C" void stopMotor__Q210JUTGamePad7CRumbleFib(); -extern "C" static void getNumBit__FPUci(); -extern "C" void update__Q210JUTGamePad7CRumbleFs(); -extern "C" void triggerPatternedRumble__Q210JUTGamePad7CRumbleFUl(); -extern "C" void startPatternedRumble__Q210JUTGamePad7CRumbleFPvQ310JUTGamePad7CRumble7ERumbleUl(); -extern "C" void stopPatternedRumble__Q210JUTGamePad7CRumbleFs(); -extern "C" void stopPatternedRumbleAtThePeriod__Q210JUTGamePad7CRumbleFv(); -extern "C" void getGamePad__10JUTGamePadFi(); -extern "C" void setEnabled__Q210JUTGamePad7CRumbleFUl(); -extern "C" void setRepeat__Q210JUTGamePad7CButtonFUlUlUl(); -extern "C" void recalibrate__10JUTGamePadFUl(); -extern "C" void checkCallback__19JUTGamePadLongPressFiUl(); -extern "C" void __sinit_JUTGamePad_cpp(); -extern "C" void func_802E1C54(void* _this); -extern "C" void __ct__Q210JUTGamePad6CStickFv(); -extern "C" void __ct__Q210JUTGamePad7CButtonFv(); -extern "C" void func_802E1D08(void* _this); -extern "C" u8 sChannelMask__Q210JUTGamePad7CRumble[16]; -extern "C" u8 mPadList__10JUTGamePad[12]; -extern "C" u8 mPadStatus__10JUTGamePad[48]; -extern "C" u8 mPadButton__10JUTGamePad[192]; -extern "C" u8 mPadMStick__10JUTGamePad[64]; -extern "C" u8 mPadSStick__10JUTGamePad[64]; -extern "C" u8 sPatternList__19JUTGamePadLongPress[12]; -extern "C" u32 sStickMode__10JUTGamePad; -extern "C" u32 sClampMode__10JUTGamePad; -extern "C" f32 sPressPoint__Q210JUTGamePad6CStick; -extern "C" f32 sReleasePoint__Q210JUTGamePad6CStick; -extern "C" u32 sResetPattern__Q210JUTGamePad13C3ButtonReset; -extern "C" u32 sResetMaskPattern__Q210JUTGamePad13C3ButtonReset; -extern "C" u8 mPadAssign__10JUTGamePad[4]; -extern "C" u8 sSuppressPadReset__10JUTGamePad[4]; -extern "C" u8 sAnalogMode__10JUTGamePad[4]; -extern "C" u8 sRumbleSupported__10JUTGamePad[4]; -extern "C" u8 mStatus__Q210JUTGamePad7CRumble[4]; -extern "C" u8 mEnabled__Q210JUTGamePad7CRumble[4]; -extern "C" u8 sCallback__Q210JUTGamePad13C3ButtonReset[4]; -extern "C" u8 sCallbackArg__Q210JUTGamePad13C3ButtonReset[4 + 4 /* padding */]; -extern "C" u8 sThreshold__Q210JUTGamePad13C3ButtonReset[4]; -extern "C" u8 sResetOccurredPort__Q210JUTGamePad13C3ButtonReset[4]; - -// -// External References: -// - -extern "C" void __dl__FPv(); -extern "C" void __ct__11JKRDisposerFv(); -extern "C" void __dt__11JKRDisposerFv(); -extern "C" void __ct__10JSUPtrLinkFPv(); -extern "C" void __dt__10JSUPtrLinkFv(); -extern "C" void __ct__10JSUPtrListFb(); -extern "C" void __dt__10JSUPtrListFv(); -extern "C" void initiate__10JSUPtrListFv(); -extern "C" void append__10JSUPtrListFP10JSUPtrLink(); -extern "C" void remove__10JSUPtrListFP10JSUPtrLink(); -extern "C" void __register_global_object(); -extern "C" void __construct_array(); -extern "C" void _savegpr_22(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_22(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); - -// -// Declarations: -// - -/* ############################################################################################## */ +#include + /* 803CC5F0-803CC600 029710 0010+00 3/3 0/0 0/0 .data sChannelMask__Q210JUTGamePad7CRumble */ -SECTION_DATA u32 JUTGamePad::CRumble::sChannelMask[4] = { +u32 JUTGamePad::CRumble::sChannelMask[4] = { PAD_CHAN0_BIT, PAD_CHAN1_BIT, PAD_CHAN2_BIT, @@ -112,7 +10,7 @@ SECTION_DATA u32 JUTGamePad::CRumble::sChannelMask[4] = { }; /* 803CC600-803CC610 029720 0010+00 2/2 0/0 0/0 .data channel_mask */ -SECTION_DATA static u32 channel_mask[4] = {0x80000000, 0x40000000, 0x20000000, 0x10000000}; +static u32 channel_mask[4] = {PAD_CHAN0_BIT, PAD_CHAN1_BIT, PAD_CHAN2_BIT, PAD_CHAN3_BIT}; /* 804343E4-804343F0 061104 000C+00 4/6 0/0 0/0 .bss mPadList__10JUTGamePad */ JSUList JUTGamePad::mPadList(false); @@ -143,7 +41,7 @@ JUTGamePad::JUTGamePad(EPadPort port) : mRumble(this), mLink(this) { JUTGamePad::~JUTGamePad() { if (mPortNum >= 0) { mPadAssign[mPortNum]--; - mPortNum = -1; + mPortNum = EPortInvalid; } mPadList.remove(&mLink); @@ -157,7 +55,6 @@ void JUTGamePad::initList() { } } -/* ############################################################################################## */ /* 804514D8-804514DC 0009D8 0004+00 2/2 0/0 0/0 .sbss sSuppressPadReset__10JUTGamePad */ u32 JUTGamePad::sSuppressPadReset; @@ -165,8 +62,8 @@ u32 JUTGamePad::sSuppressPadReset; s32 JUTGamePad::sAnalogMode; /* 802E0898-802E08D0 2DB1D8 0038+00 0/0 1/1 0/0 .text init__10JUTGamePadFv */ -s32 JUTGamePad::init() { - PADSetSpec(5); +BOOL JUTGamePad::init() { + PADSetSpec(PAD_SPEC_5); setAnalogMode(3); return PADInit(); } @@ -177,7 +74,6 @@ void JUTGamePad::clear() { field_0xa8 = 1; } -/* ############################################################################################## */ /* 804343F0-80434420 061110 0030+00 1/3 1/1 0/0 .bss mPadStatus__10JUTGamePad */ PADStatus JUTGamePad::mPadStatus[4]; @@ -185,59 +81,51 @@ PADStatus JUTGamePad::mPadStatus[4]; JUTGamePad::CButton JUTGamePad::mPadButton[4]; /* 804344E0-80434520 061200 0040+00 0/3 0/0 0/0 .bss mPadMStick__10JUTGamePad */ -#pragma push -#pragma force_active on JUTGamePad::CStick JUTGamePad::mPadMStick[4]; -#pragma pop /* 80434520-80434560 061240 0040+00 0/3 0/0 0/0 .bss mPadSStick__10JUTGamePad */ -#pragma push -#pragma force_active on JUTGamePad::CStick JUTGamePad::mPadSStick[4]; -#pragma pop /* 804508D8-804508DC 000358 0004+00 1/1 0/0 0/0 .sdata sStickMode__10JUTGamePad */ -SECTION_SDATA JUTGamePad::EStickMode JUTGamePad::sStickMode = STICK_MODE_1; +JUTGamePad::EStickMode JUTGamePad::sStickMode = EStickMode1; /* 804508DC-804508E0 00035C 0004+00 2/2 0/0 0/0 .sdata sClampMode__10JUTGamePad */ -SECTION_SDATA u32 JUTGamePad::sClampMode = 0x00000001; +int JUTGamePad::sClampMode = EClampStick; /* 804514E0-804514E4 0009E0 0004+00 1/1 2/2 0/0 .sbss sRumbleSupported__10JUTGamePad */ u32 JUTGamePad::sRumbleSupported; /* 802E08E4-802E0BBC 2DB224 02D8+00 0/0 2/2 0/0 .text read__10JUTGamePadFv */ -#ifdef NONMATCHING u32 JUTGamePad::read() { sRumbleSupported = PADRead(mPadStatus); switch (sClampMode) { - case 1: + case EClampStick: PADClamp(mPadStatus); break; - case 2: + case EClampCircle: PADClampCircle(mPadStatus); break; } - u32 mask = 0; + u32 reset_mask = 0; + u32 bittest; for (int i = 0; i < 4; i++) { - u32 mask_tmp = 0x80000000 >> i; + bittest = PAD_CHAN0_BIT >> i; + if (mPadStatus[i].error == 0) { - u32 m_stick = mPadMStick[i].update(mPadStatus[i].stick_x, mPadStatus[i].stick_y, - sStickMode, WS_MAIN_STICK, mPadButton[i].mButton) - << 0x18; - u32 s_stick = (mPadSStick[i].update(mPadStatus[i].substick_x, mPadStatus[i].substick_y, - sStickMode, WS_SUB_STICK, mPadButton[i].mButton) - << 0x10); - m_stick |= s_stick; - mPadButton[i].update(&mPadStatus[i], m_stick); + u32 stick_status; + stick_status = mPadMStick[i].update(mPadStatus[i].stick_x, mPadStatus[i].stick_y, sStickMode, EMainStick, mPadButton[i].mButton) << 0x18; + stick_status |= (mPadSStick[i].update(mPadStatus[i].substick_x, mPadStatus[i].substick_y, sStickMode, ESubStick, mPadButton[i].mButton) << 0x10); + + mPadButton[i].update(&mPadStatus[i], stick_status); } else if (mPadStatus[i].error == -1) { - u32 m_stick = mPadMStick[i].update(0, 0, sStickMode, WS_MAIN_STICK, 0); - u32 s_stick = mPadSStick[i].update(0, 0, sStickMode, WS_SUB_STICK, 0); + mPadMStick[i].update(0, 0, sStickMode, EMainStick, 0); + mPadSStick[i].update(0, 0, sStickMode, ESubStick, 0); mPadButton[i].update(NULL, 0); - if (!(sSuppressPadReset & mask_tmp)) { - mask |= mask_tmp; + if (!(sSuppressPadReset & bittest)) { + reset_mask |= bittest; } } else { mPadButton[i].mTrigger = 0; @@ -246,46 +134,40 @@ u32 JUTGamePad::read() { } } - JSUListIterator pad(mPadList.getFirst()); - for (; pad != mPadList.getEnd(); pad++) { - if (pad->getPadReplay() && pad->getPadReplay()->mActive) { + for (JSUListIterator pad(mPadList.getFirst()); pad != mPadList.getEnd(); pad++) { + if (pad->getPadReplay() != NULL && pad->getPadReplay()->isActive()) { PADStatus status; - pad->getPadReplay()->unk1(&status); - u32 m_stick = pad->mMainStick.update(status.stick_x, status.stick_y, sStickMode, - WS_MAIN_STICK, pad->mButton.mButton) - << 0x18; - u32 s_stick = pad->mSubStick.update(status.substick_x, status.substick_y, sStickMode, - WS_SUB_STICK, pad->mButton.mButton) - << 0x10; - m_stick |= s_stick; - pad->mButton.update(&status, m_stick); + pad->getPadReplay()->getStatus(&status); + + u32 stick_status; + stick_status = pad->mMainStick.update(status.stick_x, status.stick_y, sStickMode, + EMainStick, pad->mButton.mButton) << 0x18; + stick_status |= pad->mSubStick.update(status.substick_x, status.substick_y, sStickMode, + ESubStick, pad->mButton.mButton) << 0x10; + + pad->mButton.update(&status, stick_status); } else { - if (pad->mPortNum == -1) { + if (pad->mPortNum == EPortInvalid) { pad->assign(); } pad->update(); } - if (pad->getPadRecord() && pad->getPadRecord()->mActive) { - s32 portNum = pad->mPortNum; - if (portNum >= 0 && mPadStatus[portNum].error == 0) { - pad->getPadRecord()->unk2(); + if (pad->getPadRecord() != NULL && pad->getPadRecord()->isActive()) { + int port = pad->mPortNum; + if (port >= 0 && mPadStatus[port].error == 0) { + pad->getPadRecord()->write(&mPadStatus[port]); } } } - if (mask != 0) { - PADReset(mask); + if (reset_mask != 0) { + PADReset(reset_mask); } checkResetSwitch(); return sRumbleSupported; } -#else -u32 JUTGamePad::read() { - // NONMATCHING -} -#endif /* 802E0BBC-802E0C6C 2DB4FC 00B0+00 1/1 0/0 0/0 .text assign__10JUTGamePadFv */ void JUTGamePad::assign() { @@ -293,14 +175,13 @@ void JUTGamePad::assign() { if (mPadStatus[i].error == 0 && mPadAssign[i] == 0) { mPortNum = i; mPadAssign[i] = 1; - mPadButton[i].setRepeat(mButton.field_0x24, mButton.field_0x28, mButton.field_0x2c); + mPadButton[i].setRepeat(mButton.mRepeatMask, mButton.mRepeatDelay, mButton.mRepeatRate); mRumble.clear(this); - return; + break; } } } -/* ############################################################################################## */ /* 804514E4-804514E8 0009E4 0004+00 5/5 0/0 0/0 .sbss mStatus__Q210JUTGamePad7CRumble */ bool JUTGamePad::CRumble::mStatus[4]; @@ -315,12 +196,12 @@ callbackFn JUTGamePad::C3ButtonReset::sCallback; void* JUTGamePad::C3ButtonReset::sCallbackArg; /* 804514F8-80451500 0009F8 0008+00 2/2 0/0 0/0 .sbss sThreshold__Q210JUTGamePad13C3ButtonReset */ -OSTime JUTGamePad::C3ButtonReset::sThreshold = (OSTime)((OS_BUS_CLOCK / 4) / 60) * 30; +OSTime JUTGamePad::C3ButtonReset::sThreshold = (OSTime)(OS_TIMER_CLOCK / 60) * 30; -/* 80451500-80451504 -00001 0004+00 3/3 6/6 0/0 .sbss None */ /* 80451500 0001+00 data_80451500 None */ -/* 80451501 0003+00 data_80451501 None */ bool JUTGamePad::C3ButtonReset::sResetSwitchPushing; + +/* 80451501 0003+00 data_80451501 None */ bool JUTGamePad::C3ButtonReset::sResetOccurred; /* 80451504-80451508 000A04 0004+00 2/2 0/0 0/0 .sbss @@ -330,41 +211,34 @@ s32 JUTGamePad::C3ButtonReset::sResetOccurredPort; /* 802E0C6C-802E0CD8 2DB5AC 006C+00 1/1 1/1 0/0 .text checkResetCallback__10JUTGamePadFx */ void JUTGamePad::checkResetCallback(OSTime holdTime) { - if (holdTime < JUTGamePad::C3ButtonReset::sThreshold) { - return; - } - - JUTGamePad::C3ButtonReset::sResetOccurred = true; - JUTGamePad::C3ButtonReset::sResetOccurredPort = mPortNum; + if (holdTime >= JUTGamePad::C3ButtonReset::sThreshold) { + JUTGamePad::C3ButtonReset::sResetOccurred = true; + JUTGamePad::C3ButtonReset::sResetOccurredPort = mPortNum; - if (JUTGamePad::C3ButtonReset::sCallback != NULL) { - JUTGamePad::C3ButtonReset::sCallback(mPortNum, JUTGamePad::C3ButtonReset::sCallbackArg); + if (JUTGamePad::C3ButtonReset::sCallback != NULL) { + JUTGamePad::C3ButtonReset::sCallback(mPortNum, JUTGamePad::C3ButtonReset::sCallbackArg); + } } } -/* 8043456C-80434578 06128C 000C+00 1/2 0/0 0/0 .bss sPatternList__19JUTGamePadLongPress - */ -JSUList JUTGamePadLongPress::sPatternList(false); - /* 804508E0-804508E4 000360 0004+00 1/1 0/0 0/0 .sdata sPressPoint__Q210JUTGamePad6CStick */ -SECTION_SDATA f32 JUTGamePad::CStick::sPressPoint = 0.5f; +f32 JUTGamePad::CStick::sPressPoint = 0.5f; /* 804508E4-804508E8 000364 0004+00 1/1 0/0 0/0 .sdata sReleasePoint__Q210JUTGamePad6CStick */ -SECTION_SDATA f32 JUTGamePad::CStick::sReleasePoint = 0.25f; +f32 JUTGamePad::CStick::sReleasePoint = 0.25f; /* 804508E8-804508EC 000368 0004+00 1/1 0/0 0/0 .sdata * sResetPattern__Q210JUTGamePad13C3ButtonReset */ -SECTION_SDATA u32 JUTGamePad::C3ButtonReset::sResetPattern = 0x00001600; +u32 JUTGamePad::C3ButtonReset::sResetPattern = PAD_BUTTON_START | PAD_BUTTON_X | PAD_BUTTON_B; /* 804508EC-804508F0 00036C 0004+00 1/1 0/0 0/0 .sdata * sResetMaskPattern__Q210JUTGamePad13C3ButtonReset */ -SECTION_SDATA u32 JUTGamePad::C3ButtonReset::sResetMaskPattern = 0x0000FFFF; +u32 JUTGamePad::C3ButtonReset::sResetMaskPattern = 0x0000FFFF; /* 802E0CD8-802E0FA4 2DB618 02CC+00 2/2 0/0 0/0 .text update__10JUTGamePadFv */ -#ifdef NONMATCHING void JUTGamePad::update() { - if (mPortNum != -1) { + if (mPortNum != EPortInvalid) { if (mPortNum >= 0 && mPortNum < 4) { mButton = mPadButton[mPortNum]; mMainStick = mPadMStick[mPortNum]; @@ -372,32 +246,31 @@ void JUTGamePad::update() { mErrorStatus = mPadStatus[mPortNum].error; } - if (field_0xa8 == 0 || - (mButton.mButton & C3ButtonReset::sResetMaskPattern) != C3ButtonReset::sResetPattern) - { + if (field_0xa8 == 0 || C3ButtonReset::sResetPattern != (mButton.mButton & C3ButtonReset::sResetMaskPattern)) { mButtonReset.mReset = false; } else if (!JUTGamePad::C3ButtonReset::sResetOccurred) { if (mButtonReset.mReset == true) { - checkResetCallback(OSGetTime() - mResetTime); + OSTime hold_time = OSGetTime() - mResetHoldStartTime; + checkResetCallback(hold_time); } else { mButtonReset.mReset = true; - mResetTime = OSGetTime(); + mResetHoldStartTime = OSGetTime(); } } - JSUListIterator pad(JUTGamePadLongPress::sPatternList.getFirst()); - for (; pad != JUTGamePadLongPress::sPatternList.getEnd(); pad++) { - if (pad->mValid) { + for (JSUListIterator pad(JUTGamePadLongPress::sPatternList.getFirst()); pad != JUTGamePadLongPress::sPatternList.getEnd(); ++pad) { + if (pad->isValid()) { if (mPortNum >= 0 && mPortNum < 4) { if ((mButton.mButton & pad->getMaskPattern()) == pad->getPattern()) { - if (pad->field_0x20[mPortNum] == true) { - pad->checkCallback(mPortNum, OSGetTime() - pad->mTimer[mPortNum]); + if (pad->mLongPressStatus[mPortNum] == true) { + OSTime hold_time = OSGetTime() - pad->mStartHoldTime[mPortNum]; + pad->checkCallback(mPortNum, hold_time); } else { - pad->field_0x20[mPortNum] = true; - pad->mTimer[mPortNum] = OSGetTime(); + pad->mLongPressStatus[mPortNum] = true; + pad->mStartHoldTime[mPortNum] = OSGetTime(); } } else { - pad->field_0x20[mPortNum] = false; + pad->mLongPressStatus[mPortNum] = false; } } } @@ -408,11 +281,10 @@ void JUTGamePad::update() { } } } -#else -void JUTGamePad::update() { - // NONMATCHING -} -#endif + +/* 8043456C-80434578 06128C 000C+00 1/2 0/0 0/0 .bss sPatternList__19JUTGamePadLongPress + */ +JSUList JUTGamePadLongPress::sPatternList(false); /* 802E0FA4-802E1024 2DB8E4 0080+00 1/1 0/0 0/0 .text checkResetSwitch__10JUTGamePadFv */ void JUTGamePad::checkResetSwitch() { @@ -422,10 +294,10 @@ void JUTGamePad::checkResetSwitch() { } else { if (C3ButtonReset::sResetSwitchPushing == true) { C3ButtonReset::sResetOccurred = true; - C3ButtonReset::sResetOccurredPort = -1; + C3ButtonReset::sResetOccurredPort = EPortInvalid; if (C3ButtonReset::sCallback != NULL) { - C3ButtonReset::sCallback(-1, C3ButtonReset::sCallbackArg); + C3ButtonReset::sCallback(EPortInvalid, C3ButtonReset::sCallbackArg); } } C3ButtonReset::sResetSwitchPushing = false; @@ -449,16 +321,16 @@ void JUTGamePad::CButton::clear() { mAnalogB = 0; mAnalogL = 0; mAnalogR = 0; - field_0x1c = 0; - field_0x20 = 0; - field_0x24 = 0; - field_0x28 = 0; - field_0x2c = 0; + mRepeatCount = 0; + mRepeatStart = 0; + mRepeatMask = 0; + mRepeatDelay = 0; + mRepeatRate = 0; } /* 802E108C-802E121C 2DB9CC 0190+00 1/1 0/0 0/0 .text * update__Q210JUTGamePad7CButtonFPC9PADStatusUl */ -void JUTGamePad::CButton::update(PADStatus const* padStatus, u32 stickStatus) { +void JUTGamePad::CButton::update(const PADStatus* padStatus, u32 stickStatus) { u32 buttons; if (padStatus != NULL) { buttons = padStatus->button; @@ -469,32 +341,32 @@ void JUTGamePad::CButton::update(PADStatus const* padStatus, u32 stickStatus) { buttons = stickStatus | buttons; mRepeat = 0; - if (field_0x28 != 0 && field_0x24 != 0) { - u32 repeatButton = buttons & field_0x24; + if (mRepeatDelay != 0 && mRepeatMask != 0) { + u32 repeatButton = buttons & mRepeatMask; mRepeat = 0; if (repeatButton == 0) { - field_0x20 = 0; - field_0x1c = 0; - } else if (field_0x20 == repeatButton) { - field_0x1c++; + mRepeatStart = 0; + mRepeatCount = 0; + } else if (mRepeatStart == repeatButton) { + mRepeatCount++; - if (field_0x1c == field_0x28 || - (field_0x1c > field_0x28 && (field_0x1c - field_0x28) % field_0x2c == 0)) + if (mRepeatCount == mRepeatDelay || + (mRepeatCount > mRepeatDelay && (mRepeatCount - mRepeatDelay) % mRepeatRate == 0)) { mRepeat = repeatButton; } } else { - mRepeat = repeatButton & (field_0x20 ^ 0xFFFFFFFF); - field_0x20 = repeatButton; - field_0x1c = 0; + mRepeat = repeatButton & (mRepeatStart ^ 0xFFFFFFFF); + mRepeatStart = repeatButton; + mRepeatCount = 0; } } mTrigger = buttons & (buttons ^ mButton); mRelease = mButton & (buttons ^ mButton); mButton = buttons; - mRepeat |= (field_0x24 ^ 0xFFFFFFFF) & mTrigger; + mRepeat |= (mRepeatMask ^ 0xFFFFFFFF) & mTrigger; if (padStatus != NULL) { mAnalogA = padStatus->analog_a; @@ -522,29 +394,29 @@ void JUTGamePad::CStick::clear() { /* 802E1238-802E1500 2DBB78 02C8+00 1/1 0/0 0/0 .text * update__Q210JUTGamePad6CStickFScScQ210JUTGamePad10EStickModeQ210JUTGamePad11EWhichStickUl */ -u32 JUTGamePad::CStick::update(s8 x_val, s8 y_val, JUTGamePad::EStickMode mode, +u32 JUTGamePad::CStick::update(s8 x, s8 y, JUTGamePad::EStickMode mode, JUTGamePad::EWhichStick stick, u32 buttons) { s32 clamp; switch (sClampMode) { - case 1: - clamp = stick == WS_MAIN_STICK ? 54 : 42; + case EClampStick: + clamp = stick == EMainStick ? 54 : 42; break; - case 2: - clamp = stick == WS_MAIN_STICK ? 38 : 29; + case EClampCircle: + clamp = stick == EMainStick ? 38 : 29; break; default: - clamp = stick == WS_MAIN_STICK ? 69 : 57; + clamp = stick == EMainStick ? 69 : 57; break; } - field_0xe = x_val; - field_0xf = y_val; - mPosX = (f32)x_val / (f32)clamp; - mPosY = (f32)y_val / (f32)clamp; + mRawX = x; + mRawY = y; + mPosX = (f32)x / (f32)clamp; + mPosY = (f32)y / (f32)clamp; mValue = sqrtf((mPosX * mPosX) + (mPosY * mPosY)); if (mValue > 1.0f) { - if (mode == STICK_MODE_1) { + if (mode == EStickMode1) { mPosX /= mValue; mPosY /= mValue; } @@ -559,12 +431,12 @@ u32 JUTGamePad::CStick::update(s8 x_val, s8 y_val, JUTGamePad::EStickMode mode, mAngle = -0x4000; } } else { - mAngle = 10430.379f * atan2f(mPosX, -mPosY); + mAngle = (0x8000 / 3.1415926f) * atan2f(mPosX, -mPosY); } } - u32 buttonType = stick == WS_MAIN_STICK ? 0x18 : 0x10; - return getButton(buttons >> buttonType); + u32 button_shift = stick == EMainStick ? 0x18 : 0x10; + return getButton(buttons >> button_shift); } /* 802E1500-802E15B4 2DBE40 00B4+00 1/1 0/0 0/0 .text getButton__Q210JUTGamePad6CStickFUl @@ -573,19 +445,19 @@ u32 JUTGamePad::CStick::getButton(u32 buttons) { u32 button = buttons & 0xF; if (-sReleasePoint < mPosX && mPosX < sReleasePoint) { - button = button & 0xFFFFFFFC; + button = button & ~0x3; } else if (mPosX <= -sPressPoint) { - button = (button & 0xFFFFFFFD) | 1; + button = (button & ~0x2) | 1; } else if (mPosX >= sPressPoint) { - button = (button & 0xFFFFFFFE) | 2; + button = (button & ~0x1) | 2; } if (-sReleasePoint < mPosY && mPosY < sReleasePoint) { - button = button & 0xFFFFFFF3; + button = button & ~0xC; } else if (mPosY <= -sPressPoint) { - button = (button & 0xFFFFFFF7) | 4; + button = (button & ~0x8) | 4; } else if (mPosY >= sPressPoint) { - button = (button & 0xFFFFFFFB) | 8; + button = (button & ~0x4) | 8; } return button; @@ -593,10 +465,10 @@ u32 JUTGamePad::CStick::getButton(u32 buttons) { /* 802E15B4-802E15D8 2DBEF4 0024+00 1/1 0/0 0/0 .text clear__Q210JUTGamePad7CRumbleFv */ void JUTGamePad::CRumble::clear() { - field_0x0 = 0; - field_0x4 = 0; - field_0x8 = 0; - field_0xc = 0; + mFrame = 0; + mLength = 0; + mPattern = NULL; + mFrameCount = 0; field_0x10 = 0; mEnabled = (PAD_CHAN3_BIT | PAD_CHAN2_BIT | PAD_CHAN1_BIT | PAD_CHAN0_BIT); } @@ -612,98 +484,98 @@ void JUTGamePad::CRumble::clear(JUTGamePad* pad) { } /* 802E1634-802E168C 2DBF74 0058+00 1/1 0/0 0/0 .text startMotor__Q210JUTGamePad7CRumbleFi */ -void JUTGamePad::CRumble::startMotor(int portNo) { - if (isEnabledPort(portNo)) { - PADControlMotor(portNo, 1); - mStatus[portNo] = true; +void JUTGamePad::CRumble::startMotor(int port) { + if (isEnabledPort(port)) { + PADControlMotor(port, PAD_MOTOR_RUMBLE); + mStatus[port] = true; } } /* 802E168C-802E16F8 2DBFCC 006C+00 4/4 3/3 0/0 .text stopMotor__Q210JUTGamePad7CRumbleFib */ -void JUTGamePad::CRumble::stopMotor(int portNo, bool stop) { - if (isEnabledPort(portNo)) { - u8 command = stop ? 2 : 0; - PADControlMotor(portNo, command); - mStatus[portNo] = false; +void JUTGamePad::CRumble::stopMotor(int port, bool hard_stop) { + if (isEnabledPort(port)) { + u8 command = hard_stop ? PAD_MOTOR_STOP_HARD : PAD_MOTOR_STOP; + PADControlMotor(port, command); + mStatus[port] = false; } } /* 802E16F8-802E1720 2DC038 0028+00 1/1 0/0 0/0 .text getNumBit__FPUci */ -static bool getNumBit(u8* arr, int bitNo) { - u8 bit = (arr[bitNo >> 3] & (0x80 >> (bitNo & 7))); +static bool getNumBit(u8* pattern, int index) { + u8 bit = pattern[index >> 3] & (0x80 >> (index & 7)); return bit != 0; } /* 802E1720-802E18A4 2DC060 0184+00 1/1 0/0 0/0 .text update__Q210JUTGamePad7CRumbleFs */ -void JUTGamePad::CRumble::update(s16 portNo) { - if (isEnabledPort(portNo) == false) { - field_0x0 = 0; - field_0x4 = 0; - field_0x8 = NULL; - field_0xc = 0; +void JUTGamePad::CRumble::update(s16 port) { + if (isEnabledPort(port) == false) { + mFrame = 0; + mLength = 0; + mPattern = NULL; + mFrameCount = 0; field_0x10 = NULL; } - if (field_0x4 == 0) { + if (mLength == 0) { return; } - if (field_0x0 >= field_0x4) { - stopMotor(portNo, true); - field_0x4 = 0; - } else if (field_0xc == 0) { - if (mStatus[portNo] == 0) { - startMotor(portNo); + if (mFrame >= mLength) { + stopMotorHard(port); + mLength = 0; + } else if (mFrameCount == 0) { + if (mStatus[port] == 0) { + startMotor(port); } return; } else { - u32 temp = (field_0x0 / field_0xc); - bool numBit = getNumBit(field_0x8, field_0x0 - temp * field_0xc); - u8 status = mStatus[portNo] != false; - if (numBit && !status) { - startMotor(portNo); - } else if (!numBit) { - bool bit = false; + bool enabled = getNumBit(mPattern, mFrame % mFrameCount); + u8 status = mStatus[port] != false; + + if (enabled && !status) { + startMotor(port); + } else if (!enabled) { + bool hard_stop = false; if (field_0x10) { - u32 temp = (field_0x0 / field_0xc); - bit = getNumBit(field_0x10, field_0x0 - temp * field_0xc); + hard_stop = getNumBit(field_0x10, mFrame % mFrameCount); } if (status) { - stopMotor(portNo, bit); - } else if (bit) { - stopMotor(portNo, 1); + stopMotor(port, hard_stop); + } else if (hard_stop) { + stopMotorHard(port); } } } - field_0x0++; + mFrame++; } /* 802E18A4-802E18CC 2DC1E4 0028+00 1/1 0/0 0/0 .text * triggerPatternedRumble__Q210JUTGamePad7CRumbleFUl */ -void JUTGamePad::CRumble::triggerPatternedRumble(u32 param_0) { - if (field_0x8 != NULL && field_0xc != 0) { - field_0x4 = param_0; - field_0x0 = 0; +void JUTGamePad::CRumble::triggerPatternedRumble(u32 length) { + if (mPattern != NULL && mFrameCount != 0) { + mLength = length; + mFrame = 0; } } /* 802E18CC-802E1948 2DC20C 007C+00 0/0 2/2 0/0 .text * startPatternedRumble__Q210JUTGamePad7CRumbleFPvQ310JUTGamePad7CRumble7ERumbleUl */ -void JUTGamePad::CRumble::startPatternedRumble(void* param_0, JUTGamePad::CRumble::ERumble param_1, - u32 param_2) { - field_0xc = ((*(u8*)param_0) << 8) + *((u8*)param_0 + 1); - field_0x8 = (u8*)param_0 + 2; - switch (param_1) { +void JUTGamePad::CRumble::startPatternedRumble(void* data, JUTGamePad::CRumble::ERumble rumble, + u32 length) { + mFrameCount = ((*(u8*)data) << 8) + *((u8*)data + 1); + mPattern = (u8*)data + 2; + + switch (rumble) { case JUTGamePad::CRumble::VAL_0: - triggerPatternedRumble(field_0xc); + triggerPatternedRumble(mFrameCount); break; case JUTGamePad::CRumble::VAL_1: triggerPatternedRumble(-1); break; case JUTGamePad::CRumble::VAL_2: - triggerPatternedRumble(param_2); + triggerPatternedRumble(length); break; } } @@ -711,22 +583,22 @@ void JUTGamePad::CRumble::startPatternedRumble(void* param_0, JUTGamePad::CRumbl /* 802E1948-802E1978 2DC288 0030+00 1/1 3/3 0/0 .text * stopPatternedRumble__Q210JUTGamePad7CRumbleFs */ void JUTGamePad::CRumble::stopPatternedRumble(s16 port) { - field_0x4 = 0; - stopMotor(port, true); + mLength = 0; + stopMotorHard(port); } /* 802E1978-802E199C 2DC2B8 0024+00 0/0 1/1 0/0 .text * stopPatternedRumbleAtThePeriod__Q210JUTGamePad7CRumbleFv */ void JUTGamePad::CRumble::stopPatternedRumbleAtThePeriod() { - field_0x4 = (field_0x0 + field_0xc - 1) % field_0xc; + mLength = (mFrame + mFrameCount - 1) % mFrameCount; } /* 802E199C-802E19D8 2DC2DC 003C+00 1/1 1/1 0/0 .text getGamePad__10JUTGamePadFi */ -JUTGamePad* JUTGamePad::getGamePad(int padNo) { +JUTGamePad* JUTGamePad::getGamePad(int port) { JSUListIterator pad(mPadList.getFirst()); for (; pad != mPadList.getEnd(); pad++) { - if (padNo == pad->mPortNum) { + if (port == pad->mPortNum) { return pad.getObject(); } } @@ -748,16 +620,17 @@ void JUTGamePad::CRumble::setEnabled(u32 mask) { } } } + mEnabled = (mask & (PAD_CHAN3_BIT | PAD_CHAN2_BIT | PAD_CHAN1_BIT | PAD_CHAN0_BIT)); } /* 802E1A7C-802E1A98 2DC3BC 001C+00 1/1 0/0 0/0 .text setRepeat__Q210JUTGamePad7CButtonFUlUlUl */ -void JUTGamePad::CButton::setRepeat(u32 param_0, u32 param_1, u32 param_2) { - field_0x20 = 0; - field_0x1c = 0; - field_0x24 = param_0; - field_0x28 = param_1; - field_0x2c = param_2; +void JUTGamePad::CButton::setRepeat(u32 mask, u32 delay, u32 rate) { + mRepeatStart = 0; + mRepeatCount = 0; + mRepeatMask = mask; + mRepeatDelay = delay; + mRepeatRate = rate; } /* 802E1A98-802E1AFC 2DC3D8 0064+00 1/1 0/0 0/0 .text recalibrate__10JUTGamePadFUl */ @@ -772,8 +645,8 @@ bool JUTGamePad::recalibrate(u32 mask) { } /* 802E1AFC-802E1B60 2DC43C 0064+00 1/1 0/0 0/0 .text checkCallback__19JUTGamePadLongPressFiUl */ -void JUTGamePadLongPress::checkCallback(int port, u32 timer) { - if (port >= 0 && timer >= field_0x1c) { +void JUTGamePadLongPress::checkCallback(int port, u32 hold_time) { + if (port >= 0 && hold_time >= mThreshold) { field_0x11 = true; field_0x48[port] = true; @@ -781,4 +654,4 @@ void JUTGamePadLongPress::checkCallback(int port, u32 timer) { mCallback(port, this, field_0x50); } } -} \ No newline at end of file +} diff --git a/src/SSystem/SComponent/c_API_controller_pad.cpp b/src/SSystem/SComponent/c_API_controller_pad.cpp index 837be6e3a87..c8c29794a69 100644 --- a/src/SSystem/SComponent/c_API_controller_pad.cpp +++ b/src/SSystem/SComponent/c_API_controller_pad.cpp @@ -13,5 +13,5 @@ void cAPICPad_recalibrate() { /* 802632AC-802632C8 25DBEC 001C+00 0/0 3/3 1/1 .text cAPICPad_ANY_BUTTON__FUl */ u32 cAPICPad_ANY_BUTTON(u32 portNo) { - return mDoCPd_c::getTrig(portNo) & (CButton::A | CButton::B | CButton::START); -} \ No newline at end of file + return mDoCPd_c::getTrig(portNo) & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_START); +} diff --git a/src/d/d_menu_window.cpp b/src/d/d_menu_window.cpp index 502c051c392..19c91518441 100644 --- a/src/d/d_menu_window.cpp +++ b/src/d/d_menu_window.cpp @@ -1,8 +1,3 @@ -// -// Generated By: dol2asm -// Translation Unit: d/d_menu_window -// - #include "d/d_menu_window.h" #include "JSystem/JKernel/JKRExpHeap.h" #include "d/actor/d_a_player.h" @@ -19,266 +14,20 @@ #include "d/d_menu_skill.h" #include "d/d_menu_window_HIO.h" #include "d/d_meter2_info.h" +#include "d/d_meter2.h" #include "d/d_meter_HIO.h" #include "d/d_meter_map.h" #include "d/d_msg_object.h" -#include "dol2asm.h" #include "f_op/f_op_msg_mng.h" +#include "f_op/f_op_overlap_mng.h" #include "m_Do/m_Do_controller_pad.h" -// -// Forward References: -// - -extern "C" void dMw_UP_TRIGGER__Fv(); -extern "C" void dMw_DOWN_TRIGGER__Fv(); -extern "C" void dMw_LEFT_TRIGGER__Fv(); -extern "C" void dMw_RIGHT_TRIGGER__Fv(); -extern "C" void dMw_A_TRIGGER__Fv(); -extern "C" void dMw_B_TRIGGER__Fv(); -extern "C" void dMw_Z_TRIGGER__Fv(); -extern "C" void dMw_START_TRIGGER__Fv(); -extern "C" void dMw_onPauseWindow__Fv(); -extern "C" void dMw_offPauseWindow__Fv(); -extern "C" void dMw_onMenuRing__Fv(); -extern "C" void dMw_offMenuRing__Fv(); -extern "C" static bool dMw_isMenuRing__Fv(); -extern "C" void key_wait_init__5dMw_cFUc(); -extern "C" void ring_open_init__5dMw_cFUc(); -extern "C" void ring_move_init__5dMw_cFUc(); -extern "C" void ring_close_init__5dMw_cFUc(); -extern "C" void collect_open_init__5dMw_cFUc(); -extern "C" void collect_move_init__5dMw_cFUc(); -extern "C" void collect_close_init__5dMw_cFUc(); -extern "C" void fmap_open_init__5dMw_cFUc(); -extern "C" void fmap_move_init__5dMw_cFUc(); -extern "C" void fmap_close_init__5dMw_cFUc(); -extern "C" void dmap_open_init__5dMw_cFUc(); -extern "C" void dmap_move_init__5dMw_cFUc(); -extern "C" void dmap_close_init__5dMw_cFUc(); -extern "C" void collect_save_open_init__5dMw_cFUc(); -extern "C" void collect_save_move_init__5dMw_cFUc(); -extern "C" void collect_save_close_init__5dMw_cFUc(); -extern "C" void collect_option_open_init__5dMw_cFUc(); -extern "C" void collect_option_move_init__5dMw_cFUc(); -extern "C" void collect_option_close_init__5dMw_cFUc(); -extern "C" void collect_letter_open_init__5dMw_cFUc(); -extern "C" void collect_letter_move_init__5dMw_cFUc(); -extern "C" void collect_letter_close_init__5dMw_cFUc(); -extern "C" void collect_fishing_open_init__5dMw_cFUc(); -extern "C" void collect_fishing_move_init__5dMw_cFUc(); -extern "C" void collect_fishing_close_init__5dMw_cFUc(); -extern "C" void collect_skill_open_init__5dMw_cFUc(); -extern "C" void collect_skill_move_init__5dMw_cFUc(); -extern "C" void collect_skill_close_init__5dMw_cFUc(); -extern "C" void collect_insect_open_init__5dMw_cFUc(); -extern "C" void collect_insect_move_init__5dMw_cFUc(); -extern "C" void collect_insect_close_init__5dMw_cFUc(); -extern "C" void insect_open_init__5dMw_cFUc(); -extern "C" void insect_open2_init__5dMw_cFUc(); -extern "C" void insect_move_init__5dMw_cFUc(); -extern "C" void insect_close_init__5dMw_cFUc(); -extern "C" void key_wait_proc__5dMw_cFv(); -extern "C" void ring_open_proc__5dMw_cFv(); -extern "C" void ring_move_proc__5dMw_cFv(); -extern "C" void ring_close_proc__5dMw_cFv(); -extern "C" void collect_open_proc__5dMw_cFv(); -extern "C" void collect_move_proc__5dMw_cFv(); -extern "C" void collect_close_proc__5dMw_cFv(); -extern "C" void fmap_open_proc__5dMw_cFv(); -extern "C" void fmap_move_proc__5dMw_cFv(); -extern "C" void fmap_close_proc__5dMw_cFv(); -extern "C" void dmap_open_proc__5dMw_cFv(); -extern "C" void dmap_move_proc__5dMw_cFv(); -extern "C" void dmap_close_proc__5dMw_cFv(); -extern "C" void collect_save_open_proc__5dMw_cFv(); -extern "C" void collect_save_move_proc__5dMw_cFv(); -extern "C" void collect_save_close_proc__5dMw_cFv(); -extern "C" void collect_option_open_proc__5dMw_cFv(); -extern "C" void collect_option_move_proc__5dMw_cFv(); -extern "C" void collect_option_close_proc__5dMw_cFv(); -extern "C" void collect_letter_open_proc__5dMw_cFv(); -extern "C" void collect_letter_move_proc__5dMw_cFv(); -extern "C" void collect_letter_close_proc__5dMw_cFv(); -extern "C" void collect_fishing_open_proc__5dMw_cFv(); -extern "C" void collect_fishing_move_proc__5dMw_cFv(); -extern "C" void collect_fishing_close_proc__5dMw_cFv(); -extern "C" void collect_skill_open_proc__5dMw_cFv(); -extern "C" void collect_skill_move_proc__5dMw_cFv(); -extern "C" void collect_skill_close_proc__5dMw_cFv(); -extern "C" void collect_insect_open_proc__5dMw_cFv(); -extern "C" void collect_insect_move_proc__5dMw_cFv(); -extern "C" void collect_insect_close_proc__5dMw_cFv(); -extern "C" void insect_open_proc__5dMw_cFv(); -extern "C" void insect_open2_proc__5dMw_cFv(); -extern "C" void insect_move_proc__5dMw_cFv(); -extern "C" void insect_close_proc__5dMw_cFv(); -extern "C" void dMw_capture_create__5dMw_cFv(); -extern "C" void dMw_capture_delete__5dMw_cFv(); -extern "C" void dMw_ring_create__5dMw_cFUc(); -extern "C" void dMw_ring_delete__5dMw_cFv(); -extern "C" void dMw_collect_create__5dMw_cFv(); -extern "C" void dMw_collect_delete__5dMw_cFb(); -extern "C" void dMw_fmap_create__5dMw_cFv(); -extern "C" void dMw_fmap_delete__5dMw_cFb(); -extern "C" void dMw_dmap_create__5dMw_cFv(); -extern "C" void dMw_dmap_delete__5dMw_cFb(); -extern "C" void dMw_save_create__5dMw_cFv(); -extern "C" void dMw_save_delete__5dMw_cFv(); -extern "C" void dMw_option_create__5dMw_cFv(); -extern "C" void dMw_option_delete__5dMw_cFv(); -extern "C" void dMw_letter_create__5dMw_cFv(); -extern "C" void dMw_letter_delete__5dMw_cFv(); -extern "C" void dMw_fishing_create__5dMw_cFv(); -extern "C" void dMw_fishing_delete__5dMw_cFv(); -extern "C" void dMw_skill_create__5dMw_cFv(); -extern "C" void dMw_skill_delete__5dMw_cFv(); -extern "C" void dMw_insect_create__5dMw_cFUc(); -extern "C" void dMw_insect_delete__5dMw_cFv(); -extern "C" void dMw_onButtonBit__5dMw_cFUc(); -extern "C" void dMw_offButtonBit__5dMw_cFUc(); -extern "C" void dMw_isButtonBit__5dMw_cFUc(); -extern "C" void dMw_isPush_S_Button__5dMw_cFv(); -extern "C" void isPauseReady__5dMw_cFv(); -extern "C" void dMw_fade_out__5dMw_cFv(); -extern "C" void dMw_fade_in__5dMw_cFv(); -extern "C" void checkCStickTrigger__5dMw_cFv(); -extern "C" void isEventCheck__5dMw_cFv(); -extern "C" void markMemSize__5dMw_cFv(); -extern "C" void checkMemSize__5dMw_cFv(); -extern "C" void _create__5dMw_cFv(); -extern "C" void _execute__5dMw_cFv(); -extern "C" void _draw__5dMw_cFv(); -extern "C" void _delete__5dMw_cFv(); -extern "C" static void dMw_Draw__FP5dMw_c(); -extern "C" static void dMw_Execute__FP5dMw_c(); -extern "C" static bool dMw_IsDelete__FP5dMw_c(); -extern "C" static void dMw_Delete__FP5dMw_c(); -extern "C" static void dMw_Create__FP9msg_class(); -extern "C" void __sinit_d_menu_window_cpp(); -extern "C" void draw__20dDlst_MENU_CAPTURE_cFv(); -extern "C" void __dt__20dDlst_MENU_CAPTURE_cFv(); -extern "C" extern char const* const d_menu_d_menu_window__stringBase0; - -// -// External References: -// - -extern "C" void mDoExt_setCurrentHeap__FP7JKRHeap(); -extern "C" void mDoExt_getCurrentHeap__Fv(); -extern "C" void mDoExt_removeMesgFont__Fv(); -extern "C" void fopOvlpM_IsDoingReq__Fv(); -extern "C" void fopMsgM_setStageLayer__FPv(); -extern "C" void dComIfGp_setHeapLockFlag__FUc(); -extern "C" void dComIfGp_offHeapLockFlag__Fi(); -extern "C" void __ct__9STControlFssssffss(); -extern "C" void setWaitParm__9STControlFssssffss(); -extern "C" void checkTrigger__9STControlFv(); -extern "C" void set__12dDlst_list_cFRPP12dDlst_base_cRPP12dDlst_base_cP12dDlst_base_c(); -extern "C" void dCam_getBody__Fv(); -extern "C" void isKeyCheck__17dMenu_Collect2D_cFv(); -extern "C" bool isOutCheck__17dMenu_Collect2D_cFv(); -extern "C" void __ct__15dMenu_Collect_cFP10JKRExpHeapP9STControlP10CSTControl(); -extern "C" void _create__15dMenu_Collect_cFv(); -extern "C" void _delete__15dMenu_Collect_cFv(); -extern "C" void _move__15dMenu_Collect_cFv(); -extern "C" void draw__15dMenu_Collect_cFv(); -extern "C" void __ct__12dMenu_Dmap_cFP10JKRExpHeapP9STControlP10CSTControlUcUc(); -extern "C" void _move__12dMenu_Dmap_cFv(); -extern "C" void isOpen__12dMenu_Dmap_cFv(); -extern "C" void isClose__12dMenu_Dmap_cFv(); -extern "C" void _draw__12dMenu_Dmap_cFv(); -extern "C" void getNextStatus__12dMenu_Dmap_cFv(); -extern "C" void isSync__12dMenu_Dmap_cFv(); -extern "C" void __ct__15dMenu_Fishing_cFP10JKRExpHeapP9STControlP10CSTControl(); -extern "C" void _move__15dMenu_Fishing_cFv(); -extern "C" void isSync__15dMenu_Fishing_cFv(); -extern "C" void _open__15dMenu_Fishing_cFv(); -extern "C" void __ct__12dMenu_Fmap_cFP10JKRExpHeapP9STControlP10CSTControlUcUcUcffUc(); -extern "C" void _delete__12dMenu_Fmap_cFv(); -extern "C" void _move__12dMenu_Fmap_cFv(); -extern "C" void _draw__12dMenu_Fmap_cFv(); -extern "C" void getNextStatus__12dMenu_Fmap_cFPUc(); -extern "C" void isSync__12dMenu_Fmap_cFv(); -extern "C" void isOpen__12dMenu_Fmap_cFv(); -extern "C" void isClose__12dMenu_Fmap_cFv(); -extern "C" void getProcess__12dMenu_Fmap_cFv(); -extern "C" void getRegionCursor__12dMenu_Fmap_cFv(); -extern "C" void getStageCursor__12dMenu_Fmap_cFv(); -extern "C" void getStageTransX__12dMenu_Fmap_cFv(); -extern "C" void getStageTransZ__12dMenu_Fmap_cFv(); -extern "C" void __ct__14dMenu_Insect_cFP10JKRExpHeapP9STControlP10CSTControlUc(); -extern "C" void _move__14dMenu_Insect_cFv(); -extern "C" void isSync__14dMenu_Insect_cFv(); -extern "C" void _open__14dMenu_Insect_cFv(); -extern "C" void __ct__14dMenu_Letter_cFP10JKRExpHeapP9STControlP10CSTControl(); -extern "C" void _move__14dMenu_Letter_cFv(); -extern "C" void isSync__14dMenu_Letter_cFv(); -extern "C" void _open__14dMenu_Letter_cFv(); -extern "C" void __ct__14dMenu_Option_cFP10JKRArchiveP9STControl(); -extern "C" void _delete__14dMenu_Option_cFv(); -extern "C" void _move__14dMenu_Option_cFv(); -extern "C" void isSync__14dMenu_Option_cFv(); -extern "C" void _open__14dMenu_Option_cFv(); -extern "C" void __ct__12dMenu_Ring_cFP10JKRExpHeapP9STControlP10CSTControlUc(); -extern "C" void _create__12dMenu_Ring_cFv(); -extern "C" void _delete__12dMenu_Ring_cFv(); -extern "C" void _move__12dMenu_Ring_cFv(); -extern "C" void isOpen__12dMenu_Ring_cFv(); -extern "C" void isMoveEnd__12dMenu_Ring_cFv(); -extern "C" void isClose__12dMenu_Ring_cFv(); -extern "C" void __ct__12dMenu_save_cFv(); -extern "C" void _create__12dMenu_save_cFv(); -extern "C" void initialize__12dMenu_save_cFv(); -extern "C" void _open__12dMenu_save_cFv(); -extern "C" void _delete__12dMenu_save_cFv(); -extern "C" void _move__12dMenu_save_cFv(); -extern "C" void _draw2__12dMenu_save_cFv(); -extern "C" void __ct__13dMenu_Skill_cFP10JKRExpHeapP9STControlP10CSTControl(); -extern "C" void _move__13dMenu_Skill_cFv(); -extern "C" void isSync__13dMenu_Skill_cFv(); -extern "C" void _open__13dMenu_Skill_cFv(); -extern "C" void isEnableDispMapAndMapDispSizeTypeNo__11dMeterMap_cFv(); -extern "C" void setDispPosInsideFlg_SE_On__11dMeterMap_cFv(); -extern "C" void setDispPosOutsideFlg_SE_On__11dMeterMap_cFv(); -extern "C" void resetWarpStatus__13dMeter2Info_cFv(); -extern "C" void dMeter2Info_isItemOpenCheck__Fv(); -extern "C" void dMeter2Info_set2DVibration__Fv(); -extern "C" void dMeter2Info_set2DVibrationM__Fv(); -extern "C" void emphasisButtonDelete__9dMeter2_cFv(); -extern "C" void setKillMessageFlag__12dMsgObject_cFv(); -extern "C" void getStatus__12dMsgObject_cFv(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void freeAll__7JKRHeapFv(); -extern "C" void getTotalFreeSize__7JKRHeapFv(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void GXClearVtxDesc(); -extern "C" void GXPixModeSync(); -extern "C" void __ptmf_scall(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__12dDlst_base_c[3]; -extern "C" extern void* __vt__10CSTControl[4]; -extern "C" u8 m_cpadInfo__8mDoCPd_c[256]; -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 sManager__10JFWDisplay[4]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; - -// -// Declarations: -// - BOOL dMw_UP_TRIGGER() { - return (bool)mDoCPd_c::getTrigUp(PAD_1); + return mDoCPd_c::getTrigUp(PAD_1) != 0; } BOOL dMw_DOWN_TRIGGER() { - return (bool)mDoCPd_c::getTrigDown(PAD_1); + return mDoCPd_c::getTrigDown(PAD_1) != 0; } BOOL dMw_LEFT_TRIGGER() { @@ -298,421 +47,66 @@ BOOL dMw_RIGHT_TRIGGER() { } BOOL dMw_A_TRIGGER() { - return (bool)mDoCPd_c::getTrigA(PAD_1); + return mDoCPd_c::getTrigA(PAD_1) != 0; } BOOL dMw_B_TRIGGER() { - return (bool)mDoCPd_c::getTrigB(PAD_1); + return mDoCPd_c::getTrigB(PAD_1) != 0; } BOOL dMw_Z_TRIGGER() { - return (bool)mDoCPd_c::getTrigZ(PAD_1); + return mDoCPd_c::getTrigZ(PAD_1) != 0; } BOOL dMw_START_TRIGGER() { - return (bool)mDoCPd_c::getTrigStart(PAD_1); + return mDoCPd_c::getTrigStart(PAD_1) != 0; } void dMw_onPauseWindow() { dMw_c* menu_window = dMeter2Info_getMenuWindowClass(); - - if (menu_window) { + if (menu_window != NULL) { menu_window->onPauseWindow(); } } void dMw_offPauseWindow() { dMw_c* menu_window = dMeter2Info_getMenuWindowClass(); - - if (menu_window) { + if (menu_window != NULL) { menu_window->offPauseWindow(); } } void dMw_onMenuRing() { dMw_c* menu_window = dMeter2Info_getMenuWindowClass(); - - if (menu_window) { + if (menu_window != NULL) { menu_window->onShowFlag(); } } void dMw_offMenuRing() { dMw_c* menu_window = dMeter2Info_getMenuWindowClass(); - - if (menu_window) { + if (menu_window != NULL) { menu_window->offShowFlag(); } } static BOOL dMw_isMenuRing() { dMw_c* menu_window = dMeter2Info_getMenuWindowClass(); - - if (menu_window) { + if (menu_window != NULL) { return menu_window->isShowFlag(); } + return false; } -/* ############################################################################################## */ /* 803BE8F8-803BE904 01BA18 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { +static u8 cNullVec__6Z2Calc[12] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -/* 803BE904-803BE910 -00001 000C+00 0/1 0/0 0/0 .data @4276 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4276[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)key_wait_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE910-803BE91C -00001 000C+00 0/1 0/0 0/0 .data @4277 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4277[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)ring_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE91C-803BE928 -00001 000C+00 0/1 0/0 0/0 .data @4278 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4278[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)ring_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE928-803BE934 -00001 000C+00 0/1 0/0 0/0 .data @4279 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4279[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)ring_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE934-803BE940 -00001 000C+00 0/1 0/0 0/0 .data @4280 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4280[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE940-803BE94C -00001 000C+00 0/1 0/0 0/0 .data @4281 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4281[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE94C-803BE958 -00001 000C+00 0/1 0/0 0/0 .data @4282 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4282[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE958-803BE964 -00001 000C+00 0/1 0/0 0/0 .data @4283 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4283[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)fmap_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE964-803BE970 -00001 000C+00 0/1 0/0 0/0 .data @4284 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4284[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)fmap_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE970-803BE97C -00001 000C+00 0/1 0/0 0/0 .data @4285 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4285[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)fmap_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE97C-803BE988 -00001 000C+00 0/1 0/0 0/0 .data @4286 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4286[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)dmap_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE988-803BE994 -00001 000C+00 0/1 0/0 0/0 .data @4287 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4287[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)dmap_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE994-803BE9A0 -00001 000C+00 0/1 0/0 0/0 .data @4288 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4288[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)dmap_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9A0-803BE9AC -00001 000C+00 0/1 0/0 0/0 .data @4289 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4289[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_save_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9AC-803BE9B8 -00001 000C+00 0/1 0/0 0/0 .data @4290 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4290[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_save_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9B8-803BE9C4 -00001 000C+00 0/1 0/0 0/0 .data @4291 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4291[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_save_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9C4-803BE9D0 -00001 000C+00 0/1 0/0 0/0 .data @4292 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4292[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_option_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9D0-803BE9DC -00001 000C+00 0/1 0/0 0/0 .data @4293 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4293[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_option_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9DC-803BE9E8 -00001 000C+00 0/1 0/0 0/0 .data @4294 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4294[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_option_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9E8-803BE9F4 -00001 000C+00 0/1 0/0 0/0 .data @4295 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4295[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_letter_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BE9F4-803BEA00 -00001 000C+00 0/1 0/0 0/0 .data @4296 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4296[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_letter_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA00-803BEA0C -00001 000C+00 0/1 0/0 0/0 .data @4297 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4297[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_letter_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA0C-803BEA18 -00001 000C+00 0/1 0/0 0/0 .data @4298 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4298[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_fishing_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA18-803BEA24 -00001 000C+00 0/1 0/0 0/0 .data @4299 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4299[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_fishing_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA24-803BEA30 -00001 000C+00 0/1 0/0 0/0 .data @4300 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4300[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_fishing_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA30-803BEA3C -00001 000C+00 0/1 0/0 0/0 .data @4301 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4301[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_skill_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA3C-803BEA48 -00001 000C+00 0/1 0/0 0/0 .data @4302 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4302[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_skill_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA48-803BEA54 -00001 000C+00 0/1 0/0 0/0 .data @4303 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4303[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_skill_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA54-803BEA60 -00001 000C+00 0/1 0/0 0/0 .data @4304 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4304[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_insect_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA60-803BEA6C -00001 000C+00 0/1 0/0 0/0 .data @4305 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4305[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_insect_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA6C-803BEA78 -00001 000C+00 0/1 0/0 0/0 .data @4306 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4306[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_insect_close_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA78-803BEA84 -00001 000C+00 0/1 0/0 0/0 .data @4307 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4307[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_open_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA84-803BEA90 -00001 000C+00 0/1 0/0 0/0 .data @4308 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4308[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_open2_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA90-803BEA9C -00001 000C+00 0/1 0/0 0/0 .data @4309 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4309[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_move_init__5dMw_cFUc, -}; -#pragma pop - -/* 803BEA9C-803BEAA8 -00001 000C+00 0/1 0/0 0/0 .data @4310 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4310[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_close_init__5dMw_cFUc, -}; -#pragma pop - /* 803BEAA8-803BEC4C 01BBC8 01A4+00 1/2 0/0 0/0 .data init_proc */ typedef void (dMw_c::*initFunc)(u8); -SECTION_DATA initFunc init_proc[] = { +initFunc init_proc[] = { &dMw_c::key_wait_init, &dMw_c::ring_open_init, &dMw_c::ring_move_init, @@ -750,359 +144,9 @@ SECTION_DATA initFunc init_proc[] = { &dMw_c::insect_close_init, }; -/* 803BEC4C-803BEC58 -00001 000C+00 0/1 0/0 0/0 .data @4311 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4311[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)key_wait_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEC58-803BEC64 -00001 000C+00 0/1 0/0 0/0 .data @4312 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4312[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)ring_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEC64-803BEC70 -00001 000C+00 0/1 0/0 0/0 .data @4313 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4313[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)ring_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEC70-803BEC7C -00001 000C+00 0/1 0/0 0/0 .data @4314 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4314[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)ring_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEC7C-803BEC88 -00001 000C+00 0/1 0/0 0/0 .data @4315 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4315[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEC88-803BEC94 -00001 000C+00 0/1 0/0 0/0 .data @4316 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4316[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEC94-803BECA0 -00001 000C+00 0/1 0/0 0/0 .data @4317 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4317[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECA0-803BECAC -00001 000C+00 0/1 0/0 0/0 .data @4318 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4318[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)fmap_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECAC-803BECB8 -00001 000C+00 0/1 0/0 0/0 .data @4319 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4319[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)fmap_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECB8-803BECC4 -00001 000C+00 0/1 0/0 0/0 .data @4320 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4320[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)fmap_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECC4-803BECD0 -00001 000C+00 0/1 0/0 0/0 .data @4321 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4321[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)dmap_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECD0-803BECDC -00001 000C+00 0/1 0/0 0/0 .data @4322 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4322[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)dmap_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECDC-803BECE8 -00001 000C+00 0/1 0/0 0/0 .data @4323 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4323[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)dmap_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECE8-803BECF4 -00001 000C+00 0/1 0/0 0/0 .data @4324 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4324[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_save_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BECF4-803BED00 -00001 000C+00 0/1 0/0 0/0 .data @4325 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4325[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_save_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED00-803BED0C -00001 000C+00 0/1 0/0 0/0 .data @4326 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4326[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_save_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED0C-803BED18 -00001 000C+00 0/1 0/0 0/0 .data @4327 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4327[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_option_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED18-803BED24 -00001 000C+00 0/1 0/0 0/0 .data @4328 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4328[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_option_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED24-803BED30 -00001 000C+00 0/1 0/0 0/0 .data @4329 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4329[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_option_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED30-803BED3C -00001 000C+00 0/1 0/0 0/0 .data @4330 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4330[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_letter_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED3C-803BED48 -00001 000C+00 0/1 0/0 0/0 .data @4331 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4331[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_letter_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED48-803BED54 -00001 000C+00 0/1 0/0 0/0 .data @4332 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4332[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_letter_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED54-803BED60 -00001 000C+00 0/1 0/0 0/0 .data @4333 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4333[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_fishing_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED60-803BED6C -00001 000C+00 0/1 0/0 0/0 .data @4334 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4334[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_fishing_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED6C-803BED78 -00001 000C+00 0/1 0/0 0/0 .data @4335 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4335[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_fishing_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED78-803BED84 -00001 000C+00 0/1 0/0 0/0 .data @4336 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4336[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_skill_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED84-803BED90 -00001 000C+00 0/1 0/0 0/0 .data @4337 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4337[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_skill_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED90-803BED9C -00001 000C+00 0/1 0/0 0/0 .data @4338 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4338[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_skill_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BED9C-803BEDA8 -00001 000C+00 0/1 0/0 0/0 .data @4339 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4339[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_insect_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEDA8-803BEDB4 -00001 000C+00 0/1 0/0 0/0 .data @4340 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4340[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_insect_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEDB4-803BEDC0 -00001 000C+00 0/1 0/0 0/0 .data @4341 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4341[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)collect_insect_close_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEDC0-803BEDCC -00001 000C+00 0/1 0/0 0/0 .data @4342 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4342[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_open_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEDCC-803BEDD8 -00001 000C+00 0/1 0/0 0/0 .data @4343 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4343[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_open2_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEDD8-803BEDE4 -00001 000C+00 0/1 0/0 0/0 .data @4344 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4344[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_move_proc__5dMw_cFv, -}; -#pragma pop - -/* 803BEDE4-803BEDF0 -00001 000C+00 0/1 0/0 0/0 .data @4345 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4345[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)insect_close_proc__5dMw_cFv, -}; -#pragma pop - /* 803BEDF0-803BEF94 01BF10 01A4+00 1/2 0/0 0/0 .data move_proc */ typedef void (dMw_c::*procFunc)(); -SECTION_DATA procFunc move_proc[] = { +procFunc move_proc[] = { &dMw_c::key_wait_proc, &dMw_c::ring_open_proc, &dMw_c::ring_move_proc, @@ -1141,11 +185,11 @@ SECTION_DATA procFunc move_proc[] = { }; /* 801FA13C-801FA220 1F4A7C 00E4+00 2/0 0/0 0/0 .text key_wait_init__5dMw_cFUc */ -void dMw_c::key_wait_init(u8 menu_status) { +void dMw_c::key_wait_init(u8 i_proc) { dMeter2Info_setWindowStatus(0); dMw_capture_delete(); - switch (menu_status) { + switch (i_proc) { case COLLECT_CLOSE: dMw_fade_in(); dMw_collect_delete(true); @@ -1172,29 +216,20 @@ void dMw_c::key_wait_init(u8 menu_status) { dComIfGp_offHeapLockFlag(0); } -void dMw_c::ring_open_init(u8 param_0) { +void dMw_c::ring_open_init(u8) { dMeter2Info_setWindowStatus(2); } -void dMw_c::ring_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::ring_move_init(u8) {} -void dMw_c::ring_close_init(u8 param_0) { - /* empty function */ -} +void dMw_c::ring_close_init(u8) {} -/* ############################################################################################## */ -/* 804544C0-804544C4 002AC0 0004+00 2/2 0/0 0/0 .sdata2 @4152 */ -SECTION_SDATA2 static u8 lit_4152[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; +static f32 dummy() { + return 0.0f; +} /* 801FA244-801FA2D0 1F4B84 008C+00 1/0 0/0 0/0 .text collect_open_init__5dMw_cFUc */ -void dMw_c::collect_open_init(u8 param_0) { +void dMw_c::collect_open_init(u8) { field_0x144 = 3; dMeter2Info_setWindowStatus(3); Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_IN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); @@ -1204,8 +239,8 @@ void dMw_c::collect_open_init(u8 param_0) { } /* 801FA2D0-801FA46C 1F4C10 019C+00 2/0 0/0 0/0 .text collect_move_init__5dMw_cFUc */ -void dMw_c::collect_move_init(u8 menu_status) { - switch (menu_status) { +void dMw_c::collect_move_init(u8 i_proc) { + switch (i_proc) { case COLLECT_OPEN: dMw_fade_in(); dComIfGp_setHeapLockFlag(1); @@ -1257,7 +292,7 @@ void dMw_c::collect_move_init(u8 menu_status) { } /* 801FA46C-801FA538 1F4DAC 00CC+00 1/0 0/0 0/0 .text collect_close_init__5dMw_cFUc */ -void dMw_c::collect_close_init(u8 param_0) { +void dMw_c::collect_close_init(u8) { if (mpMenuCollect->getSubWindowOpenCheck() != 1 && mpMenuCollect->getSubWindowOpenCheck() != 2) { if (mpMenuCollect->getSubWindowOpenCheck() == 3 || @@ -1273,44 +308,37 @@ void dMw_c::collect_close_init(u8 param_0) { dMeter2Info_set2DVibrationM(); } } + dMw_fade_out(); } /* 801FA538-801FA55C 1F4E78 0024+00 1/0 0/0 0/0 .text fmap_open_init__5dMw_cFUc */ -void dMw_c::fmap_open_init(u8 param_0) { +void dMw_c::fmap_open_init(u8) { dMeter2Info_setWindowStatus(4); field_0x153 = 0; } /* 801FA55C-801FA560 1F4E9C 0004+00 1/0 0/0 0/0 .text fmap_move_init__5dMw_cFUc */ -void dMw_c::fmap_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::fmap_move_init(u8) {} /* 801FA560-801FA564 1F4EA0 0004+00 1/0 0/0 0/0 .text fmap_close_init__5dMw_cFUc */ -void dMw_c::fmap_close_init(u8 param_0) { - /* empty function */ -} +void dMw_c::fmap_close_init(u8) {} /* 801FA564-801FA588 1F4EA4 0024+00 1/0 0/0 0/0 .text dmap_open_init__5dMw_cFUc */ -void dMw_c::dmap_open_init(u8 param_0) { +void dMw_c::dmap_open_init(u8) { dMeter2Info_setWindowStatus(5); field_0x153 = 0; } /* 801FA588-801FA58C 1F4EC8 0004+00 1/0 0/0 0/0 .text dmap_move_init__5dMw_cFUc */ -void dMw_c::dmap_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::dmap_move_init(u8) {} /* 801FA58C-801FA590 1F4ECC 0004+00 1/0 0/0 0/0 .text dmap_close_init__5dMw_cFUc */ -void dMw_c::dmap_close_init(u8 param_0) { - /* empty function */ -} +void dMw_c::dmap_close_init(u8) {} /* 801FA590-801FA5E4 1F4ED0 0054+00 1/0 0/0 0/0 .text collect_save_open_init__5dMw_cFUc */ -void dMw_c::collect_save_open_init(u8 param_0) { +void dMw_c::collect_save_open_init(u8) { field_0x144 = 10; dMeter2Info_setWindowStatus(10); dMw_collect_delete(true); @@ -1319,19 +347,17 @@ void dMw_c::collect_save_open_init(u8 param_0) { /* 801FA5E4-801FA5E8 1F4F24 0004+00 1/0 0/0 0/0 .text collect_save_move_init__5dMw_cFUc */ -void dMw_c::collect_save_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::collect_save_move_init(u8) {} /* 801FA5E8-801FA608 1F4F28 0020+00 1/0 0/0 0/0 .text collect_save_close_init__5dMw_cFUc */ -void dMw_c::collect_save_close_init(u8 param_0) { +void dMw_c::collect_save_close_init(u8) { dMw_fade_out(); } /* 801FA608-801FA65C 1F4F48 0054+00 1/0 0/0 0/0 .text collect_option_open_init__5dMw_cFUc */ -void dMw_c::collect_option_open_init(u8 param_0) { +void dMw_c::collect_option_open_init(u8) { field_0x144 = 10; dMeter2Info_setWindowStatus(10); dMw_collect_delete(true); @@ -1340,18 +366,16 @@ void dMw_c::collect_option_open_init(u8 param_0) { /* 801FA65C-801FA660 1F4F9C 0004+00 1/0 0/0 0/0 .text collect_option_move_init__5dMw_cFUc */ -void dMw_c::collect_option_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::collect_option_move_init(u8) {} /* 801FA660-801FA680 1F4FA0 0020+00 1/0 0/0 0/0 .text collect_option_close_init__5dMw_cFUc */ -void dMw_c::collect_option_close_init(u8 param_0) { +void dMw_c::collect_option_close_init(u8) { dMw_fade_out(); } /* 801FA680-801FA6DC 1F4FC0 005C+00 1/0 0/0 0/0 .text collect_letter_open_init__5dMw_cFUc */ -void dMw_c::collect_letter_open_init(u8 param_0) { +void dMw_c::collect_letter_open_init(u8) { field_0x144 = 10; dMeter2Info_setWindowStatus(10); field_0x152 = 0; @@ -1361,19 +385,17 @@ void dMw_c::collect_letter_open_init(u8 param_0) { /* 801FA6DC-801FA6E0 1F501C 0004+00 1/0 0/0 0/0 .text collect_letter_move_init__5dMw_cFUc */ -void dMw_c::collect_letter_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::collect_letter_move_init(u8) {} /* 801FA6E0-801FA738 1F5020 0058+00 1/0 0/0 0/0 .text collect_letter_close_init__5dMw_cFUc */ -void dMw_c::collect_letter_close_init(u8 param_0) { +void dMw_c::collect_letter_close_init(u8) { Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_SUB_OUT, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); dMeter2Info_set2DVibration(); dMw_fade_out(); } /* 801FA738-801FA794 1F5078 005C+00 1/0 0/0 0/0 .text collect_fishing_open_init__5dMw_cFUc */ -void dMw_c::collect_fishing_open_init(u8 param_0) { +void dMw_c::collect_fishing_open_init(u8) { field_0x144 = 10; dMeter2Info_setWindowStatus(10); field_0x152 = 0; @@ -1382,12 +404,10 @@ void dMw_c::collect_fishing_open_init(u8 param_0) { } /* 801FA794-801FA798 1F50D4 0004+00 1/0 0/0 0/0 .text collect_fishing_move_init__5dMw_cFUc */ -void dMw_c::collect_fishing_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::collect_fishing_move_init(u8) {} /* 801FA798-801FA7F0 1F50D8 0058+00 1/0 0/0 0/0 .text collect_fishing_close_init__5dMw_cFUc */ -void dMw_c::collect_fishing_close_init(u8 param_0) { +void dMw_c::collect_fishing_close_init(u8) { Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_SUB_OUT, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); dMeter2Info_set2DVibration(); dMw_fade_out(); @@ -1395,7 +415,7 @@ void dMw_c::collect_fishing_close_init(u8 param_0) { /* 801FA7F0-801FA84C 1F5130 005C+00 1/0 0/0 0/0 .text collect_skill_open_init__5dMw_cFUc */ -void dMw_c::collect_skill_open_init(u8 param_0) { +void dMw_c::collect_skill_open_init(u8) { field_0x144 = 10; dMeter2Info_setWindowStatus(10); field_0x152 = 0; @@ -1405,13 +425,11 @@ void dMw_c::collect_skill_open_init(u8 param_0) { /* 801FA84C-801FA850 1F518C 0004+00 1/0 0/0 0/0 .text collect_skill_move_init__5dMw_cFUc */ -void dMw_c::collect_skill_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::collect_skill_move_init(u8) {} /* 801FA850-801FA8A8 1F5190 0058+00 1/0 0/0 0/0 .text collect_skill_close_init__5dMw_cFUc */ -void dMw_c::collect_skill_close_init(u8 param_0) { +void dMw_c::collect_skill_close_init(u8) { Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_SUB_OUT, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); dMeter2Info_set2DVibration(); dMw_fade_out(); @@ -1419,7 +437,7 @@ void dMw_c::collect_skill_close_init(u8 param_0) { /* 801FA8A8-801FA908 1F51E8 0060+00 1/0 0/0 0/0 .text collect_insect_open_init__5dMw_cFUc */ -void dMw_c::collect_insect_open_init(u8 param_0) { +void dMw_c::collect_insect_open_init(u8) { field_0x144 = 10; dMeter2Info_setWindowStatus(10); field_0x152 = 0; @@ -1429,19 +447,17 @@ void dMw_c::collect_insect_open_init(u8 param_0) { /* 801FA908-801FA90C 1F5248 0004+00 1/0 0/0 0/0 .text collect_insect_move_init__5dMw_cFUc */ -void dMw_c::collect_insect_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::collect_insect_move_init(u8) {} /* 801FA90C-801FA964 1F524C 0058+00 1/0 0/0 0/0 .text collect_insect_close_init__5dMw_cFUc */ -void dMw_c::collect_insect_close_init(u8 param_0) { +void dMw_c::collect_insect_close_init(u8) { Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_SUB_OUT, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); dMeter2Info_set2DVibration(); dMw_fade_out(); } /* 801FA964-801FA9E8 1F52A4 0084+00 1/0 0/0 0/0 .text insect_open_init__5dMw_cFUc */ -void dMw_c::insect_open_init(u8 param_0) { +void dMw_c::insect_open_init(u8) { field_0x144 = 10; dMeter2Info_setWindowStatus(10); Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_SUB_IN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); @@ -1450,17 +466,13 @@ void dMw_c::insect_open_init(u8 param_0) { } /* 801FA9E8-801FA9EC 1F5328 0004+00 1/0 0/0 0/0 .text insect_open2_init__5dMw_cFUc */ -void dMw_c::insect_open2_init(u8 param_0) { - /* empty function */ -} +void dMw_c::insect_open2_init(u8) {} /* 801FA9EC-801FA9F0 1F532C 0004+00 1/0 0/0 0/0 .text insect_move_init__5dMw_cFUc */ -void dMw_c::insect_move_init(u8 param_0) { - /* empty function */ -} +void dMw_c::insect_move_init(u8) {} /* 801FA9F0-801FAA48 1F5330 0058+00 1/0 0/0 0/0 .text insect_close_init__5dMw_cFUc */ -void dMw_c::insect_close_init(u8 param_0) { +void dMw_c::insect_close_init(u8) { Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_SUB_OUT, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); dMeter2Info_set2DVibration(); dMw_fade_out(); @@ -1468,13 +480,140 @@ void dMw_c::insect_close_init(u8 param_0) { /* 801FAA48-801FAFDC 1F5388 0594+00 1/0 0/0 0/0 .text key_wait_proc__5dMw_cFv */ void dMw_c::key_wait_proc() { - // NONMATCHING + if (field_0x14B != 0) { + switch (field_0x14B) { + case 1: + dMw_ring_create(2); + break; + case 2: + dMw_ring_create(0); + break; + case 3: + dMw_ring_create(3); + break; + case 4: + dMw_ring_create(1); + break; + default: + dMw_ring_create(0xFF); + break; + } + + mMenuProc = RING_OPEN; + field_0x14B = 0; + } + + if (mDoGph_gInf_c::getFader()->getStatus() == 1 && + (dComIfGp_isHeapLockFlag() == 0 || dComIfGp_isHeapLockFlag() == 5) && + dComIfGp_getMesgStatus() == 0 && + dCam_getBody()->Mode() != 7 && + dCam_getBody()->Mode() != 8 && + !dComIfGp_checkCameraAttentionStatus(0, 8) && + !dComIfGp_isPauseFlag() && + isPauseWindow() && + isPauseReady() && + !fopOvlpM_IsDoingReq() && + !mDoGph_gInf_c::isFade() && + !daPy_getPlayerActorClass()->checkBottleSwingMode() && + ((!mDoCPd_c::getTrigA(PAD_1) && !mDoCPd_c::getTrigB(PAD_1)) || dMeter2Info_getMapStatus() == 4) && + !isEventCheck() && + dComIfGp_getMesgStatus() == 0) + { + BOOL var_r29; + if (field_0x14A != 0) { + var_r29 = 0; + } + + if (dMeter2Info_getPauseStatus() == 8) { + dMsgObject_setKillMessageFlag(); + + if (dComIfGp_isHeapLockFlag() == 5) { + dMeter2Info_getMeterClass()->emphasisButtonDelete(); + } + + dComIfGp_setHeapLockFlag(1); + mMenuProc = INSECT_AGITHA_OPEN1; + dMeter2Info_resetPauseStatus(); + } else if ((dMw_START_TRIGGER() && !dMw_A_TRIGGER()) && + (dMeter2Info_getMapStatus() == 0 || dMeter2Info_getMapStatus() == 1) && + dMeter2Info_isWindowAccept(3) && + !dComIfGp_isEnableNextStage()) + { + dMsgObject_setKillMessageFlag(); + + if (dComIfGp_isHeapLockFlag() == 5) { + dMeter2Info_getMeterClass()->emphasisButtonDelete(); + } + + dComIfGp_setHeapLockFlag(1); + mMenuProc = COLLECT_OPEN; + } else if (dMeter2Info_getMapStatus() == 2 || + dMeter2Info_getMapStatus() == 3 || + dMeter2Info_getMapStatus() == 4 || + dMeter2Info_getMapStatus() == 5 || + dMeter2Info_getMapStatus() == 7 || + dMeter2Info_getMapStatus() == 8 || + dMeter2Info_getMapStatus() == 9 || + dMeter2Info_getMapStatus() == 6 || + g_fmapHIO.field_0x2f9) + { + dMsgObject_setKillMessageFlag(); + + if (dComIfGp_isHeapLockFlag() == 5) { + dMeter2Info_getMeterClass()->emphasisButtonDelete(); + } + + if (dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 0 || + dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 5 || + dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 3 || + dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 4 || + dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 6 || + dMeter2Info_getMapStatus() == 3 || + dMeter2Info_getMapStatus() == 4 || + dMeter2Info_getMapStatus() == 5 || + dMeter2Info_getMapStatus() == 7 || + dMeter2Info_getMapStatus() == 8 || + dMeter2Info_getMapStatus() == 9) + { + dComIfGp_setHeapLockFlag(2); + mMenuProc = FMAP_OPEN; + dMw_fmap_create(); + } else if (dStage_stagInfo_GetUpButton(dComIfGp_getStage()->getStagInfo()) == 1 || dMeter2Info_getMapStatus() == 6) { + dComIfGp_setHeapLockFlag(3); + mMenuProc = DMAP_OPEN; + dMw_dmap_create(); + } + } else if ((((dMw_UP_TRIGGER() || dMw_DOWN_TRIGGER()) && !dMw_LEFT_TRIGGER() && !dMw_RIGHT_TRIGGER()) || dMeter2Info_isMenuInForce(2) || dMeter2Info_isTouchKeyCheck(2)) && + dMeter2Info_isWindowAccept(2) && + (dMeter2Info_getMapStatus() == 0 || dMeter2Info_getMapStatus() == 1) && + dMeter2Info_isItemOpenCheck() && + !dComIfGp_isEnableNextStage()) + { + dMsgObject_setKillMessageFlag(); + + if (dComIfGp_isHeapLockFlag() == 5) { + dMeter2Info_getMeterClass()->emphasisButtonDelete(); + } + + if (dMw_DOWN_TRIGGER()) { + field_0x14B = 1; + dMw_ring_create(2); + } else { + field_0x14B = 2; + dMw_ring_create(0); + } + + mMenuProc = RING_OPEN; + field_0x14B = 0; + dComIfGp_setHeapLockFlag(1); + } + } } /* 801FAFDC-801FB01C 1F591C 0040+00 1/0 0/0 0/0 .text ring_open_proc__5dMw_cFv */ void dMw_c::ring_open_proc() { if (mpMenuRing->isOpen()) { - mMenuStatus = RING_MOVE; + mMenuProc = RING_MOVE; } } @@ -1482,7 +621,7 @@ void dMw_c::ring_open_proc() { void dMw_c::ring_move_proc() { mpMenuRing->_move(); if (mpMenuRing->isMoveEnd()) { - mMenuStatus = RING_CLOSE; + mMenuProc = RING_CLOSE; } } @@ -1490,7 +629,7 @@ void dMw_c::ring_move_proc() { void dMw_c::ring_close_proc() { if (mpMenuRing->isClose()) { dMeter2Info_offMenuInForce(2); - mMenuStatus = NO_MENU; + mMenuProc = NO_MENU; } } @@ -1502,21 +641,18 @@ void dMw_c::collect_open_proc() { } if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) { - mMenuStatus = COLLECT_MOVE; + mMenuProc = COLLECT_MOVE; } } /* 801FB110-801FB1A0 1F5A50 0090+00 1/0 0/0 0/0 .text collect_move_proc__5dMw_cFv */ void dMw_c::collect_move_proc() { if (mpMenuCollect->getSubWindowOpenCheck()) { - mMenuStatus = COLLECT_CLOSE; + mMenuProc = COLLECT_CLOSE; + } else if ((dMw_isPush_S_Button() && !mpMenuCollect->isKeyCheck()) || mpMenuCollect->isOutCheck()) { + mMenuProc = COLLECT_CLOSE; } else { - if ((dMw_isPush_S_Button() && !mpMenuCollect->isKeyCheck()) || mpMenuCollect->isOutCheck()) - { - mMenuStatus = COLLECT_CLOSE; - } else { - mpMenuCollect->_move(); - } + mpMenuCollect->_move(); } } @@ -1524,35 +660,20 @@ void dMw_c::collect_move_proc() { void dMw_c::collect_close_proc() { if (mDoGph_gInf_c::getFader()->getStatus() == 0) { if (mpMenuCollect->getSubWindowOpenCheck() == 1) { - mMenuStatus = SAVE_OPEN; - return; - } - - if (mpMenuCollect->getSubWindowOpenCheck() == 2) { - mMenuStatus = OPTIONS_OPEN; - return; - } - - if (mpMenuCollect->getSubWindowOpenCheck() == 3) { - mMenuStatus = LETTER_OPEN; - return; - } - - if (mpMenuCollect->getSubWindowOpenCheck() == 4) { - mMenuStatus = FISHING_OPEN; - return; - } - - if (mpMenuCollect->getSubWindowOpenCheck() == 5) { - mMenuStatus = SKILL_OPEN; - return; - } - - if (mpMenuCollect->getSubWindowOpenCheck() == 6) { - mMenuStatus = INSECT_OPEN; - return; + mMenuProc = SAVE_OPEN; + } else if (mpMenuCollect->getSubWindowOpenCheck() == 2) { + mMenuProc = OPTIONS_OPEN; + } else if (mpMenuCollect->getSubWindowOpenCheck() == 3) { + mMenuProc = LETTER_OPEN; + } else if (mpMenuCollect->getSubWindowOpenCheck() == 4) { + mMenuProc = FISHING_OPEN; + } else if (mpMenuCollect->getSubWindowOpenCheck() == 5) { + mMenuProc = SKILL_OPEN; + } else if (mpMenuCollect->getSubWindowOpenCheck() == 6) { + mMenuProc = INSECT_OPEN; + } else { + mMenuProc = NO_MENU; } - mMenuStatus = NO_MENU; } } @@ -1564,7 +685,7 @@ void dMw_c::fmap_open_proc() { } if (mpMenuFmap->isOpen()) { - mMenuStatus = FMAP_MOVE; + mMenuProc = FMAP_MOVE; } } @@ -1573,10 +694,10 @@ void dMw_c::fmap_move_proc() { mpMenuFmap->_move(); if (mDoGph_gInf_c::getFader()->getStatus() == 1) { - mMenuStatus = mpMenuFmap->getNextStatus(&field_0x14B); + mMenuProc = mpMenuFmap->getNextStatus(&field_0x14B); if (g_fmapHIO.field_0x2f9 != 0) { - mMenuStatus = FMAP_CLOSE; + mMenuProc = FMAP_CLOSE; Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_CLOSE_L, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } @@ -1594,7 +715,7 @@ void dMw_c::fmap_move_proc() { /* 801FB36C-801FB3AC 1F5CAC 0040+00 1/0 0/0 0/0 .text fmap_close_proc__5dMw_cFv */ void dMw_c::fmap_close_proc() { if (mpMenuFmap->isClose()) { - mMenuStatus = NO_MENU; + mMenuProc = NO_MENU; } } @@ -1606,7 +727,7 @@ void dMw_c::dmap_open_proc() { } if (mpMenuDmap->isOpen()) { - mMenuStatus = DMAP_MOVE; + mMenuProc = DMAP_MOVE; } } @@ -1622,14 +743,14 @@ void dMw_c::dmap_move_proc() { dMeter2Info_getMeterMapClass()->setDispPosOutsideFlg_SE_On(); } dMeter2Info_setMapKeyDirection(0x200); - mMenuStatus = DMAP_CLOSE; + mMenuProc = DMAP_CLOSE; mpMenuDmap->setInOutDir(3); Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_CLOSE_L, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (nextStatus == 2) { dMeter2Info_setMapStatus(0); dMeter2Info_setMapKeyDirection(0x400); - mMenuStatus = DMAP_CLOSE; + mMenuProc = DMAP_CLOSE; dMeter2Info_getMeterMapClass()->setDispPosOutsideFlg_SE_On(); mpMenuDmap->setInOutDir(1); Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_CLOSE_L, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, @@ -1641,7 +762,7 @@ void dMw_c::dmap_move_proc() { dMeter2Info_setMapStatus(0); } - mMenuStatus = DMAP_CLOSE; + mMenuProc = DMAP_CLOSE; mpMenuDmap->setInOutDir(2); Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_CLOSE_L, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); @@ -1653,7 +774,7 @@ void dMw_c::dmap_move_proc() { /* 801FB5DC-801FB61C 1F5F1C 0040+00 1/0 0/0 0/0 .text dmap_close_proc__5dMw_cFv */ void dMw_c::dmap_close_proc() { if (mpMenuDmap->isClose()) { - mMenuStatus = NO_MENU; + mMenuProc = NO_MENU; } } @@ -1664,7 +785,7 @@ void dMw_c::collect_save_open_proc() { } if (mpMenuSave->getSaveStatus() == 2) { - mMenuStatus = SAVE_MOVE; + mMenuProc = SAVE_MOVE; } } @@ -1675,7 +796,7 @@ void dMw_c::collect_save_move_proc() { } if (mpMenuSave->getSaveStatus() == 3 || mpMenuSave->getSaveStatus() == 4) { - mMenuStatus = SAVE_CLOSE; + mMenuProc = SAVE_CLOSE; } } @@ -1686,9 +807,9 @@ void dMw_c::collect_save_close_proc() { mpMenuSave->_move(); if (mpMenuSave->getSaveStatus() == 3) { - mMenuStatus = COLLECT_MOVE; + mMenuProc = COLLECT_MOVE; } else { - mMenuStatus = NO_MENU; + mMenuProc = NO_MENU; } } } @@ -1701,7 +822,7 @@ void dMw_c::collect_option_open_proc() { } if (mpMenuOption->getQuitStatus() == 2 && mDoGph_gInf_c::getFader()->getStatus() == 1) { - mMenuStatus = OPTIONS_MOVE; + mMenuProc = OPTIONS_MOVE; } } @@ -1713,17 +834,16 @@ void dMw_c::collect_option_move_proc() { } if (mpMenuOption->getQuitStatus() == 3) { - mMenuStatus = OPTIONS_CLOSE; + mMenuProc = OPTIONS_CLOSE; } } /* 801FB800-801FB81C 1F6140 001C+00 1/0 0/0 0/0 .text collect_option_close_proc__5dMw_cFv */ void dMw_c::collect_option_close_proc() { - if (mDoGph_gInf_c::getFader()->getStatus() != 0) { - return; + if (mDoGph_gInf_c::getFader()->getStatus() == 0) { + mMenuProc = COLLECT_MOVE; } - mMenuStatus = COLLECT_MOVE; } /* 801FB81C-801FB8AC 1F615C 0090+00 1/0 0/0 0/0 .text collect_letter_open_proc__5dMw_cFv @@ -1739,7 +859,7 @@ void dMw_c::collect_letter_open_proc() { } if (mpMenuLetter->getStatus() == 2 && field_0x152 == 1) { - mMenuStatus = LETTER_MOVE; + mMenuProc = LETTER_MOVE; field_0x152 = 0; } } @@ -1752,17 +872,16 @@ void dMw_c::collect_letter_move_proc() { } if (mpMenuLetter->getStatus() == 3) { - mMenuStatus = LETTER_CLOSE; + mMenuProc = LETTER_CLOSE; } } /* 801FB900-801FB91C 1F6240 001C+00 1/0 0/0 0/0 .text collect_letter_close_proc__5dMw_cFv */ void dMw_c::collect_letter_close_proc() { - if (mDoGph_gInf_c::getFader()->getStatus() != JUTFader::UNKSTATUS_0) { - return; + if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) { + mMenuProc = COLLECT_MOVE; } - mMenuStatus = COLLECT_MOVE; } /* 801FB91C-801FB9AC 1F625C 0090+00 1/0 0/0 0/0 .text collect_fishing_open_proc__5dMw_cFv @@ -1778,7 +897,7 @@ void dMw_c::collect_fishing_open_proc() { } if (mpMenuFishing->getStatus() == dMenu_Fishing_c::READY_MOVE && field_0x152 == 1) { - mMenuStatus = FISHING_MOVE; + mMenuProc = FISHING_MOVE; field_0x152 = 0; } } @@ -1791,16 +910,15 @@ void dMw_c::collect_fishing_move_proc() { } if (mpMenuFishing->getStatus() == dMenu_Fishing_c::READY_CLOSE) { - mMenuStatus = FISHING_CLOSE; + mMenuProc = FISHING_CLOSE; } } /* 801FBA00-801FBA1C 1F6340 001C+00 1/0 0/0 0/0 .text collect_fishing_close_proc__5dMw_cFv */ void dMw_c::collect_fishing_close_proc() { - if (mDoGph_gInf_c::getFader()->getStatus() != JUTFader::UNKSTATUS_0) { - return; + if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) { + mMenuProc = COLLECT_MOVE; } - mMenuStatus = COLLECT_MOVE; } /* 801FBA1C-801FBAAC 1F635C 0090+00 1/0 0/0 0/0 .text collect_skill_open_proc__5dMw_cFv @@ -1815,7 +933,7 @@ void dMw_c::collect_skill_open_proc() { } if (mpMenuSkill->getStatus() == 2 && field_0x152 == 1) { - mMenuStatus = SKILL_MOVE; + mMenuProc = SKILL_MOVE; field_0x152 = 0; } } @@ -1828,17 +946,16 @@ void dMw_c::collect_skill_move_proc() { } if (mpMenuSkill->getStatus() == 3) { - mMenuStatus = SKILL_CLOSE; + mMenuProc = SKILL_CLOSE; } } /* 801FBB00-801FBB1C 1F6440 001C+00 1/0 0/0 0/0 .text collect_skill_close_proc__5dMw_cFv */ void dMw_c::collect_skill_close_proc() { - if (mDoGph_gInf_c::getFader()->getStatus() != JUTFader::UNKSTATUS_0) { - return; + if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) { + mMenuProc = COLLECT_MOVE; } - mMenuStatus = COLLECT_MOVE; } /* 801FBB1C-801FBBAC 1F645C 0090+00 1/0 0/0 0/0 .text collect_insect_open_proc__5dMw_cFv @@ -1853,7 +970,7 @@ void dMw_c::collect_insect_open_proc() { } if (mpMenuInsect->getStatus() == 2 && field_0x152 == 1) { - mMenuStatus = INSECT_MOVE; + mMenuProc = INSECT_MOVE; field_0x152 = 0; } } @@ -1866,17 +983,16 @@ void dMw_c::collect_insect_move_proc() { } if (mpMenuInsect->getStatus() == 3) { - mMenuStatus = INSECT_CLOSE; + mMenuProc = INSECT_CLOSE; } } /* 801FBC00-801FBC1C 1F6540 001C+00 1/0 0/0 0/0 .text collect_insect_close_proc__5dMw_cFv */ void dMw_c::collect_insect_close_proc() { - if (mDoGph_gInf_c::getFader()->getStatus() != JUTFader::UNKSTATUS_0) { - return; + if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) { + mMenuProc = COLLECT_MOVE; } - mMenuStatus = COLLECT_MOVE; } /* 801FBC1C-801FBC78 1F655C 005C+00 1/0 0/0 0/0 .text insect_open_proc__5dMw_cFv */ @@ -1885,7 +1001,7 @@ void dMw_c::insect_open_proc() { field_0x152 = 0; dComIfGp_setHeapLockFlag(1); dMw_insect_create(1); - mMenuStatus = INSECT_AGITHA_OPEN2; + mMenuProc = INSECT_AGITHA_OPEN2; } } @@ -1900,7 +1016,7 @@ void dMw_c::insect_open2_proc() { } if (mpMenuInsect->getStatus() == 2 && field_0x152 == 1) { - mMenuStatus = INSECT_AGITHA_MOVE; + mMenuProc = INSECT_AGITHA_MOVE; field_0x152 = 0; } } @@ -1913,60 +1029,23 @@ void dMw_c::insect_move_proc() { } if (mpMenuInsect->getStatus() == 3) { - mMenuStatus = INSECT_AGITHA_CLOSE; + mMenuProc = INSECT_AGITHA_CLOSE; } } } /* 801FBD64-801FBD80 1F66A4 001C+00 1/0 0/0 0/0 .text insect_close_proc__5dMw_cFv */ void dMw_c::insect_close_proc() { - if (mDoGph_gInf_c::getFader()->getStatus() != JUTFader::UNKSTATUS_0) { - return; + if (mDoGph_gInf_c::getFader()->getStatus() == JUTFader::UNKSTATUS_0) { + mMenuProc = NO_MENU; } - mMenuStatus = NO_MENU; } -/* ############################################################################################## */ -/* 803BF080-803BF094 -00001 0014+00 1/0 0/0 0/0 .data l_dMw_Method */ -static dMw_Method l_dMw_Method[5] = { - (dMw_Method)dMw_Create, dMw_Delete, dMw_Execute, dMw_IsDelete, dMw_Draw, -}; - -/* 803BF094-803BF0D4 -00001 0028+18 0/0 0/0 1/0 .data g_profile_MENUWINDOW */ -SECTION_DATA extern void* g_profile_MENUWINDOW[10 + 6 /* padding */] = { - (void*)0xFFFFFFFD, - (void*)0x000CFFFD, - (void*)0x03140000, - (void*)&g_fpcLf_Method, - (void*)0x00000158, - (void*)NULL, - (void*)NULL, - (void*)&g_fopMsg_Method, - (void*)0x02FF0000, - (void*)&l_dMw_Method, - /* padding */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, -}; - -/* 803BF0D4-803BF0E8 01C1F4 0010+04 11/11 0/0 0/0 .data __vt__20dDlst_MENU_CAPTURE_c */ -SECTION_DATA extern void* __vt__20dDlst_MENU_CAPTURE_c[4 + 1 /* padding */] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)draw__20dDlst_MENU_CAPTURE_cFv, - (void*)__dt__20dDlst_MENU_CAPTURE_cFv, - /* padding */ - NULL, -}; - /* 801FBD80-801FBE14 1F66C0 0094+00 2/2 0/0 0/0 .text dMw_capture_create__5dMw_cFv */ void dMw_c::dMw_capture_create() { if (!dComIfGp_isPauseFlag() && mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(1996, mpCapture != 0); mpCapture->setCaptureFlag(); } } @@ -1984,15 +1063,17 @@ void dMw_c::dMw_capture_delete() { } /* 801FBE94-801FBF60 1F67D4 00CC+00 1/1 0/0 0/0 .text dMw_ring_create__5dMw_cFUc */ -void dMw_c::dMw_ring_create(u8 param_0) { +void dMw_c::dMw_ring_create(u8 i_origin) { markMemSize(); dComIfGp_setHeapLockFlag(1); - mpMenuRing = new dMenu_Ring_c(mpHeap, mpStick, mpCStick, param_0); + mpMenuRing = new dMenu_Ring_c(mpHeap, mpStick, mpCStick, i_origin); + JUT_ASSERT(2038, mpMenuRing != 0); mpMenuRing->_create(); if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2043, mpCapture != 0); } mpCapture->setCaptureFlag(); @@ -2020,6 +1101,7 @@ void dMw_c::dMw_collect_create() { markMemSize(); mpMenuCollect = new dMenu_Collect_c(mpHeap, mpStick, mpCStick); + JUT_ASSERT(2093, mpMenuCollect != 0); mpMenuCollect->_create(); if (mDoCPd_c::getHoldLockL(PAD_1)) { @@ -2030,7 +1112,7 @@ void dMw_c::dMw_collect_create() { } /* 801FC090-801FC0FC 1F69D0 006C+00 8/8 0/0 0/0 .text dMw_collect_delete__5dMw_cFb */ -bool dMw_c::dMw_collect_delete(bool param_0) { +bool dMw_c::dMw_collect_delete(bool) { if (mpMenuCollect != NULL) { mpMenuCollect->_delete(); delete mpMenuCollect; @@ -2062,9 +1144,11 @@ void dMw_c::dMw_fmap_create() { mpMenuFmap = new dMenu_Fmap_c(mpHeap, mpStick, mpCStick, mFmapProcess, mFmapRegionCursor, mFmapStageCursor, mFmapStageTransX, mFmapStageTransZ, tmp); + JUT_ASSERT(2194, mpMenuFmap != 0); if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2200, mpCapture != 0); } mpCapture->setCaptureFlag(); @@ -2105,6 +1189,7 @@ void dMw_c::dMw_dmap_create() { if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2294, mpCapture != 0); } mpCapture->setCaptureFlag(); @@ -2121,6 +1206,7 @@ void dMw_c::dMw_dmap_create() { } mpMenuDmap = new dMenu_Dmap_c(mpHeap, mpStick, mpCStick, field_0x14C, tmp); + JUT_ASSERT(2314, mpMenuDmap != 0); dMeter2Info_resetWarpStatus(); } @@ -2152,12 +1238,15 @@ void dMw_c::dMw_save_create() { markMemSize(); mpMenuSave = new dMenu_save_c(); + JUT_ASSERT(2365, mpMenuSave != 0); + mpMenuSave->setUseType(1); mpMenuSave->_create(); mpMenuSave->initialize(); if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2373, mpCapture != 0); } } @@ -2183,9 +1272,11 @@ void dMw_c::dMw_option_create() { markMemSize(); mpMenuOption = new dMenu_Option_c(dComIfGp_getCollectResArchive(), mpStick); + JUT_ASSERT(2415, mpMenuOption != 0); if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2420, mpCapture != 0); } } @@ -2214,9 +1305,11 @@ void dMw_c::dMw_letter_create() { markMemSize(); mpMenuLetter = new dMenu_Letter_c(mpHeap, mpStick, mpCStick); + JUT_ASSERT(2463, mpMenuLetter != 0); if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2467, mpCapture != 0); } } @@ -2244,9 +1337,11 @@ void dMw_c::dMw_fishing_create() { markMemSize(); mpMenuFishing = new dMenu_Fishing_c(mpHeap, mpStick, mpCStick); + JUT_ASSERT(2509, mpMenuFishing != 0); if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2513, mpCapture != 0); } } @@ -2274,8 +1369,11 @@ void dMw_c::dMw_skill_create() { markMemSize(); mpMenuSkill = new dMenu_Skill_c(mpHeap, mpStick, mpCStick); + JUT_ASSERT(2555, mpMenuSkill != 0); + if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2559, mpCapture != 0); } } @@ -2303,8 +1401,11 @@ void dMw_c::dMw_insect_create(u8 param_0) { markMemSize(); mpMenuInsect = new dMenu_Insect_c(mpHeap, mpStick, mpCStick, param_0); + JUT_ASSERT(2601, mpMenuInsect != 0); + if (mpCapture == NULL) { mpCapture = new dDlst_MENU_CAPTURE_c(); + JUT_ASSERT(2605, mpCapture != 0); } } @@ -2328,18 +1429,18 @@ bool dMw_c::dMw_insect_delete() { } /* 801FCCEC-801FCCFC 1F762C 0010+00 1/1 0/0 0/0 .text dMw_onButtonBit__5dMw_cFUc */ -void dMw_c::dMw_onButtonBit(u8 flags) { - mButtons |= flags; +void dMw_c::dMw_onButtonBit(u8 i_bit) { + mButtonBits |= i_bit; } /* 801FCCFC-801FCD0C 1F763C 0010+00 1/1 0/0 0/0 .text dMw_offButtonBit__5dMw_cFUc */ -void dMw_c::dMw_offButtonBit(u8 flags) { - mButtons &= ~flags; +void dMw_c::dMw_offButtonBit(u8 i_bit) { + mButtonBits &= ~i_bit; } /* 801FCD0C-801FCD24 1F764C 0018+00 1/1 0/0 0/0 .text dMw_isButtonBit__5dMw_cFUc */ -BOOL dMw_c::dMw_isButtonBit(u8 flags) { - return (mButtons & flags) ? 1 : 0; +BOOL dMw_c::dMw_isButtonBit(u8 i_bit) { + return (mButtonBits & i_bit) ? TRUE : FALSE; } /* 801FCD24-801FCDD8 1F7664 00B4+00 1/1 0/0 0/0 .text dMw_isPush_S_Button__5dMw_cFv */ @@ -2354,6 +1455,7 @@ BOOL dMw_c::dMw_isPush_S_Button() { } } } + return false; } @@ -2362,6 +1464,7 @@ bool dMw_c::isPauseReady() { if (dComIfGp_getEvent().checkCompulsory() || dComIfGs_getLife() == 0) { return false; } + return true; } @@ -2398,24 +1501,25 @@ int dMw_c::checkCStickTrigger() { bool dMw_c::isEventCheck() { if (field_0x151 != 0) { return true; - } else { - if (dMeter2Info_getMapStatus() == 4 && field_0x148 > 0) { - field_0x148 = 0; - } + } - if (dComIfGp_event_runCheck()) { - if (!dMsgObject_isTalkNowCheck() && - (dMeter2Info_getMapStatus() == 4 || dMeter2Info_getMapStatus() == 5 || - dMeter2Info_getMapStatus() == 7 || dMeter2Info_getMapStatus() == 8 || - dMeter2Info_getMapStatus() == 9 || dMeter2Info_getMapStatus() == 6 || - dMeter2Info_getMapStatus() == 3 || dMeter2Info_isMenuInForce(2) || - dMeter2Info_getPauseStatus() == 8)) - { - return false; - } - return true; + if (dMeter2Info_getMapStatus() == 4 && field_0x148 > 0) { + field_0x148 = 0; + } + + if (dComIfGp_event_runCheck()) { + if (!dMsgObject_isTalkNowCheck() && + (dMeter2Info_getMapStatus() == 4 || dMeter2Info_getMapStatus() == 5 || + dMeter2Info_getMapStatus() == 7 || dMeter2Info_getMapStatus() == 8 || + dMeter2Info_getMapStatus() == 9 || dMeter2Info_getMapStatus() == 6 || + dMeter2Info_getMapStatus() == 3 || dMeter2Info_isMenuInForce(2) || + dMeter2Info_getPauseStatus() == 8)) + { + return false; } + return true; } + return field_0x148 > 0; } @@ -2423,16 +1527,21 @@ bool dMw_c::isEventCheck() { void dMw_c::markMemSize() { if (mMemSize == 0) { mMemSize = mpHeap->getTotalFreeSize(); + OS_REPORT("memory marking ===> %d\n", mMemSize); } } /* 801FD0D4-801FD140 1F7A14 006C+00 10/10 0/0 0/0 .text checkMemSize__5dMw_cFv */ void dMw_c::checkMemSize() { if (mMemSize > 0) { - s32 diff = mpHeap->getTotalFreeSize() - mMemSize; + s32 now_size = mpHeap->getTotalFreeSize(); + s32 diff = now_size - mMemSize; if (diff < 0) { diff *= -1; } + + OS_REPORT("memory check ===> diff ==> %d, start ==> %d, now ==> %d\n", diff, mMemSize, now_size); + if (diff > 0x20) { OSReport_Error("memory free error!!\n"); } @@ -2445,13 +1554,15 @@ int dMw_c::_create() { mpHeap = dComIfGp_getExpHeap2D(); mpStick = new STControl(5, 2, 1, 1, 0.9f, 0.5f, 0, 0x800); + JUT_ASSERT(2967, mpStick != 0); mpStick->setFirstWaitTime(8); mpCStick = new CSTControl(5, 2, 3, 2, 0.9f, 0.5f, 0, 0x2000); + JUT_ASSERT(2976, mpCStick != 0); mpCStick->setWaitParm(5, 2, 3, 2, 0.9f, 0.5f, 0, 0x2000); - mButtons = 0; - mMenuStatus = NO_MENU; + mButtonBits = 0; + mMenuProc = NO_MENU; mShowFlag = 1; field_0x148 = 0; field_0x14C = 0; @@ -2461,9 +1572,8 @@ int dMw_c::_create() { mFmapStageCursor = 0; field_0x151 = 0; field_0x152 = 0; - f32 tmp = FLOAT_LABEL(lit_4152); - mFmapStageTransX = tmp; - mFmapStageTransZ = tmp; + mFmapStageTransX = 0.0f; + mFmapStageTransZ = 0.0f; field_0x153 = 0; onPauseWindow(); field_0x149 = 0; @@ -2494,8 +1604,8 @@ int dMw_c::_execute() { field_0x151--; } - JKRHeap* old_heap = mDoExt_setCurrentHeap(mpHeap); - u8 old_proc = mMenuStatus; + JKRHeap* prev_heap = mDoExt_setCurrentHeap(mpHeap); + u8 prev_proc = mMenuProc; mpStick->checkTrigger(); if (dMw_isMenuRing()) { @@ -2511,9 +1621,9 @@ int dMw_c::_execute() { field_0x148 = 0; } - (this->*move_proc[mMenuStatus])(); - if (mMenuStatus != old_proc) { - (this->*init_proc[mMenuStatus])(old_proc); + (this->*move_proc[mMenuProc])(); + if (mMenuProc != prev_proc) { + (this->*init_proc[mMenuProc])(prev_proc); } if (!mDoCPd_c::getHoldLockL(PAD_1) && dMw_isButtonBit(1)) { @@ -2524,11 +1634,10 @@ int dMw_c::_execute() { dMw_offButtonBit(2); } - mDoExt_setCurrentHeap(old_heap); + mDoExt_setCurrentHeap(prev_heap); return 1; } - /* 801FD450-801FD67C 1F7D90 022C+00 1/1 0/0 0/0 .text _draw__5dMw_cFv */ int dMw_c::_draw() { if (mpCapture != NULL && mpCapture->checkDraw() && mpCapture->getAlpha() != 0) { @@ -2539,7 +1648,7 @@ int dMw_c::_draw() { } } - if (dComIfGp_isPauseFlag() == 1) { + if (dComIfGp_isPauseFlag() == true) { if (dMeter2Info_getWindowStatus() == 3) { if (mpMenuCollect != NULL) { mpMenuCollect->draw(); @@ -2636,60 +1745,60 @@ int dMw_c::_delete() { } /* 801FD840-801FD860 1F8180 0020+00 1/0 0/0 0/0 .text dMw_Draw__FP5dMw_c */ -static int dMw_Draw(dMw_c* p_menu) { - return p_menu->_draw(); +static int dMw_Draw(dMw_c* i_this) { + return i_this->_draw(); } /* 801FD860-801FD880 1F81A0 0020+00 1/0 0/0 0/0 .text dMw_Execute__FP5dMw_c */ -static int dMw_Execute(dMw_c* p_menu) { - return p_menu->_execute(); +static int dMw_Execute(dMw_c* i_this) { + return i_this->_execute(); } /* 801FD880-801FD888 1F81C0 0008+00 1/0 0/0 0/0 .text dMw_IsDelete__FP5dMw_c */ -static int dMw_IsDelete(dMw_c* p_menu) { +static int dMw_IsDelete(dMw_c* i_this) { return 1; } /* 801FD888-801FD8C0 1F81C8 0038+00 1/0 0/0 0/0 .text dMw_Delete__FP5dMw_c */ -static int dMw_Delete(dMw_c* p_menu) { - int isDelete = p_menu->_delete(); - if (isDelete) { +static int dMw_Delete(dMw_c* i_this) { + int rt = i_this->_delete(); + if (rt != 0) { dMeter2Info_setMenuWindowClass(NULL); } - return isDelete; + + return rt; } /* 801FD8C0-801FD928 1F8200 0068+00 1/0 0/0 0/0 .text dMw_Create__FP9msg_class */ -static int dMw_Create(msg_class* p_menu) { - dMeter2Info_setMenuWindowClass(static_cast(p_menu)); +static int dMw_Create(msg_class* i_this) { + dMeter2Info_setMenuWindowClass((dMw_c*)i_this); g_mwHIO.field_0x4 = -1; g_mwDHIO.field_0x4 = -1; dComIfGp_offHeapLockFlag(0); - fopMsgM_setStageLayer(p_menu); - return static_cast(p_menu)->_create(); + fopMsgM_setStageLayer(i_this); + return ((dMw_c*)i_this)->_create(); } -/* 801FD928-801FDFCC 1F8268 06A4+00 0/0 1/0 0/0 .text __sinit_d_menu_window_cpp */ -void __sinit_d_menu_window_cpp(){// NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x801FD928, __sinit_d_menu_window_cpp); -#pragma pop - -/* ############################################################################################## */ -/* 80456B88-80456B90 000028 0004+04 1/1 0/0 0/0 .sbss2 @4115 */ -SECTION_SBSS2 static u8 lit_4115[4 + 4 /* padding */]; - -/* 801FDFCC-801FE2E8 1F890C 031C+00 1/0 0/0 0/0 .text draw__20dDlst_MENU_CAPTURE_cFv */ -void dDlst_MENU_CAPTURE_c::draw() { - // NONMATCHING -} - -/* 801FE2E8-801FE330 1F8C28 0048+00 1/0 0/0 0/0 .text __dt__20dDlst_MENU_CAPTURE_cFv */ -dDlst_MENU_CAPTURE_c::~dDlst_MENU_CAPTURE_c() { - // NONMATCHING -} +/* 803BF080-803BF094 -00001 0014+00 1/0 0/0 0/0 .data l_dMw_Method */ +static leafdraw_method_class l_dMw_Method = { + (process_method_func)dMw_Create, + (process_method_func)dMw_Delete, + (process_method_func)dMw_Execute, + (process_method_func)dMw_IsDelete, + (process_method_func)dMw_Draw, +}; -/* 80397E38-80397E38 024498 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ \ No newline at end of file +/* 803BF094-803BF0D4 -00001 0028+18 0/0 0/0 1/0 .data g_profile_MENUWINDOW */ +extern msg_process_profile_definition g_profile_MENUWINDOW = { + fpcLy_CURRENT_e, + 12, + fpcPi_CURRENT_e, + PROC_MENUWINDOW, + &g_fpcLf_Method.base, + sizeof(dMw_c), + 0, + 0, + &g_fopMsg_Method, + 0x02FF, + &l_dMw_Method, +}; diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index 687d0f52438..a9db7865425 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -300,9 +300,9 @@ void dScnLogo_c::warningDispDraw() { } if (mTimer == 0 || mDoCPd_c::getTrig(PAD_1) & - (CButton::A | CButton::B | CButton::X | CButton::Y | CButton::START | - CButton::Z | CButton::L | CButton::R | CButton::DPAD_LEFT | - CButton::DPAD_RIGHT | CButton::DPAD_DOWN | CButton::DPAD_UP)) + (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y | PAD_BUTTON_START | + PAD_TRIGGER_Z | PAD_TRIGGER_L | PAD_TRIGGER_R | PAD_BUTTON_LEFT | + PAD_BUTTON_RIGHT | PAD_BUTTON_DOWN | PAD_BUTTON_UP)) { mExecCommand = EXEC_WARNING_OUT; mTimer = 30; diff --git a/src/d/d_vib_pattern.cpp b/src/d/d_vib_pattern.cpp index 6f0ab4e1b68..8b810585cb5 100644 --- a/src/d/d_vib_pattern.cpp +++ b/src/d/d_vib_pattern.cpp @@ -1,66 +1,59 @@ -// -// Generated By: dol2asm -// Translation Unit: d/d_vib_pattern -// - -#include "d/d_vib_pattern.h" #include "d/d_vibration.h" -/* ############################################################################################## */ -/* 8037A620-8037A678 006C80 0058+00 0/0 1/1 0/0 .rodata MS_patt__12dVibration_c */ -const dVibration_pattern dVibration_c::MS_patt[11] = { - {0x0000, 0x0000, 0x00000000}, - {0x0000, 0x0003, 0xC0000000}, - {0x0000, 0x0004, 0xE0000000}, - {0x0000, 0x0006, 0xE8000000}, - {0x0000, 0x0007, 0xEC000000}, - {0x0000, 0x0008, 0xF6000000}, - {0x0000, 0x0009, 0xFB000000}, - {0x0000, 0x000A, 0xF6800000}, - {0x0000, 0x000B, 0xFB400000}, - {0x0000, 0x0008, 0xC2000000}, - {0x0000, 0x0002, 0xC0000000}, +// Motor Shock patterns +const vib_pattern dVibration_c::MS_patt[VIBMODE_S_MAX] = { + /* VIBMODE_S_CUSTOM */ {0, 0, 0x00000000}, + /* VIBMODE_S_POWER1 */ {0, 3, 0xC0000000}, + /* VIBMODE_S_POWER2 */ {0, 4, 0xE0000000}, + /* VIBMODE_S_POWER3 */ {0, 6, 0xE8000000}, + /* VIBMODE_S_POWER4 */ {0, 7, 0xEC000000}, + /* VIBMODE_S_POWER5 */ {0, 8, 0xF6000000}, + /* VIBMODE_S_POWER6 */ {0, 9, 0xFB000000}, + /* VIBMODE_S_POWER7 */ {0, 10, 0xF6800000}, + /* VIBMODE_S_POWER8 */ {0, 11, 0xFB400000}, + /* VIBMODE_S_DOKUTT */ {0, 8, 0xC2000000}, + /* VIBMODE_S_FOR2D */ {0, 2, 0xC0000000}, }; -/* 8037A678-8037A6D0 006CD8 0058+00 0/0 1/1 0/0 .rodata CS_patt__12dVibration_c */ -const dVibration_pattern dVibration_c::CS_patt[11] = { - {0x0000, 0x0000, 0x00000000}, - {0x0000, 0x0003, 0xC0000000}, - {0x0000, 0x0004, 0xE0000000}, - {0x0000, 0x0006, 0xE8000000}, - {0x0000, 0x0007, 0xEC000000}, - {0x0000, 0x0008, 0xF6000000}, - {0x0000, 0x0009, 0xFB000000}, - {0x0000, 0x000A, 0xF6800000}, - {0x0000, 0x000B, 0xFB400000}, - {0x0000, 0x0008, 0xC2000000}, - {0x0000, 0x0002, 0xC0000000}, +// Camera Shock patterns +const vib_pattern dVibration_c::CS_patt[VIBMODE_S_MAX] = { + /* VIBMODE_S_CUSTOM */ {0, 0, 0x00000000}, + /* VIBMODE_S_POWER1 */ {0, 3, 0xC0000000}, + /* VIBMODE_S_POWER2 */ {0, 4, 0xE0000000}, + /* VIBMODE_S_POWER3 */ {0, 6, 0xE8000000}, + /* VIBMODE_S_POWER4 */ {0, 7, 0xEC000000}, + /* VIBMODE_S_POWER5 */ {0, 8, 0xF6000000}, + /* VIBMODE_S_POWER6 */ {0, 9, 0xFB000000}, + /* VIBMODE_S_POWER7 */ {0, 10, 0xF6800000}, + /* VIBMODE_S_POWER8 */ {0, 11, 0xFB400000}, + /* VIBMODE_S_DOKUTT */ {0, 8, 0xC2000000}, + /* VIBMODE_S_FOR2D */ {0, 2, 0xC0000000}, }; -/* 8037A6D0-8037A720 006D30 0050+00 0/0 1/1 0/0 .rodata MQ_patt__12dVibration_c */ -const dVibration_pattern dVibration_c::MQ_patt[10] = { - {0x0000, 0x0000, 0x00000000}, - {0x0001, 0x0020, 0x10202020}, - {0x0001, 0x0020, 0x42104208}, - {0x0002, 0x0020, 0x22222222}, - {0x0002, 0x0020, 0x22492249}, - {0x0003, 0x0020, 0x52525252}, - {0x0003, 0x0020, 0x4A94AA95}, - {0x0004, 0x0020, 0x36555655}, - {0x0004, 0x0020, 0x6B6D6B6D}, - {0x0001, 0x001B, 0x20201000}, +// Motor Quake patterns +const vib_pattern dVibration_c::MQ_patt[VIBMODE_Q_MAX] = { + /* VIBMODE_Q_CUSTOM */ {0, 0, 0x00000000}, + /* VIBMODE_Q_POWER1 */ {1, 32, 0x10202020}, + /* VIBMODE_Q_POWER2 */ {1, 32, 0x42104208}, + /* VIBMODE_Q_POWER3 */ {2, 32, 0x22222222}, + /* VIBMODE_Q_POWER4 */ {2, 32, 0x22492249}, + /* VIBMODE_Q_POWER5 */ {3, 32, 0x52525252}, + /* VIBMODE_Q_POWER6 */ {3, 32, 0x4A94AA95}, + /* VIBMODE_Q_POWER7 */ {4, 32, 0x36555655}, + /* VIBMODE_Q_POWER8 */ {4, 32, 0x6B6D6B6D}, + /* VIBMODE_Q_HORSE */ {1, 27, 0x20201000}, }; -/* 8037A720-8037A770 006D80 0050+00 0/0 1/1 0/0 .rodata CQ_patt__12dVibration_c */ -const dVibration_pattern dVibration_c::CQ_patt[10] = { - {0x0000, 0x0000, 0x00000000}, - {0x0001, 0x0020, 0x10202020}, - {0x0001, 0x0020, 0x42104208}, - {0x0002, 0x0020, 0x22222222}, - {0x0002, 0x0020, 0x22492249}, - {0x0003, 0x0020, 0x52525252}, - {0x0003, 0x0020, 0x4A94AA95}, - {0x0004, 0x0020, 0x36555655}, - {0x0004, 0x0020, 0x6B6D6B6D}, - {0x0000, 0x001B, 0x20201000}, -}; \ No newline at end of file +// Camera Quake patterns +const vib_pattern dVibration_c::CQ_patt[VIBMODE_Q_MAX] = { + /* VIBMODE_Q_CUSTOM */ {0, 0, 0x00000000}, + /* VIBMODE_Q_POWER1 */ {1, 32, 0x10202020}, + /* VIBMODE_Q_POWER2 */ {1, 32, 0x42104208}, + /* VIBMODE_Q_POWER3 */ {2, 32, 0x22222222}, + /* VIBMODE_Q_POWER4 */ {2, 32, 0x22492249}, + /* VIBMODE_Q_POWER5 */ {3, 32, 0x52525252}, + /* VIBMODE_Q_POWER6 */ {3, 32, 0x4A94AA95}, + /* VIBMODE_Q_POWER7 */ {4, 32, 0x36555655}, + /* VIBMODE_Q_POWER8 */ {4, 32, 0x6B6D6B6D}, + /* VIBMODE_Q_HORSE */ {0, 27, 0x20201000}, +}; diff --git a/src/d/d_vibration.cpp b/src/d/d_vibration.cpp index 271389139ca..5c5ce4eb03a 100644 --- a/src/d/d_vibration.cpp +++ b/src/d/d_vibration.cpp @@ -1,503 +1,427 @@ -// -// Generated By: dol2asm -// Translation Unit: d/d_vibration -// - #include "d/d_vibration.h" #include "d/d_com_inf_game.h" #include "m_Do/m_Do_controller_pad.h" #include "SSystem/SComponent/c_math.h" -// -// Forward References: -// - -extern "C" static void func_8006F168__FPUsUll(); -extern "C" static void func_8006F184__FUlll(); -extern "C" static u32 func_8006F1A4__FUlll(); -extern "C" static void func_8006F1D8__Fll(); -extern "C" void Run__12dVibration_cFv(); -extern "C" void StartShock__12dVibration_cFii4cXyz(); -extern "C" void StartQuake__12dVibration_cFii4cXyz(); -extern "C" void StartQuake__12dVibration_cFPCUcii4cXyz(); -extern "C" void StopQuake__12dVibration_cFi(); -extern "C" void Kill__12dVibration_cFv(); -extern "C" void CheckQuake__12dVibration_cFv(); -extern "C" void setDefault__12dVibration_cFv(); -extern "C" void Init__12dVibration_cFv(); -extern "C" void Pause__12dVibration_cFv(); -extern "C" void Remove__12dVibration_cFv(); -extern "C" extern u8 on_final_boss_stg[8]; - -// -// External References: -// - -extern "C" void checkVibration__19dSv_player_config_cCFv(); -extern "C" void StartShake__9dCamera_cFlPUcl4cXyz(); -extern "C" void StopShake__9dCamera_cFv(); -extern "C" void dCam_getBody__Fv(); -extern "C" void dKy_darkworld_check__Fv(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void norm__4cXyzCFv(); -extern "C" void cM_rnd__Fv(); -extern "C" void stopMotor__Q210JUTGamePad7CRumbleFib(); -extern "C" void startPatternedRumble__Q210JUTGamePad7CRumbleFPvQ310JUTGamePad7CRumble7ERumbleUl(); -extern "C" void stopPatternedRumble__Q210JUTGamePad7CRumbleFs(); -extern "C" void stopPatternedRumbleAtThePeriod__Q210JUTGamePad7CRumbleFv(); -extern "C" void __cvt_fp2unsigned(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_29(); -extern "C" u8 const MS_patt__12dVibration_c[88]; -extern "C" u8 const CS_patt__12dVibration_c[88]; -extern "C" u8 const MQ_patt__12dVibration_c[80]; -extern "C" u8 const CQ_patt__12dVibration_c[80]; -extern "C" u8 m_gamePad__8mDoCPd_c[16]; - -// -// Declarations: -// +#define RESET_FRAME -99 + +#define RUMBLE_SHOCK 1 +#define RUMBLE_QUAKE 2 + +#define FLAG_CAMERA_VIB 0x7E +#define FLAG_MOTOR_VIB 0x1 +namespace { /* 8006F168-8006F184 069AA8 001C+00 1/1 0/0 0/0 .text makedata__25@unnamed@d_vibration_cpp@FPUsUll */ -static u16* func_8006F168(u16* param_0, u32 param_1, s32 param_2) { - param_0[0] = param_2; - param_0[1] = param_1 >> 16; - param_0[2] = param_1; - param_0[3] = 0; - return param_0; +u16* makedata(u16* data, u32 pattern, s32 length) { + data[0] = length; + data[1] = pattern >> 16; + data[2] = pattern; + data[3] = 0; + return data; } /* 8006F184-8006F1A4 069AC4 0020+00 1/1 0/0 0/0 .text rollshift__25@unnamed@d_vibration_cpp@FUlll */ -static s32 func_8006F184(u32 param_0, s32 param_1, s32 param_2) { - s32 temp = param_2 / param_1; - temp = temp * param_1; - temp = param_2 - temp; - param_2 = param_0 >> temp; - temp = param_1 - temp; - temp = param_0 << temp; - return param_2 | temp; +s32 rollshift(u32 pattern, s32 length, s32 index) { + index %= length; + return (pattern >> index) | (pattern << (length - index)); } /* 8006F1A4-8006F1D8 069AE4 0034+00 2/2 0/0 0/0 .text makebits__25@unnamed@d_vibration_cpp@FUlll */ -static u32 func_8006F1A4(u32 param_0, s32 param_1, s32 param_2) { - s32 uVar1 = -1; - u32 temp = param_0 & (uVar1 << (32 - param_1)); - param_0 = temp; - uVar1 = param_1; - while (uVar1 < param_2) { - param_0 = temp | (param_0 >> param_1); - uVar1 += param_1; +u32 makebits(u32 bits, s32 length, s32 numbits) { + s32 i; + u32 mask = bits & (-1 << (32 - length)); + bits = mask; + + for (i = length; i < numbits; i += length) { + bits = mask | (bits >> length); } - return param_0; -} -/* ############################################################################################## */ + return bits; +} /* 8006F1D8-8006F268 069B18 0090+00 1/1 0/0 0/0 .text randombit__25@unnamed@d_vibration_cpp@Fll */ -static u32 func_8006F1D8(s32 param_0, s32 param_1) { - u32 uVar3 = 0; +u32 randombit(s32 rounds, s32 length) { + u32 value = 0; - for (s32 iVar2 = 0; iVar2 < param_0; iVar2++) { - u32 dVar4 = param_1 * cM_rnd(); - uVar3 |= 0x40000000 >> dVar4; + for (int i = 0; i < rounds; i++) { + value |= 0x40000000 >> (u32)(length * cM_rnd()); } - return uVar3; + return value; } - -/* ############################################################################################## */ -/* 80450F50-80450F58 000450 0008+00 1/1 0/0 0/0 .sbss data$3831 */ -static u16 data[4]; +}; /* 8006F268-8006FA24 069BA8 07BC+00 0/0 2/2 0/0 .text Run__12dVibration_cFv */ -// Stack issues -#ifdef NONMATCHING int dVibration_c::Run() { + mMode = MODE_RUN; - field_0x8c = 1; if (dComIfGs_checkOptVibration() != 1) { - if (field_0x54 != -1) { - field_0x54 = -1; - field_0x50 |= 1; + if (mMotor.mShock.mVibMode != VIBMODE_S_NONE) { + mMotor.mShock.mVibMode = VIBMODE_S_NONE; + mMotor.mShock.field_0x0 |= 1; } - if (field_0x70 != -1) { - field_0x70 = -1; - field_0x6c |= 1; + + if (mMotor.mQuake.mVibMode != VIBMODE_Q_NONE) { + mMotor.mQuake.mVibMode = VIBMODE_Q_NONE; + mMotor.mQuake.field_0x0 |= 1; } - field_0x80 = -99; - field_0x64 = 0xffffff9d; + + mMotor.mQuake.mFrame = RESET_FRAME; + mMotor.mShock.mFrame = RESET_FRAME; } - if (((field_0x0.mShock.field_0x0 & 1) != 0) && (field_0x0.mShock.field_0x24 != -99)) { - field_0x0.mShock.field_0x24 = 0; - field_0x0.mShock.field_0x4 = -1; + if ((mCamera.mShock.field_0x0 & 1) && mCamera.mShock.mFrame != RESET_FRAME) { + mCamera.mShock.mFrame = 0; + mCamera.mShock.mVibMode = VIBMODE_S_NONE; } - if (((field_0x0.mQuake.field_0x0 & 1) != 0) && (field_0x0.mQuake.field_0x24 != -99)) { - field_0x0.mQuake.field_0x24 = 0; - field_0x0.mQuake.field_0x4 = -1; + + if ((mCamera.mQuake.field_0x0 & 1) && mCamera.mQuake.mFrame != RESET_FRAME) { + mCamera.mQuake.mFrame = 0; + mCamera.mQuake.mVibMode = VIBMODE_Q_NONE; } - if (field_0x0.mShock.field_0x24 == 0 || field_0x0.mQuake.field_0x24 == 0) { - s32 local_68 = 0; - if (field_0x0.mShock.field_0x4 == -1 || (field_0x0.mShock.field_0x0 & 1) != 0) { - field_0x0.mShock.field_0x24 = -99; - field_0x0.mShock.field_0x8 = 0; - field_0x0.mShock.field_0xc = 0; - field_0x0.mShock.field_0x10 = 0; - } else if (field_0x0.mShock.field_0x24 >= 0) { - local_68 |= 1; + if (mCamera.mShock.mFrame == 0 || mCamera.mQuake.mFrame == 0) { + u32 rumble = 0; + if (mCamera.mShock.mVibMode == VIBMODE_S_NONE || (mCamera.mShock.field_0x0 & 1)) { + mCamera.mShock.mFrame = RESET_FRAME; + mCamera.mShock.mPattern = 0; + mCamera.mShock.mLength = 0; + mCamera.mShock.mRounds = 0; + } else if (mCamera.mShock.mFrame >= 0) { + rumble |= RUMBLE_SHOCK; } - if (field_0x0.mQuake.field_0x4 == -1 || (field_0x0.mQuake.field_0x0 & 1) != 0) { - field_0x0.mQuake.field_0x24 = -99; - field_0x0.mQuake.field_0x8 = 0; - field_0x0.mQuake.field_0xc = 0; - field_0x0.mQuake.field_0x10 = 0; - } else if (field_0x0.mQuake.field_0x24 >= 0) { - local_68 |= 2; + if (mCamera.mQuake.mVibMode == VIBMODE_Q_NONE || (mCamera.mQuake.field_0x0 & 1)) { + mCamera.mQuake.mFrame = RESET_FRAME; + mCamera.mQuake.mPattern = 0; + mCamera.mQuake.mLength = 0; + mCamera.mQuake.mRounds = 0; + } else if (mCamera.mQuake.mFrame >= 0) { + rumble |= RUMBLE_QUAKE; } - switch (local_68) { - case 1: - s32 x = field_0x0.mShock.field_0xc; - u32 local_60 = field_0x0.mShock.field_0x8; - local_60 |= func_8006F1D8(field_0x0.mShock.field_0x10, x); - s32 uVar3 = field_0x0.mShock.field_0x14; + s32 length, pattern, bits, flags; + switch (rumble) { + case RUMBLE_SHOCK: + length = mCamera.mShock.mLength; + pattern = mCamera.mShock.mPattern; + pattern |= randombit(mCamera.mShock.mRounds, length); + + flags = mCamera.mShock.mFlags; if (dKy_darkworld_check()) { - uVar3 &= ~0x30; + flags &= ~0x30; } - camera_class* pCamera = dComIfGp_getCamera(0); - if (pCamera && pCamera->field_0x22f == 0x47) { - dCam_getBody()->StartShake(x, (u8*)&local_60, uVar3, field_0x0.mShock.field_0x18.norm()); + + if (dComIfGp_getCamera(0) != NULL && dComIfGp_getCamera(0)->field_0x22f == 0x47) { + dCam_getBody()->StartShake(length, (u8*)&pattern, flags, mCamera.mShock.mPos.norm()); } break; - case 2: - x = field_0x0.mQuake.field_0xc; - local_60 = func_8006F184(field_0x0.mQuake.field_0x8, x, field_0x88); - local_60 |= func_8006F1D8(field_0x0.mQuake.field_0x10, x); - uVar3 = field_0x0.mQuake.field_0x14; + case RUMBLE_QUAKE: + length = mCamera.mQuake.mLength; + pattern = rollshift(mCamera.mQuake.mPattern, length, mFrame); + pattern |= randombit(mCamera.mQuake.mRounds, length); + + flags = mCamera.mQuake.mFlags; if (dKy_darkworld_check()) { - uVar3 &= ~0x30; + flags &= ~0x30; } - pCamera = dComIfGp_getCamera(0); - if (pCamera && pCamera->field_0x22f == 0x47) { - dCam_getBody()->StartShake(x, (u8*)&local_60, uVar3, field_0x0.mQuake.field_0x18.norm()); + + if (dComIfGp_getCamera(0) != NULL && dComIfGp_getCamera(0)->field_0x22f == 0x47) { + dCam_getBody()->StartShake(length, (u8*)&pattern, flags, mCamera.mQuake.mPos.norm()); } break; - case 3: - local_60 = field_0x0.mShock.field_0x8 << field_0x0.mShock.field_0x24; - x = field_0x0.mShock.field_0xc - field_0x0.mShock.field_0x24; - local_60 |= func_8006F184(func_8006F1A4(field_0x0.mQuake.field_0x8, field_0x0.mQuake.field_0xc, x), x, field_0x88); - local_60 |= func_8006F1D8( - field_0x0.mShock.field_0x10 > field_0x0.mQuake.field_0x10 ? field_0x0.mShock.field_0x10 : field_0x0.mQuake.field_0x10, - x - ); - uVar3 = field_0x0.mShock.field_0x14 | field_0x0.mQuake.field_0x14; + case RUMBLE_SHOCK | RUMBLE_QUAKE: + pattern = mCamera.mShock.mPattern << mCamera.mShock.mFrame; + length = mCamera.mShock.mLength - mCamera.mShock.mFrame; + pattern |= rollshift(makebits(mCamera.mQuake.mPattern, mCamera.mQuake.mLength, length), length, mFrame); + pattern |= randombit(mCamera.mShock.mRounds > mCamera.mQuake.mRounds ? mCamera.mShock.mRounds : mCamera.mQuake.mRounds, length); + + flags = mCamera.mShock.mFlags | mCamera.mQuake.mFlags; if (dKy_darkworld_check()) { - uVar3 &= ~0x30; + flags &= ~0x30; } - pCamera = dComIfGp_getCamera(0); - if (pCamera && pCamera->field_0x22f == 0x47) { - cXyz tempSum = field_0x0.mShock.field_0x18 + field_0x0.mQuake.field_0x18; - dCam_getBody()->StartShake(x, (u8*)&local_60, uVar3, tempSum.norm()); + + if (dComIfGp_getCamera(0) != NULL && dComIfGp_getCamera(0)->field_0x22f == 0x47) { + dCam_getBody()->StartShake(length, (u8*)&pattern, flags, cXyz(mCamera.mShock.mPos + mCamera.mQuake.mPos).norm()); } - field_0x0.mQuake.field_0x24 = 0; - field_0x0.mShock.field_0x24 = 0; + + mCamera.mQuake.mFrame = 0; + mCamera.mShock.mFrame = 0; break; default: - pCamera = dComIfGp_getCamera(0); - if (pCamera && pCamera->field_0x22f == 0x47) { + if (dComIfGp_getCamera(0) != NULL && dComIfGp_getCamera(0)->field_0x22f == 0x47) { dCam_getBody()->StopShake(); } break; } } - if (((field_0x50 & 1) != 0) && (field_0x64 != -99)) { - field_0x64 = 0; - field_0x54 = -1; + if ((mMotor.mShock.field_0x0 & 1) && mMotor.mShock.mFrame != RESET_FRAME) { + mMotor.mShock.mFrame = 0; + mMotor.mShock.mVibMode = VIBMODE_S_NONE; } - if (((field_0x6c & 1) != 0) && (field_0x80 != -99)) { - field_0x80 = 0; - field_0x70 = -1; + if ((mMotor.mQuake.field_0x0 & 1) && mMotor.mQuake.mFrame != RESET_FRAME) { + mMotor.mQuake.mFrame = 0; + mMotor.mQuake.mVibMode = VIBMODE_Q_NONE; } - if (field_0x64 == 0 || field_0x80 == 0) { - s32 local_68 = 0; - if (field_0x54 == -1 || (field_0x50 & 1) != 0) { - field_0x64 = -99; - field_0x58 = 0; - field_0x5c = 0; - field_0x60 = 0; - } else if (field_0x64 >= 0) { - local_68 |= 1; + if (mMotor.mShock.mFrame == 0 || mMotor.mQuake.mFrame == 0) { + u32 rumble = 0; + if (mMotor.mShock.mVibMode == VIBMODE_S_NONE || (mMotor.mShock.field_0x0 & 1)) { + mMotor.mShock.mFrame = RESET_FRAME; + mMotor.mShock.mPattern = 0; + mMotor.mShock.mLength = 0; + mMotor.mShock.mRounds = 0; + } else if (mMotor.mShock.mFrame >= 0) { + rumble |= RUMBLE_SHOCK; } - if (field_0x70 == -1 || (field_0x6c & 1) != 0) { - field_0x80 = -99; - field_0x74 = 0; - field_0x78 = 0; - field_0x7c = 0; - } else if (field_0x80 >= 0) { - local_68 |= 2; + if (mMotor.mQuake.mVibMode == VIBMODE_Q_NONE || (mMotor.mQuake.field_0x0 & 1)) { + mMotor.mQuake.mFrame = RESET_FRAME; + mMotor.mQuake.mPattern = 0; + mMotor.mQuake.mLength = 0; + mMotor.mQuake.mRounds = 0; + } else if (mMotor.mQuake.mFrame >= 0) { + rumble |= RUMBLE_QUAKE; } - switch (local_68) { - case 1: - u32 local_60; - s32 x = field_0x5c; - local_60 = field_0x58; - local_60 |= func_8006F1D8(field_0x60, x); - field_0x68 = x; - mDoCPd_c::startMotorWave(0, func_8006F168(data, local_60, x), JUTGamePad::CRumble::VAL_0, 0x3c); + + static u16 data[4]; + s32 pattern, length, bits; + + switch (rumble) { + case RUMBLE_SHOCK: + length = mMotor.mShock.mLength; + pattern = mMotor.mShock.mPattern; + pattern |= randombit(mMotor.mShock.mRounds, length); + mMotor.mShock.mStopFrame = length; + mDoCPd_c::startMotorWave(PAD_1, makedata(data, pattern, length), JUTGamePad::CRumble::VAL_0, 60); break; - case 2: - x = field_0x78; - local_60 = func_8006F184(field_0x74, x, field_0x88); - local_60 |= func_8006F1D8(field_0x7c, x); - field_0x84 = 0x7fffffff; - mDoCPd_c::startMotorWave(0, func_8006F168(data, local_60, x), JUTGamePad::CRumble::VAL_1, 0x3c); + case RUMBLE_QUAKE: + length = mMotor.mQuake.mLength; + pattern = rollshift(mMotor.mQuake.mPattern, length, mFrame); + pattern |= randombit(mMotor.mQuake.mRounds, length); + mMotor.mQuake.mStopFrame = INT32_MAX; + mDoCPd_c::startMotorWave(PAD_1, makedata(data, pattern, length), JUTGamePad::CRumble::VAL_1, 60); break; - case 3: - local_60 = field_0x58 << field_0x64; - x = field_0x5c - field_0x64; - local_60 |= func_8006F184(func_8006F1A4(field_0x74, field_0x78, x), x, field_0x88); - local_60 |= func_8006F1D8( - field_0x60 > field_0x7c ? field_0x60 : field_0x7c, - x - ); - field_0x84 = x; - field_0x68 = x; - field_0x80 = 0; - field_0x64 = 0; - mDoCPd_c::startMotorWave(0, func_8006F168(data, local_60, x), JUTGamePad::CRumble::VAL_0, 0x3c); + case RUMBLE_SHOCK | RUMBLE_QUAKE: + pattern = mMotor.mShock.mPattern << mMotor.mShock.mFrame; + length = mMotor.mShock.mLength - mMotor.mShock.mFrame; + pattern |= rollshift(makebits(mMotor.mQuake.mPattern, mMotor.mQuake.mLength, length), length, mFrame); + pattern |= randombit(mMotor.mShock.mRounds > mMotor.mQuake.mRounds ? mMotor.mShock.mRounds : mMotor.mQuake.mRounds, length); + mMotor.mQuake.mStopFrame = length; + mMotor.mShock.mStopFrame = length; + mMotor.mQuake.mFrame = 0; + mMotor.mShock.mFrame = 0; + mDoCPd_c::startMotorWave(PAD_1, makedata(data, pattern, length), JUTGamePad::CRumble::VAL_0, 60); break; default: - mDoCPd_c::stopMotorWave(0); - mDoCPd_c::stopMotor(0); - field_0x84 = -99; - field_0x68 = -99; + mDoCPd_c::stopMotorWave(PAD_1); + mDoCPd_c::stopMotor(PAD_1); + mMotor.mQuake.mStopFrame = RESET_FRAME; + mMotor.mShock.mStopFrame = RESET_FRAME; break; } } - field_0x0.mQuake.field_0x0 = 0; - field_0x0.mShock.field_0x0 = 0; - field_0x6c = 0; - field_0x50 = 0; + mCamera.mQuake.field_0x0 = 0; + mCamera.mShock.field_0x0 = 0; + mMotor.mQuake.field_0x0 = 0; + mMotor.mShock.field_0x0 = 0; - if (field_0x0.mShock.field_0x24 >= 0) { - field_0x0.mShock.field_0x24++; + if (mCamera.mShock.mFrame >= 0) { + mCamera.mShock.mFrame++; - if (field_0x0.mShock.field_0x24 > field_0x0.mShock.field_0xc) { - field_0x0.mShock.field_0x0 |= 1; + if (mCamera.mShock.mFrame > mCamera.mShock.mLength) { + mCamera.mShock.field_0x0 |= 1; } } - if (field_0x64 >= 0) { - field_0x64++; + if (mMotor.mShock.mFrame >= 0) { + mMotor.mShock.mFrame++; - if (field_0x64 > field_0x68) { - field_0x50 |= 1; + if (mMotor.mShock.mFrame > mMotor.mShock.mStopFrame) { + mMotor.mShock.field_0x0 |= 1; } } - if (field_0x0.mQuake.field_0x24 >= 0) { - field_0x0.mQuake.field_0x24++; + if (mCamera.mQuake.mFrame >= 0) { + mCamera.mQuake.mFrame++; - if (field_0x0.mQuake.field_0x24 > field_0x0.mQuake.field_0xc) { - field_0x0.mQuake.field_0x24 = 0; + if (mCamera.mQuake.mFrame > mCamera.mQuake.mLength) { + mCamera.mQuake.mFrame = 0; } } - if (field_0x80 >= 930) { - field_0x80 = 0; - } else if (field_0x80 >= 900) { - mDoCPd_c::stopMotorWave(0); - mDoCPd_c::stopMotor(0); - field_0x80++; - } else if (field_0x80 >= 0) { - field_0x80++; - if (field_0x80 > field_0x84) { - field_0x80 = 0; + if (mMotor.mQuake.mFrame >= 930) { + mMotor.mQuake.mFrame = 0; + } else if (mMotor.mQuake.mFrame >= 900) { + mDoCPd_c::stopMotorWave(PAD_1); + mDoCPd_c::stopMotor(PAD_1); + mMotor.mQuake.mFrame++; + } else if (mMotor.mQuake.mFrame >= 0) { + mMotor.mQuake.mFrame++; + if (mMotor.mQuake.mFrame > mMotor.mQuake.mStopFrame) { + mMotor.mQuake.mFrame = 0; } } - field_0x88++; + mFrame++; return 1; } -#else -int dVibration_c::Run() { - // NONMATCHING -} -#endif /* 8006FA24-8006FB10 06A364 00EC+00 0/0 62/62 298/298 .text StartShock__12dVibration_cFii4cXyz */ -bool dVibration_c::StartShock(int param_0, int param_1, cXyz param_2) { +bool dVibration_c::StartShock(int i_vibmode, int i_flags, cXyz i_pos) { bool ret = false; - if (param_1 & 0x7eU) { - field_0x0.mShock.field_0x4 = param_0; - field_0x0.mShock.field_0x24 = 0; - field_0x0.mShock.field_0x14 = param_1; - field_0x0.mShock.field_0x18 = param_2; - field_0x0.mShock.field_0x8 = CS_patt[param_0].field_0x04; - field_0x0.mShock.field_0xc = CS_patt[param_0].field_0x02; - field_0x0.mShock.field_0x10 = CS_patt[param_0].field_0x00; + if (i_flags & FLAG_CAMERA_VIB) { + mCamera.mShock.mVibMode = i_vibmode; + mCamera.mShock.mFrame = 0; + mCamera.mShock.mFlags = i_flags; + mCamera.mShock.mPos = i_pos; + + mCamera.mShock.mPattern = CS_patt[i_vibmode].bits; + mCamera.mShock.mLength = CS_patt[i_vibmode].length; + mCamera.mShock.mRounds = CS_patt[i_vibmode].rounds; ret = true; } - if (param_1 & 1 && dComIfGs_checkOptVibration() == 1) { - field_0x54 = param_0; - field_0x64 = 0; - field_0x58 = MS_patt[param_0].field_0x04; - field_0x5c = MS_patt[param_0].field_0x02; + + if ((i_flags & FLAG_MOTOR_VIB) && dComIfGs_checkOptVibration() == 1) { + mMotor.mShock.mVibMode = i_vibmode; + mMotor.mShock.mFrame = 0; + + mMotor.mShock.mPattern = MS_patt[i_vibmode].bits; + mMotor.mShock.mLength = MS_patt[i_vibmode].length; ret = true; } + return ret; } /* 8006FB10-8006FC0C 06A450 00FC+00 0/0 8/8 67/67 .text StartQuake__12dVibration_cFii4cXyz */ -bool dVibration_c::StartQuake(int param_0, int param_1, cXyz param_2) { +bool dVibration_c::StartQuake(int i_vibmode, int i_flags, cXyz i_pos) { bool ret = false; - if (param_1 & 0x7eU) { - field_0x0.mQuake.field_0x4 = param_0; - field_0x0.mQuake.field_0x24 = 0; - field_0x0.mQuake.field_0x14 = param_1; - field_0x0.mQuake.field_0x18 = param_2; - field_0x0.mQuake.field_0x8 = CQ_patt[param_0].field_0x04; - field_0x0.mQuake.field_0xc = CQ_patt[param_0].field_0x02; - field_0x0.mQuake.field_0x10 = CQ_patt[param_0].field_0x00; + if (i_flags & FLAG_CAMERA_VIB) { + mCamera.mQuake.mVibMode = i_vibmode; + mCamera.mQuake.mFrame = 0; + mCamera.mQuake.mFlags = i_flags; + mCamera.mQuake.mPos = i_pos; + mCamera.mQuake.mPattern = CQ_patt[i_vibmode].bits; + mCamera.mQuake.mLength = CQ_patt[i_vibmode].length; + mCamera.mQuake.mRounds = CQ_patt[i_vibmode].rounds; ret = true; } - if (param_1 & 1 && dComIfGs_checkOptVibration() == 1) { - field_0x70 = param_0; - field_0x80 = 0; - field_0x74 = MQ_patt[param_0].field_0x04; - field_0x78 = MQ_patt[param_0].field_0x02; - field_0x7c = CQ_patt[param_0].field_0x00; + + if ((i_flags & FLAG_MOTOR_VIB) && dComIfGs_checkOptVibration() == 1) { + mMotor.mQuake.mVibMode = i_vibmode; + mMotor.mQuake.mFrame = 0; + mMotor.mQuake.mPattern = MQ_patt[i_vibmode].bits; + mMotor.mQuake.mLength = MQ_patt[i_vibmode].length; + mMotor.mQuake.mRounds = CQ_patt[i_vibmode].rounds; ret = true; } + return ret; } /* 8006FC0C-8006FD94 06A54C 0188+00 0/0 2/2 2/2 .text StartQuake__12dVibration_cFPCUcii4cXyz */ -bool dVibration_c::StartQuake(u8 const* param_0, int param_1, int param_2, cXyz param_3) { - int iVar7; - int iVar6; - int iVar5; - int iVar4; - bool bVar8 = false; - int uVar1 = (param_0[0] << 8) | param_0[1]; - if (uVar1 >= 9) { - iVar7 = 3; - } else { - iVar7 = 0; - } - if (uVar1 >= 1) { - iVar6 = 2; - } else { - iVar6 = 0; - } - - if (uVar1 >= 0x11) { - iVar5 = 4; - } else { - iVar5 = 0; - } - if (uVar1 >= 0x19) { - iVar4 = 5; - } else { - iVar4 = 0; - } - u32 this_00 = - param_0[iVar6] << 24 | param_0[iVar7] << 16 | param_0[iVar5] << 8 | (param_0[iVar4]); - if ((param_2 & 0x7e) != 0) { - field_0x0.mQuake.field_0x4 = 0; - field_0x0.mQuake.field_0x24 = 0; - field_0x0.mQuake.field_0x14 = param_2; - field_0x0.mQuake.field_0x18 = param_3; - field_0x0.mQuake.field_0x8 = func_8006F1A4(this_00, param_0[1], 0x20); - field_0x0.mQuake.field_0xc = 0x20; - field_0x0.mQuake.field_0x10 = param_1; - bVar8 = true; +bool dVibration_c::StartQuake(const u8* i_pattern, int i_rounds, int i_flags, cXyz i_pos) { + bool ret = false; + + int length = (i_pattern[0] << 8) | i_pattern[1]; + u32 bits = i_pattern[length >= 1 ? 2 : 0] << 24 | + i_pattern[length >= 9 ? 3 : 0] << 16 | + i_pattern[length >= 17 ? 4 : 0] << 8 | + i_pattern[length >= 25 ? 5 : 0] << 0; + + if (i_flags & FLAG_CAMERA_VIB) { + mCamera.mQuake.mVibMode = VIBMODE_Q_CUSTOM; + mCamera.mQuake.mFrame = 0; + mCamera.mQuake.mFlags = i_flags; + mCamera.mQuake.mPos = i_pos; + mCamera.mQuake.mPattern = makebits(bits, i_pattern[1], 32); + mCamera.mQuake.mLength = 32; + mCamera.mQuake.mRounds = i_rounds; + ret = true; } - if (((param_2 & 1) != 0) && - (dComIfGs_checkOptVibration() == 1)) - { - field_0x70 = 0; - field_0x80 = 0; - field_0x74 = func_8006F1A4(this_00, param_0[1], 0x20); - field_0x78 = 0x20; - field_0x7c = param_1; - bVar8 = true; + + if ((i_flags & FLAG_MOTOR_VIB) && dComIfGs_checkOptVibration() == 1) { + mMotor.mQuake.mVibMode = VIBMODE_Q_CUSTOM; + mMotor.mQuake.mFrame = 0; + mMotor.mQuake.mPattern = makebits(bits, i_pattern[1], 32); + mMotor.mQuake.mLength = 32; + mMotor.mQuake.mRounds = i_rounds; + ret = true; } - return bVar8; + + return ret; } /* 8006FD94-8006FE00 06A6D4 006C+00 0/0 6/6 82/82 .text StopQuake__12dVibration_cFi */ -int dVibration_c::StopQuake(int param_0) { - int ret = 0; - if (param_0 & 0x7eU) { - if (field_0x0.mQuake.field_0x24 >= 0) { - field_0x0.mQuake.field_0x14 &= ~param_0; - if (field_0x0.mQuake.field_0x14 == 0) { - field_0x0.mQuake.field_0x0 |= 1; +int dVibration_c::StopQuake(int i_flags) { + int ret = FALSE; + if (i_flags & FLAG_CAMERA_VIB) { + if (mCamera.mQuake.mFrame >= 0) { + mCamera.mQuake.mFlags &= ~i_flags; + if (mCamera.mQuake.mFlags == 0) { + mCamera.mQuake.field_0x0 |= 1; } - ret = 1; + ret = TRUE; } } - if (param_0 & 1 && field_0x80 >= 0) { - field_0x6c |= 1; - ret = 1; + + if ((i_flags & FLAG_MOTOR_VIB) && mMotor.mQuake.mFrame >= 0) { + mMotor.mQuake.field_0x0 |= 1; + ret = TRUE; } + return ret; } /* 8006FE00-8006FE5C 06A740 005C+00 2/2 0/0 0/0 .text Kill__12dVibration_cFv */ void dVibration_c::Kill() { - mDoCPd_c::stopMotorWaveHard(0); - mDoCPd_c::stopMotorHard(0); + mDoCPd_c::stopMotorWaveHard(PAD_1); + mDoCPd_c::stopMotorHard(PAD_1); setDefault(); } /* 8006FE5C-8006FE84 06A79C 0028+00 0/0 0/0 10/10 .text CheckQuake__12dVibration_cFv */ bool dVibration_c::CheckQuake() { - return field_0x0.mQuake.field_0x4 != -1 || field_0x70 != -1; + return mCamera.mQuake.mVibMode != VIBMODE_Q_NONE || mMotor.mQuake.mVibMode != VIBMODE_Q_NONE; } /* 8006FE84-8006FF04 06A7C4 0080+00 2/2 0/0 0/0 .text setDefault__12dVibration_cFv */ void dVibration_c::setDefault() { - field_0x54 = -1; - field_0x0.mShock.field_0x4 = -1; - field_0x70 = -1; - field_0x0.mQuake.field_0x4 = -1; - field_0x50 = 0; - field_0x0.mShock.field_0x0 = 0; - field_0x6c = 0; - field_0x0.mQuake.field_0x0 = 0; - field_0x58 = 0; - field_0x0.mShock.field_0x8 = 0; - field_0x74 = 0; - field_0x0.mQuake.field_0x8 = 0; - field_0x5c = 0; - field_0x0.mShock.field_0xc = 0; - field_0x78 = 0; - field_0x0.mQuake.field_0xc = 0; - field_0x60 = 0; - field_0x0.mShock.field_0x10 = 0; - field_0x7c = 0; - field_0x0.mQuake.field_0x10 = 0; - field_0x64 = -99; - field_0x0.mShock.field_0x24 = -99; - field_0x80 = -99; - field_0x0.mQuake.field_0x24 = -99; - field_0x68 = -99; - field_0x84 = -99; - field_0x8c = 0; - field_0x88 = 0; + mMotor.mShock.mVibMode = VIBMODE_S_NONE; + mCamera.mShock.mVibMode = VIBMODE_S_NONE; + mMotor.mQuake.mVibMode = VIBMODE_Q_NONE; + mCamera.mQuake.mVibMode = VIBMODE_Q_NONE; + mMotor.mShock.field_0x0 = 0; + mCamera.mShock.field_0x0 = 0; + mMotor.mQuake.field_0x0 = 0; + mCamera.mQuake.field_0x0 = 0; + mMotor.mShock.mPattern = 0; + mCamera.mShock.mPattern = 0; + mMotor.mQuake.mPattern = 0; + mCamera.mQuake.mPattern = 0; + mMotor.mShock.mLength = 0; + mCamera.mShock.mLength = 0; + mMotor.mQuake.mLength = 0; + mCamera.mQuake.mLength = 0; + mMotor.mShock.mRounds = 0; + mCamera.mShock.mRounds = 0; + mMotor.mQuake.mRounds = 0; + mCamera.mQuake.mRounds = 0; + mMotor.mShock.mFrame = RESET_FRAME; + mCamera.mShock.mFrame = RESET_FRAME; + mMotor.mQuake.mFrame = RESET_FRAME; + mCamera.mQuake.mFrame = RESET_FRAME; + mMotor.mShock.mStopFrame = RESET_FRAME; + mMotor.mQuake.mStopFrame = RESET_FRAME; + mMode = MODE_WAIT; + mFrame = 0; } /* 8006FF04-8006FF38 06A844 0034+00 0/0 2/2 0/0 .text Init__12dVibration_cFv */ @@ -508,26 +432,29 @@ void dVibration_c::Init() { /* 8006FF38-8006FFF8 06A878 00C0+00 0/0 1/1 0/0 .text Pause__12dVibration_cFv */ void dVibration_c::Pause() { - if (field_0x8c != -1) { - if (field_0x54 != -1 || field_0x70 != -1) { - mDoCPd_c::stopMotorWaveHard(0); - mDoCPd_c::stopMotorHard(0); + if (mMode != MODE_PAUSE) { + if (mMotor.mShock.mVibMode != VIBMODE_S_NONE || mMotor.mQuake.mVibMode != VIBMODE_Q_NONE) { + mDoCPd_c::stopMotorWaveHard(PAD_1); + mDoCPd_c::stopMotorHard(PAD_1); } - field_0x54 = -1; - field_0x0.mShock.field_0x4 = -1; - field_0x64 = -99; - field_0x0.mShock.field_0x24 = -99; - if (field_0x0.mQuake.field_0x4 != -1) { - field_0x0.mQuake.field_0x24 = 0; + + mMotor.mShock.mVibMode = VIBMODE_S_NONE; + mCamera.mShock.mVibMode = VIBMODE_S_NONE; + mMotor.mShock.mFrame = RESET_FRAME; + mCamera.mShock.mFrame = RESET_FRAME; + + if (mCamera.mQuake.mVibMode != VIBMODE_Q_NONE) { + mCamera.mQuake.mFrame = 0; } - if (field_0x70 != -1) { - field_0x80 = 0; + if (mMotor.mQuake.mVibMode != VIBMODE_Q_NONE) { + mMotor.mQuake.mFrame = 0; } - field_0x8c = -1; + + mMode = MODE_PAUSE; } } /* 8006FFF8-80070018 06A938 0020+00 0/0 1/1 0/0 .text Remove__12dVibration_cFv */ void dVibration_c::Remove() { Kill(); -} \ No newline at end of file +} diff --git a/src/m_Do/m_Do_controller_pad.cpp b/src/m_Do/m_Do_controller_pad.cpp index 2b87fea80c8..c179a25f291 100644 --- a/src/m_Do/m_Do_controller_pad.cpp +++ b/src/m_Do/m_Do_controller_pad.cpp @@ -17,13 +17,13 @@ interface_of_controller_pad mDoCPd_c::m_cpadInfo[4]; /* 80007954-80007A94 002294 0140+00 0/0 1/1 0/0 .text create__8mDoCPd_cFv */ void mDoCPd_c::create() { - JUTGamePad* pad = new JUTGamePad(JUTGamePad::Port_1); + JUTGamePad* pad = new JUTGamePad(JUTGamePad::EPort1); m_gamePad[0] = pad; if (mDoMain::developmentMode != 0) { - m_gamePad[1] = new JUTGamePad(JUTGamePad::Port_2); - m_gamePad[2] = new JUTGamePad(JUTGamePad::Port_3); - m_gamePad[3] = new JUTGamePad(JUTGamePad::Port_4); + m_gamePad[1] = new JUTGamePad(JUTGamePad::EPort2); + m_gamePad[2] = new JUTGamePad(JUTGamePad::EPort3); + m_gamePad[3] = new JUTGamePad(JUTGamePad::EPort4); } else { m_gamePad[1] = NULL; m_gamePad[2] = NULL; @@ -126,4 +126,4 @@ void mDoCPd_c::LRlockCheck(interface_of_controller_pad* interface) { void mDoCPd_c::recalibrate(void) { JUTGamePad::clearForReset(); JUTGamePad::CRumble::setEnabled(PAD_CHAN3_BIT | PAD_CHAN2_BIT | PAD_CHAN1_BIT | PAD_CHAN0_BIT); -} \ No newline at end of file +} diff --git a/src/m_Do/m_Do_machine.cpp b/src/m_Do/m_Do_machine.cpp index 0185663d7dc..e3177dea3de 100644 --- a/src/m_Do/m_Do_machine.cpp +++ b/src/m_Do/m_Do_machine.cpp @@ -177,8 +177,8 @@ static int developKeyCheck(u32 btnTrig, u32 btnHold) { static u8 key_ganon; static u8 key_zelda; - if (btnHold == (CButton::L | CButton::R | CButton::Z | CButton::DPAD_DOWN) && - btnTrig == CButton::DPAD_DOWN) { + if (btnHold == (PAD_TRIGGER_L | PAD_TRIGGER_R | PAD_TRIGGER_Z | PAD_BUTTON_DOWN) && + btnTrig == PAD_BUTTON_DOWN) { if (key_link == 3 && key_ganon == 6 && key_zelda == 5) { mDoMain::developmentMode = 1; } else { @@ -188,15 +188,15 @@ static int developKeyCheck(u32 btnTrig, u32 btnHold) { } } - if (btnHold == (CButton::L | CButton::DPAD_RIGHT) && btnTrig == CButton::L) { + if (btnHold == (PAD_TRIGGER_L | PAD_BUTTON_RIGHT) && btnTrig == PAD_TRIGGER_L) { key_link++; } - if (btnHold == (CButton::R | CButton::DPAD_UP) && btnTrig == CButton::R) { + if (btnHold == (PAD_TRIGGER_R | PAD_BUTTON_UP) && btnTrig == PAD_TRIGGER_R) { key_ganon++; } - if (btnHold == (CButton::Z | CButton::DPAD_LEFT) && btnTrig == CButton::Z) { + if (btnHold == (PAD_TRIGGER_Z | PAD_BUTTON_LEFT) && btnTrig == PAD_TRIGGER_Z) { key_zelda++; } @@ -241,7 +241,7 @@ void myExceptionCallback(u16, OSContext*, u32, u32) { } else { manager->setTraceSuppress(0x80); if (mDoMain::developmentMode == 0) { - JUTGamePad pad(JUTGamePad::Port_1); + JUTGamePad pad(JUTGamePad::EPort1); manager->setGamePad(&pad); if (manager != NULL) { @@ -289,7 +289,7 @@ static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) { *(u32*)(srr0 - 0x8), *(u32*)(srr0 - 0x4), *(u32*)srr0); } - JUTGamePad pad(JUTGamePad::Port_1); + JUTGamePad pad(JUTGamePad::EPort1); manager->setGamePad(&pad); BOOL padDisabled = manager->isEnablePad() == false; @@ -310,12 +310,12 @@ static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) { } bool waitRetrace = false; - if (btnTrig == CButton::START) { + if (btnTrig == PAD_BUTTON_START) { exception_addition(exConsole); waitRetrace = true; } - if (btnTrig == CButton::Z) { + if (btnTrig == PAD_TRIGGER_Z) { JUTConsole* sysConsole = JFWSystem::getSystemConsole(); if (JUTConsoleManager::getManager()->getDirectConsole() != sysConsole) { exConsole = sysConsole; @@ -331,22 +331,22 @@ static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) { waitRetrace = true; } - if (btnTrig == CButton::A) { + if (btnTrig == PAD_BUTTON_A) { exConsole->scrollToLastLine(); waitRetrace = true; } - if (btnTrig == CButton::B) { + if (btnTrig == PAD_BUTTON_B) { exConsole->scrollToFirstLine(); waitRetrace = true; } - if (btnHold == CButton::DPAD_UP) { + if (btnHold == PAD_BUTTON_UP) { exConsole->scroll(holdUpCount < 3 ? -1 : (holdUpCount < 5 ? -2 : (holdUpCount < 7 ? -4 : -8))); waitRetrace = true; holdDownCount = 0; holdUpCount++; - } else if (btnHold == CButton::DPAD_DOWN) { + } else if (btnHold == PAD_BUTTON_DOWN) { exConsole->scroll(holdDownCount < 3 ? 1 : (holdDownCount < 5 ? 2 : (holdDownCount < 7 ? 4 : 8))); waitRetrace = true; holdUpCount = 0; diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index a58e6c907b6..fa5c31f098a 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -97,8 +97,8 @@ void CheckHeap(u32 i_padNo) { bool comboCheck = false; // if L + R + Z is pressed - if ((mDoCPd_c::getHold(i_padNo) & ~CButton::Z) == (CButton::L + CButton::R) && - mDoCPd_c::getTrig(i_padNo) & CButton::Z) + if ((mDoCPd_c::getHold(i_padNo) & ~PAD_TRIGGER_Z) == (PAD_TRIGGER_L + PAD_TRIGGER_R) && + mDoCPd_c::getTrig(i_padNo) & PAD_TRIGGER_Z) { comboCheck = true; } @@ -276,7 +276,7 @@ bool Debug_console(u32 i_padNo) { console_scroll_init = 1; } - if (mDoCPd_c::getTrig(i_padNo) & CButton::Z && !(mDoCPd_c::getHold(i_padNo) & ~CButton::Z)) + if (mDoCPd_c::getTrig(i_padNo) & PAD_TRIGGER_Z && !(mDoCPd_c::getHold(i_padNo) & ~PAD_TRIGGER_Z)) { console->setVisible(console->isVisible() == false); JUTAssertion::setMessageCount(0); @@ -284,19 +284,19 @@ bool Debug_console(u32 i_padNo) { if (console->isVisible()) { u32 holdButtons = mDoCPd_c::getHold(i_padNo); - if ((holdButtons & CButton::L && holdButtons & CButton::R) || + if ((holdButtons & PAD_TRIGGER_L && holdButtons & PAD_TRIGGER_R) || ((mDoCPd_c::getAnalogL(i_padNo) > 0.0f && mDoCPd_c::getAnalogR(i_padNo) > 0.0f))) { f32 stick_x = mDoCPd_c::getStickX(i_padNo); f32 stick_y = mDoCPd_c::getStickY(i_padNo); - if (holdButtons & (CButton::Y | CButton::X) && - mDoCPd_c::getTrig(i_padNo) & CButton::START) + if (holdButtons & (PAD_BUTTON_Y | PAD_BUTTON_X) && + mDoCPd_c::getTrig(i_padNo) & PAD_BUTTON_START) { console->clear(); } - if (!(mDoCPd_c::getHold(i_padNo) & (CButton::Y | CButton::X))) { + if (!(mDoCPd_c::getHold(i_padNo) & (PAD_BUTTON_Y | PAD_BUTTON_X))) { console_scroll -= stick_y; int scrollAmount; @@ -313,16 +313,16 @@ bool Debug_console(u32 i_padNo) { console->scroll(scrollAmount); } } else { - if (mDoCPd_c::getHold(i_padNo) & CButton::X) { + if (mDoCPd_c::getHold(i_padNo) & PAD_BUTTON_X) { console_position_x += stick_x; } - if (mDoCPd_c::getHold(i_padNo) & CButton::Y) { + if (mDoCPd_c::getHold(i_padNo) & PAD_BUTTON_Y) { console_position_y -= stick_y; } } - if (mDoCPd_c::getTrig(i_padNo) & CButton::A) { + if (mDoCPd_c::getTrig(i_padNo) & PAD_BUTTON_A) { console->dumpToTerminal(0xFFFFFFFF); console->setOutput(JUTConsole::OUTPUT_OSREPORT | JUTConsole::OUTPUT_CONSOLE); } @@ -335,11 +335,11 @@ bool Debug_console(u32 i_padNo) { } else { u32 pressButtons = mDoCPd_c::getTrig(i_padNo); - if (pressButtons & CButton::DPAD_DOWN) { + if (pressButtons & PAD_BUTTON_DOWN) { g_HIO.mDisplayMeter ^= 1; } - if (pressButtons & CButton::DPAD_LEFT) { + if (pressButtons & PAD_BUTTON_LEFT) { if (JKRAram::getAramHeap()) { JKRAram::getAramHeap()->dump(); } @@ -349,11 +349,11 @@ bool Debug_console(u32 i_padNo) { g_dComIfG_gameInfo.mResControl.dump(); } - if (mDoCPd_c::getTrig(i_padNo) & CButton::DPAD_RIGHT) { + if (mDoCPd_c::getTrig(i_padNo) & PAD_BUTTON_RIGHT) { JKRHeap::getSystemHeap()->dump_sort(); } - if (mDoCPd_c::getTrig(i_padNo) & CButton::DPAD_UP) { + if (mDoCPd_c::getTrig(i_padNo) & PAD_BUTTON_UP) { zeldaHeap->dump_sort(); gameHeap->dump_sort(); archiveHeap->dump_sort(); @@ -391,15 +391,15 @@ static void debug() { CheckHeap(PAD_3); } - if ((mDoCPd_c::getGamePad(PAD_3)->getButton() & ~CButton::Z) == CButton::R && - mDoCPd_c::getGamePad(PAD_3)->testTrigger(CButton::Z)) + if ((mDoCPd_c::getGamePad(PAD_3)->getButton() & ~PAD_TRIGGER_Z) == PAD_TRIGGER_R && + mDoCPd_c::getGamePad(PAD_3)->testTrigger(PAD_TRIGGER_Z)) { mDisplayHeapSize ^= 1; } if (mDisplayHeapSize) { - if ((mDoCPd_c::getGamePad(PAD_3)->getButton() & ~CButton::Z) == CButton::L && - mDoCPd_c::getGamePad(PAD_3)->testTrigger(CButton::Z)) + if ((mDoCPd_c::getGamePad(PAD_3)->getButton() & ~PAD_TRIGGER_Z) == PAD_TRIGGER_L && + mDoCPd_c::getGamePad(PAD_3)->testTrigger(PAD_TRIGGER_Z)) { mDoMain::mHeapBriefType < 5 ? mDoMain::mHeapBriefType++ : mDoMain::mHeapBriefType = 1; @@ -647,4 +647,4 @@ JASAudioThread* JASGlobalInstance::sInstance; /* 80450B90-80450B98 000090 0004+04 0/0 4/4 0/0 .sbss * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ -JASDefaultBankTable* JASGlobalInstance::sInstance; \ No newline at end of file +JASDefaultBankTable* JASGlobalInstance::sInstance;