Merge pull request #301 from robojumper/d_lyt_meter_suiryu_score

d_lyt_suiryu_score mostly OK
This commit is contained in:
robojumper
2026-04-09 08:14:05 +02:00
committed by GitHub
17 changed files with 2058 additions and 234 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ enum StoryFlags_e {
/** [Music Scroll for Tadtones (sets before the collecting, unsets when collecting is done)]
* Story Flag #82 (0x0052) - JP 805ACD6B 0x08 / US 805A9AEB 0x08
*/
STORYFLAG_82,
STORYFLAG_HAS_TADTONE_SCROLL,
/** [Ghirahim 1 defeated (Skyview Spring layer 1 / Skyview Boss Room layer 1)]
* Story Flag #83 (0x0053) - JP 805ACD69 0x80 / US 805A9AE9 0x80
+46 -6
View File
@@ -20,6 +20,46 @@ public:
f32 getField0x260() const;
void setFrame(f32);
bool isStateWait() const {
return mStateMgr.isState(StateID_Wait);
}
void forceOut() {
mShouldMove = false;
mForceOut = true;
}
void lose() {
mShouldMove = false;
mIsCollected = false;
}
void collect() {
mShouldMove = false;
mIsCollected = true;
}
void startLose() {
mIsAboutToLose = true;
}
void stopLose() {
mIsAboutToLose = false;
}
void setColor(s32 color) {
mColor = color;
}
void setMove() {
mIsAboutToLose = false;
mShouldMove = true;
}
bool isMove() const {
return mIsMove;
}
private:
STATE_FUNC_DECLARE(dLytNote_c, Wait);
STATE_FUNC_DECLARE(dLytNote_c, In);
@@ -34,12 +74,12 @@ private:
/* 0x260 */ f32 field_0x260;
/* 0x264 */ s32 mOutAnim;
/* 0x268 */ s32 mInAnim;
/* 0x26C */ s32 field_0x26C;
/* 0x270 */ u8 field_0x270;
/* 0x271 */ u8 field_0x271;
/* 0x272 */ u8 field_0x272;
/* 0x273 */ u8 field_0x273;
/* 0x274 */ u8 field_0x274;
/* 0x26C */ s32 mColor;
/* 0x270 */ bool mShouldMove;
/* 0x271 */ bool mIsCollected;
/* 0x272 */ bool mIsAboutToLose;
/* 0x273 */ bool mIsMove;
/* 0x274 */ bool mForceOut;
};
#endif
+174
View File
@@ -0,0 +1,174 @@
#ifndef D_LYT_SUIRYU_SCORE_H
#define D_LYT_SUIRYU_SCORE_H
#include "d/d_base.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_note.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_State.hpp"
struct dLytNote2_c {
/* 0x000 */ dLytNote_c mNote;
/* 0x278 */ UNKWORD field_0x278;
};
class dLytMeterSuiryuScoreBase_c {
public:
dLytMeterSuiryuScoreBase_c()
: mStateMgr(*this), field_0x2250(0), field_0x2262(0), field_0x2263(0), field_0x2264(0) {}
virtual ~dLytMeterSuiryuScoreBase_c() {}
bool build(d2d::ResAccIf_c *resAcc);
bool remove();
bool execute();
bool draw();
void startIn();
void startOut();
void setColor0(u8 idx);
void setColor1(u8 idx);
void alphaForwards(s32 idx, f32 rate);
void alphaBackwards(s32 idx, f32 rate);
void stopMove();
void fn_802978F0(s32 idx);
void fn_80297AE0();
void fn_80297B40();
void fn_80297BA0();
void fn_80297C80();
bool fn_80297E10(u8) const;
void fn_80297EA0();
void fn_80297FE0(u8);
bool fn_80298B80();
nw4r::lyt::Pane *getInOutAllPane() const {
return mLyt.findPane("N_inOutAll_00");
}
nw4r::lyt::Pane *getNotePane(s32 idx) const {
return mpPanes[idx];
}
u8 getField_0x2251(s32 idx) const {
return field_0x2251[idx];
}
void setField_0x2251(u8 idx, u8 val) {
if (field_0x2251[idx] != val) {
field_0x2251[idx] = val;
}
}
void setField_0x2251_(u8 idx, u8 val) {
field_0x2251[idx] = val;
}
private:
STATE_FUNC_DECLARE(dLytMeterSuiryuScoreBase_c, None);
STATE_FUNC_DECLARE(dLytMeterSuiryuScoreBase_c, In);
STATE_FUNC_DECLARE(dLytMeterSuiryuScoreBase_c, Wait);
STATE_FUNC_DECLARE(dLytMeterSuiryuScoreBase_c, Out);
void initAnm();
bool fn_80298600();
/* 0x0004 */ UI_STATE_MGR_DECLARE(dLytMeterSuiryuScoreBase_c);
/* 0x0040 */ d2d::LytBase_c mLyt;
/* 0x00D0 */ d2d::AnmGroup_c mAnm[129];
/* 0x2110 */ nw4r::lyt::Pane *mpPanes[77];
/* 0x2244 */ nw4r::lyt::Pane *mpPaneInOutAll;
/* 0x2248 */ mVec2_c mMainTranslate;
/* 0x2250 */ u8 field_0x2250;
/* 0x2251 */ u8 field_0x2251[17];
/* 0x2262 */ u8 field_0x2262;
/* 0x2263 */ u8 field_0x2263;
/* 0x2264 */ UNKWORD field_0x2264;
};
class dLytMeterClefMain_c {
private:
static const s32 NUM_TADTONE_GROUPS = 17;
static const s32 NUM_TOTAL_TADTONES = 77;
public:
dLytMeterClefMain_c()
: mStateMgr(*this),
field_0x0040(0),
field_0x5E4C(0),
field_0x5E4D(0),
field_0x5F35(0),
field_0x5F36(0),
field_0x5F38(0),
field_0x5F3C(0),
field_0x5F40(0) {}
virtual ~dLytMeterClefMain_c() {}
bool build(d2d::ResAccIf_c *resAcc);
bool remove();
bool execute();
bool draw();
private:
void startIn();
void startOut();
void fn_80299DF0();
void fn_80299E30();
void fn_8029A050();
void fn_8029A200();
void fn_8029A260();
void fn_8029A2C0();
void fn_8029A3B0();
void fn_8029A440();
STATE_FUNC_DECLARE(dLytMeterClefMain_c, None);
STATE_FUNC_DECLARE(dLytMeterClefMain_c, In);
STATE_FUNC_DECLARE(dLytMeterClefMain_c, Wait);
STATE_FUNC_DECLARE(dLytMeterClefMain_c, Out);
/* 0x0004 */ UI_STATE_MGR_DECLARE(dLytMeterClefMain_c);
/* 0x0040 */ u8 field_0x0040;
/* 0x0044 */ dLytMeterSuiryuScoreBase_c mBase;
/* 0x22AC */ dLytNote2_c mNotes[24];
/* 0x5E4C */ u8 field_0x5E4C;
/* 0x5E4D */ u8 field_0x5E4D;
/* 0x5E4E */ u8 field_0x5E4E[NUM_TADTONE_GROUPS];
/* 0x5E5F */ u8 field_0x5E5F[NUM_TADTONE_GROUPS];
/* 0x5E70 */ u8 field_0x5E70[NUM_TADTONE_GROUPS];
/* 0x5E81 */ u8 field_0x5E81[NUM_TADTONE_GROUPS];
/* 0x5E92 */ u8 field_0x5E92[NUM_TADTONE_GROUPS];
/* 0x5EA4 */ UNKWORD field_0x5EA4[NUM_TADTONE_GROUPS];
/* 0x5EE8 */ u8 field_0x5EE8[NUM_TOTAL_TADTONES];
/* 0x5F35 */ u8 field_0x5F35;
/* 0x5F36 */ u8 field_0x5F36;
/* 0x5F38 */ UNKWORD field_0x5F38;
/* 0x5F3C */ UNKWORD field_0x5F3C;
/* 0x5F40 */ UNKWORD field_0x5F40;
};
// Alternative name ideas: dLytMeterClef_c, dLytMeterSuiryuScore_c
// The profile name is LYT_SUIRYU_SCORE so I went with that class name,
// but the fact that it contains a dLytMeterClefMain_c (known name) is suspicious...
class dLytSuiryuScore_c : public dBase_c {
public:
dLytSuiryuScore_c() {}
virtual ~dLytSuiryuScore_c() {}
virtual int create() override;
virtual int doDelete() override;
virtual int execute() override;
virtual int draw() override;
private:
static dLytSuiryuScore_c *sInstance;
/* 0x0060 */ d2d::ResAccIf_c mResAcc;
/* 0x03D8 */ dLytMeterClefMain_c mMain;
};
#endif
+13 -7
View File
@@ -91,7 +91,7 @@ public:
bool isNotSilentRealmOrLoftwing();
bool fn_800C9F70();
bool shouldHideLytClef();
bool fn_800C9FE0();
bool isPopupOpen();
@@ -102,7 +102,7 @@ public:
void fn_800D5630();
bool isInModeMap();
bool isInModePause();
bool fn_800D56B0();
bool shouldBeHiddenGeneral();
void checkPaneVisibility();
bool execute();
@@ -198,7 +198,7 @@ private:
/* 0x13772 */ bool field_0x13772;
/* 0x13773 */ bool field_0x13773;
/* 0x13774 */ bool mHelpOpen;
/* 0x13775 */ bool field_0x13775;
/* 0x13775 */ bool mIsCollectingTadtoneScroll;
/* 0x13776 */ bool mTimerVisible;
/* 0x13777 */ bool mBirdGaugeVisible;
/* 0x13778 */ bool mSkyGaugeVisible;
@@ -310,8 +310,8 @@ public:
mMain.mHelpOpen = val;
}
void setMeterField_0x13775(bool val) {
mMain.field_0x13775 = val;
void setIsCollectingTadtoneScroll(bool val) {
mMain.mIsCollectingTadtoneScroll = val;
}
bool getMeterField_0x1377F() const {
@@ -334,6 +334,12 @@ public:
mFlags = 0xFFFFFFFF;
}
static void setGanbariClefRelated(bool arg) {
if (sInstance != nullptr) {
sInstance->mMain.mGanbariGauge.setClefRelated(arg);
}
}
static dLytMeterCrossBtn_c::CrossIcon_e getCrossIconDown() {
if (sInstance != nullptr) {
return sInstance->mMain.mCrossBtn.getIconDown();
@@ -452,9 +458,9 @@ public:
}
}
static bool getfn_800C9F70() {
static bool shouldHideLytClef() {
if (sInstance != nullptr) {
return sInstance->mMain.fn_800C9F70();
return sInstance->mMain.shouldHideLytClef();
} else {
return false;
}
@@ -35,6 +35,10 @@ public:
mStaminaPercent = value;
}
void setClefRelated(bool v) {
mClefRelated = v;
}
void setField_0x539(bool v) {
field_0x539 = v;
}
@@ -87,12 +91,11 @@ private:
/* 0x548 */ s32 field_0x548;
/* 0x54C */ f32 field_0x54C;
/* 0x550 */ f32 field_0x550;
/* 0x554 */ f32 field_0x554;
u8 field_0x558;
u8 field_0x559;
bool field_0x55A;
u8 field_0x55B;
/* 0x558 */ u8 field_0x558;
/* 0x559 */ bool mClefRelated;
/* 0x55A */ bool field_0x55A;
/* 0x55B */ u8 field_0x55B;
};
STATIC_ASSERT(sizeof(dLytMeterGanbariGauge_c) == 0x55C);
+19
View File
@@ -8,7 +8,26 @@ public:
dTgClefGame_c() {}
virtual ~dTgClefGame_c() {}
static dTgClefGame_c *GetInstance() {
return sInstance;
}
u8 getField_0x14C(s32 idx) const {
return field_0x14C[idx];
}
u8 getField_0x15D(s32 idx) const {
return field_0x15D[idx];
}
private:
static dTgClefGame_c *sInstance;
static const s32 NUM_TADTONE_GROUPS = 17;
/* 0x0FC */ u8 _0x0FC[0x14C - 0x0FC];
/* 0x14C */ u8 field_0x14C[NUM_TADTONE_GROUPS];
/* 0x15D */ u8 field_0x15D[NUM_TADTONE_GROUPS];
};
#endif
+1
View File
@@ -1,6 +1,7 @@
#ifndef M_M2D_H
#define M_M2D_H
#include "c/c_math.h"
#include "m/m_allocator.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_arcResourceAccessor.h"
+47
View File
@@ -1,6 +1,10 @@
#ifndef MISC_ACTOR_H
#define MISC_ACTOR_H
#include "common.h"
#include "d/flag/sceneflag_manager.h"
#include "d/t/d_t_clef_game.h"
// TODO - this header might be unnecessary; a lot of functions in
// the split corresponding to this header clearly are REL functions
// that were moved to the DOL because they need to be called from the DOL.
@@ -9,4 +13,47 @@
bool checkIsInSkykeepPuzzle();
void restoreSkykeepPuzzleFromGlobal();
extern const u8 sTadtoneSceneflags[];
extern const u8 sTadtoneGroupSizes[];
inline bool isValidTadtoneGroupIndex(s32 i) {
return 0 <= i && i <= 17 - 1;
}
inline void unkTadtoneInline(s32 i, u8 *result) {
if (result != nullptr) {
if (isValidTadtoneGroupIndex(i)) {
if (SceneflagManager::sInstance->isNotTempOrZoneFlag(sTadtoneSceneflags[i])) {
if (SceneflagManager::sInstance->checkTempOrSceneflag(sTadtoneSceneflags[i])) {
*result = sTadtoneGroupSizes[i];
} else if (dTgClefGame_c::GetInstance() == nullptr) {
*result = 0;
} else {
*result = dTgClefGame_c::GetInstance()->getField_0x14C(i);
}
} else {
*result = sTadtoneGroupSizes[i];
}
}
}
}
inline void unkTadtoneInline2(s32 i, u8 *result) {
if (result != nullptr) {
if (isValidTadtoneGroupIndex(i)) {
*result = sTadtoneGroupSizes[i];
}
}
}
inline void unkTadtoneInline3(s32 i, u8 *result) {
if (result != nullptr) {
if (isValidTadtoneGroupIndex(i)) {
if (dTgClefGame_c::GetInstance() != nullptr) {
*result = dTgClefGame_c::GetInstance()->getField_0x15D(i);
}
}
}
}
#endif