Various d_ work (#2968)

* map work

* various meter work

* d_meter_button ShieldD almost equivalent

* error fix
This commit is contained in:
Carco_21
2025-12-20 21:06:17 -05:00
committed by GitHub
parent a1c691ec92
commit c434c2edde
20 changed files with 949 additions and 353 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ public:
virtual void writeLoop_(const void* pBuffer, s32 size, u32 pos);
virtual void writeDone_(s32 len);
virtual void waitMessage_();
virtual s32 getFileSize() const;
virtual s32 getFileSize() const { return mFileLength; }
/* 0x04 */ u32 mHandle;
/* 0x08 */ s32 mFileLength;
+2
View File
@@ -1112,6 +1112,8 @@ public:
void CorrectCenter() { setFlag(0x40000000); }
int Gear() { return mGear; }
static engine_fn engine_tbl[];
/* 0x000 */ camera_class* field_0x0;
+1 -1
View File
@@ -351,7 +351,7 @@ public:
u8 getYSetFlagForce() { return mItemInfo.mYSetFlagForce; }
u8 getFaceAnimeID() { return mItemInfo.mFaceAnimeID; }
u8 getBaseAnimeID() { return mItemInfo.mBaseAnimeID; }
bool isCStickSetFlag(u8 flag) { return mItemInfo.mCStickSetFlag & flag; }
bool isCStickSetFlag(u8 flag) { return (mItemInfo.mCStickSetFlag & flag) ? true : false; }
bool isDoSetFlag(u8 flag) { return (mItemInfo.mDoSetFlag & flag) ? true : false; }
bool isASetFlag(u8 flag) { return (mItemInfo.mASetFlag & flag) ? true : false; }
bool isRSetFlag(u8 flag) { return (mItemInfo.mRSetFlag & flag) ? true : false; }
+29 -7
View File
@@ -2,6 +2,11 @@
#define D_MAP_D_MAP_H
#include "d/d_map_path_dmap.h"
#include "JSystem/JHostIO/JORReflexible.h"
struct dMap_HIO_prm_res_src_s {
};
class dMap_HIO_list_c : public dMpath_HIO_n::hioList_c {
public:
@@ -21,10 +26,11 @@ public:
virtual u32 addStringBinary(char*, u32, u32);
/* 0x04 */ u8 field_0x4[0x08 - 0x04];
/* 0x08 */ dMap_HIO_list_c field_0x8;
/* 0x08 */ dMap_HIO_list_c mList;
static dMap_HIO_c* mMySelfPointer;
static dMpath_HIO_n::list_s l_list;
static dMap_HIO_prm_res_src_s* m_res_src_p;
};
struct dMap_prm_res_s {
@@ -114,6 +120,7 @@ public:
void setMapPaletteColorAlphaPer(int, int, f32);
void resCopy();
dMap_c(int, int, int, int);
void changeTextureSize(int, int, int);
void _remove();
void getMapMinMaxXZ(int, f32*, f32*, f32*, f32*);
void getPack(int, f32*, f32*);
@@ -141,11 +148,15 @@ public:
ResTIMG* getResTIMGPointer() { return mResTIMG; }
f32 getTopEdgePlus() { return mTopEdgePlus; }
f32 getPackPlusZ() { return mPackPlusZ; }
f32 getPackZ() { return mPackZ; }
f32 getTexelPerCm() { return 1.0f / field_0x58; }
u16 getTexSizeY() { return mTexSizeY; }
f32 getPackZ() const { return mPackZ; }
f32 getTexelPerCm() const { return 1.0f / field_0x58; }
u16 getTexSizeY() const { return mTexSizeH; }
f32 getRightEdgePlus() { return mRightEdgePlus; }
f32 getPackX() { return mPackX; }
f32 getPackX() const { return mPackX; }
int getStayRoomNo() const { return mStayRoomNo; }
f32 getCenterZ() const { return mCenterZ; }
static dMap_c* m_mySelfPointer;
private:
/* 0x40 */ dMap_prm_res_s* m_res_src;
@@ -162,8 +173,8 @@ private:
/* 0x6C */ f32 mRightEdgePlus;
/* 0x70 */ f32 mTopEdgePlus;
/* 0x74 */ int field_0x74;
/* 0x78 */ u16 mTexSizeX;
/* 0x7A */ u16 mTexSizeY;
/* 0x78 */ u16 mTexSizeW;
/* 0x7A */ u16 mTexSizeH;
/* 0x7C */ int mStayRoomNo;
/* 0x80 */ int field_0x80;
/* 0x84 */ int field_0x84;
@@ -175,4 +186,15 @@ private:
/* 0x90 */ u8 field_0x90;
}; // Size: 0x94
#if DEBUG
class dMpath_RGBA_c {
public:
GXColor getGXColor() { return mColor; }
GXColor mColor;
virtual ~dMpath_RGBA_c() {}
};
#endif
#endif /* D_MAP_D_MAP_H */
+4 -2
View File
@@ -2,6 +2,7 @@
#define D_MAP_D_MAP_PATH_H
#include "d/d_drawlist.h"
#include "JSystem/JHostIO/JORMContext.h"
namespace dMpath_HIO_n {
struct list_s {
@@ -11,14 +12,14 @@ namespace dMpath_HIO_n {
class hioList_c {
public:
/* 0x00 */ list_s field_0x0;
/* 0x00 */ list_s mList;
virtual ~hioList_c() {}
virtual void copySrcToHio() = 0;
virtual void copyHioToDst() = 0;
virtual void copyBufToHio(const char*) = 0;
void set(const list_s& param_1) { field_0x0 = param_1; }
void set(const list_s& param_1) { mList = param_1; }
void gen(JORMContext*);
void update(JORMContext*);
u32 addString(char*, u32, u32) const;
@@ -152,6 +153,7 @@ public:
virtual const GXColor* getDecoLineColor(int, int);
virtual s32 getDecorationLineWidth(int);
f32 getCmPerTexel() const { return mCmPerTexel; }
bool isDrawAreaCheck(const Vec& param_0) {
return (param_0.x >= mPosX - field_0x8 * 2.0f &&
param_0.x <= mPosX + field_0x8 * 2.0f) &&
+3 -1
View File
@@ -96,7 +96,9 @@ public:
virtual ~dMenu_Option_c();
u8 getQuitStatus() { return mQuitStatus; }
u8 isUseFlag(u8 i_flag) { return (mUseFlag & i_flag) != 0; }
bool isUseFlag(u8 i_flag) {
return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false;
}
private:
/* 0x004 */ J2DScreen* mpBackScreen;
+1 -1
View File
@@ -261,7 +261,7 @@ public:
void setItemParamZ(u8);
void setItemParamB(u8);
bool getFishingType();
bool getCanoeFishing();
u8 getCanoeFishing();
bool getCameraSubject();
bool getItemSubject();
bool getPlayerSubject();
+4 -4
View File
@@ -123,14 +123,14 @@ public:
void setPauseStatus(u8 i_status) { mPauseStatus = i_status; }
void resetPauseStatus() { mPauseStatus = 0; }
u8 getPauseStatus() { return mPauseStatus; }
bool isGameStatus(int i_status) { return mGameStatus & i_status; }
bool isGameStatus(int i_status) { return (mGameStatus & (u16)i_status) != 0 ? true : false; }
bool isTouchKeyCheck(int i_status) { return mTouchKeyCheck & (1 << i_status); }
// fake function, should be isTouchKeyCheck
bool isTouchKeyCheck_alt(int i_status) { return (mTouchKeyCheck >> i_status) & 1; }
void setMapKeyDirection(u16 i_direction) { mMapKeyDirection = i_direction; }
bool isSub2DStatus(int i_flag) { return mSub2DStatus & (1 << i_flag); }
bool isSub2DStatus(int i_flag) { return (mSub2DStatus & (u16)(1 << i_flag)) != 0 ? true : false; }
void offMenuInForce(int i_flag) { unk_0x98 &= ~(1 << i_flag); }
bool isMenuInForce(int i_flag) { return unk_0x98 & (1 << i_flag); }
u16 getMapKeyDirection() { return mMapKeyDirection; }
@@ -173,7 +173,7 @@ public:
u16 getFloatingFlowID() { return mFloatingFlowID; }
bool isFloatingMessageWakuVisible() { return mFloatingMessageWakuVisible; }
void onBlinkButton(int i_flag) { mBlinkButton |= i_flag; }
bool isBlinkButton(int i_flag) { return mBlinkButton & i_flag; }
bool isBlinkButton(int i_flag) { return (mBlinkButton & (u16)i_flag) != 0 ? true : false; }
void resetBlinkButton() { mBlinkButton = 0; }
s16 getFloatingMessageTimer() { return mFloatingMessageTimer; }
u16 getFloatingMessageID() { return mFloatingMessageID; }
@@ -739,7 +739,7 @@ inline s16 dMeter2Info_getFloatingMessageTimer() {
return g_meter2_info.getFloatingMessageTimer();
}
inline u32 dMeter2Info_getFloatingMessageID() {
inline u16 dMeter2Info_getFloatingMessageID() {
return g_meter2_info.getFloatingMessageID();
}
+8 -8
View File
@@ -753,7 +753,7 @@ public:
/* 0x2C4 */ f32 mButtonATextSpacing;
/* 0x2C8 */ s32 mButtonATextActionID;
/* 0x2CC */ u32 field_0x2cc;
/* 0x2D0 */ bool mButtonATextDebug;
/* 0x2D0 */ u8 mButtonATextDebug;
/* 0x2D4 */ f32 mButtonBFontScale;
/* 0x2D8 */ f32 mButtonBFontPosX;
/* 0x2DC */ f32 mButtonBFontPosY;
@@ -840,13 +840,13 @@ public:
/* 0x420 */ s16 mButtonCrossMoveFrame;
/* 0x422 */ s16 field_0x422;
/* 0x424 */ s16 field_0x424;
/* 0x426 */ bool mButtonDebug[4];
/* 0x426 */ u8 mButtonDebug[4];
/* 0x42A */ u8 mButtonXYItemDimAlpha;
/* 0x42B */ u8 mButtonXYBaseDimAlpha;
/* 0x42C */ u8 field_0x42c;
/* 0x42D */ u8 mMaxSpurAmount;
/* 0x42E */ bool mSpurDebug;
/* 0x42F */ bool field_0x42f;
/* 0x42E */ u8 mSpurDebug;
/* 0x42F */ u8 field_0x42f;
/* 0x430 */ JUtility::TColor mSpurIconPikariFrontInner;
/* 0x434 */ JUtility::TColor mSpurIconPikariFrontOuter;
/* 0x438 */ JUtility::TColor mSpurIconPikariBackInner;
@@ -921,9 +921,9 @@ public:
/* 0x55C */ u32 mMessageID;
/* 0x560 */ u32 mFlowID;
/* 0x564 */ s16 mMessageDuration;
/* 0x566 */ bool mMessageDebug;
/* 0x567 */ bool mFlowDebug;
/* 0x568 */ bool mItemScaleAdjustON;
/* 0x566 */ u8 mMessageDebug;
/* 0x567 */ u8 mFlowDebug;
/* 0x568 */ u8 mItemScaleAdjustON;
/* 0x569 */ u8 mItemScalePercent;
/* 0x56C */ f32 mTouchAreaUnselectScale[5];
/* 0x580 */ f32 mTouchAreaSelectScale[5];
@@ -937,7 +937,7 @@ public:
/* 0x5F0 */ JUtility::TColor mTouchAreaSelectWhite[3];
/* 0x5FC */ JUtility::TColor mTouchAreaSelectBlack[3];
/* 0x608 */ s16 mTouchAreaSelectFrameNum;
/* 0x60A */ bool field_0x60a;
/* 0x60A */ u8 field_0x60a;
/* 0x60C */ f32 mLanternIconMeterPosX;
/* 0x610 */ f32 mLanternIconMeterPosY;
/* 0x614 */ f32 mLanternIconMeterSize;
+5 -1
View File
@@ -141,8 +141,12 @@ public:
bool isSetButton(u8 i_no) { return mButtonTimers[i_no] <= 0; }
void onButtonShowBit(int i_bit) { field_0x4b0 |= (u16)(1 << i_bit); }
#if DEBUG
void offButtonShowBit(int i_bit) { field_0x4b0 &= (u16)~(u16)(1 << i_bit); }
#else
void offButtonShowBit(int i_bit) { field_0x4b0 &= ~(u16)(1 << i_bit); }
bool isButtonShowBit(int i_bit) { return field_0x4b0 & (u16)(1 << i_bit); }
#endif
bool isButtonShowBit(int i_bit) { return field_0x4b0 & (u16)(1 << i_bit) ? true : false; }
static const int BUTTON_NUM = 22;
+41 -32
View File
@@ -2,6 +2,7 @@
#define D_METER_D_METER_MAP_H
#include "d/d_map_path_dmap.h"
#include "JSystem/JHostIO/JORReflexible.h"
class J2DPicture;
class dMap_c;
@@ -12,43 +13,47 @@ public:
dMeter_map_HIO_c();
virtual void listenPropertyEvent(const JORPropertyEvent*);
virtual void genMessage(JORMContext*);
virtual ~dMeter_map_HIO_c();
virtual ~dMeter_map_HIO_c() {
mMySelfPointer = NULL;
mAreaMap = NULL;
field_0x38 = 0;
}
void update();
static dMeter_map_HIO_c* mMySelfPointer;
private:
/* 0x04 */ u8 field_0x4;
/* 0x05 */ u8 field_0x5;
/* 0x06 */ u8 field_0x6;
/* 0x07 */ u8 field_0x7;
/* 0x08 */ s16 field_0x8;
/* 0x0A */ s16 field_0xa;
/* 0x0C */ s16 field_0xc;
/* 0x0E */ s16 field_0xe;
/* 0x10 */ s16 field_0x10;
/* 0x12 */ s16 field_0x12;
/* 0x14 */ s16 field_0x14;
/* 0x04 */ s8 field_0x4;
/* 0x05 */ u8 mDebugMapExpansion;
/* 0x06 */ u8 mMapDisplayLocation;
/* 0x08 */ s16 mWideBottomLeftX;
/* 0x0A */ s16 mWideY;
/* 0x0C */ s16 mNormalBottomLeftX;
/* 0x0E */ s16 mNormalY;
/* 0x10 */ s16 mGcBottomLeftX;
/* 0x12 */ s16 mGcY;
/* 0x14 */ s16 mHiddenRightX;
/* 0x16 */ u8 field_0x16;
/* 0x17 */ u8 field_0x17;
/* 0x17 */ u8 mSizeTypeChange;
/* 0x18 */ s16 field_0x18;
/* 0x1A */ s16 field_0x1a;
/* 0x1C */ s16 field_0x1c;
/* 0x1E */ s16 field_0x1e;
/* 0x20 */ s16 field_0x20;
/* 0x22 */ s16 field_0x22;
/* 0x24 */ s16 field_0x24;
/* 0x26 */ u8 field_0x26;
/* 0x27 */ u8 field_0x27[0x2a - 0x27];
/* 0x1A */ s16 mMediumHorizontal;
/* 0x1C */ s16 mMediumVertical;
/* 0x1E */ s16 mBigHorizontal;
/* 0x20 */ s16 mBigVertical;
/* 0x22 */ s16 mSmallHorizontal;
/* 0x24 */ s16 mSmallVertical;
/* 0x26 */ u8 mMapDisplaySize;
/* 0x28 */ s16 field_0x28;
/* 0x2A */ s16 field_0x2a;
/* 0x2C */ u8 field_0x2c;
/* 0x2D */ u8 field_0x2d;
/* 0x2E */ u8 field_0x2e;
/* 0x2F */ u8 field_0x2f;
/* 0x2C */ u8 mMapAlphaTest;
/* 0x2D */ u8 mAlpha;
/* 0x2E */ u8 mTextureResolutionHalved;
/* 0x2F */ u8 mForcedMapTopEdgeChange;
/* 0x30 */ s16 field_0x30;
/* 0x32 */ u8 field_0x32;
/* 0x33 */ u8 field_0x33;
/* 0x34 */ dMap_HIO_c* field_0x34;
/* 0x32 */ u8 mMapDisplayProhibited;
/* 0x33 */ u8 mMapRenderingProhibited;
/* 0x34 */ dMap_HIO_c* mAreaMap;
/* 0x38 */ int field_0x38;
};
class dMeterMap_c : public dDlst_base_c {
@@ -68,6 +73,8 @@ public:
static bool isMapOpenCheck();
dMeterMap_c(J2DScreen*);
void _create(J2DScreen*);
void setDispPosOutSide();
void setDispPosInSide();
void _delete();
void _move(u32);
void _draw();
@@ -83,17 +90,19 @@ public:
virtual ~dMeterMap_c();
bool isDispPosInsideFlg() { return field_0x2d != 0; }
dMeterMap_c* getMapPointer() { return (dMeterMap_c*)mMap; }
void setSizeW(f32 w) { mSizeW = w; }
void setSizeH(f32 h) { mSizeH = h; }
enum { MAP_SIZE_TYPE_BIG = 2, MAP_SIZE_TYPE_SMALL = 3, MAP_SIZE_TYPE_STAGE = 7 };
enum { MAP_SIZE_TYPE_BIG = 2, MAP_SIZE_TYPE_SMALL = 3, MAP_SIZE_TYPE_MEDIUM = 4, MAP_SIZE_TYPE_STAGE = 7 };
static dMeterMap_c* mMySelfPointer;
private:
#if DEBUG
/* 0x04 */ u8 field_0x4_debug;
/* 0x08 */ int field_0x8_debug;
#endif
private:
/* 0x04 */ J2DPicture* mMapJ2DPicture;
/* 0x08 */ dMap_c* mMap;
/* 0x0C */ s32 mIsCompass;
+3 -3
View File
@@ -54,7 +54,7 @@ public:
void changeGroupLocal(s16);
bool getStringLocal(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, char*,
char*, char*, s16*);
u8 isGetItemMessage();
bool isGetItemMessage();
bool isKanbanMessage();
bool isHowlMessage();
bool isMidonaMessage();
@@ -424,7 +424,7 @@ inline void dMsgObject_setTalkActor(fopAc_ac_c* actor) {
inline bool dMsgObject_getString(u32 param_0, J2DTextBox* param_1, J2DTextBox* param_2,
JUTFont* param_3, COutFont_c* param_4, char* param_5,
char* param_6, char* param_7, s16* param_8) {
return dMsgObject_c::getString(param_0, param_1, param_2, param_3, param_4, param_5, param_6,
return dMsgObject_getMsgObjectClass()->getString(param_0, param_1, param_2, param_3, param_4, param_5, param_6,
param_7, param_8);
}
@@ -493,7 +493,7 @@ inline void dMsgObject_onMsgSend() {
}
inline bool dMsgObject_isFukidashiCheck() {
return dMsgObject_getMsgObjectClass()->getScrnDrawPtr() != NULL ? true : false;
return dMsgObject_getMsgObjectClass()->getScrnDrawPtr() == NULL ? false : true;
}
inline void* dMsgObject_getTalkHeap() {
+10 -3
View File
@@ -80,6 +80,13 @@ struct stage_stag_info_class {
/* 0x2C */ u8 mParticleNo[16];
}; // Size: 0x3C
class dStage_stagInfo_c {
public:
enum {
/* 0x1 */ UB_D_MAP = 1,
};
};
// SCLS
struct stage_scls_info_class {
/* 0x0 */ char mStage[8];
@@ -1358,7 +1365,7 @@ inline u32 dStage_stagInfo_GetParticleNo(stage_stag_info_class* p_info) {
return (p_info->field_0x0a >> 0x3) & 0xFF;
}
inline s16 dStage_stagInfo_GetUpButton(stage_stag_info_class* p_info) {
inline s32 dStage_stagInfo_GetUpButton(stage_stag_info_class* p_info) {
return p_info->field_0x0a & 7;
}
@@ -1475,11 +1482,11 @@ inline f32 dStage_FileList2_dt_GetRightRmX(dStage_FileList2_dt_c* p_fList2) {
return p_fList2->mRightRmX;
}
inline f32 dStage_FileList2_dt_GetInnerRmZ(dStage_FileList2_dt_c* p_fList2) {
inline f32 dStage_FileList2_dt_GetInnerRmZ(const dStage_FileList2_dt_c* p_fList2) {
return p_fList2->mInnerRmZ;
}
inline f32 dStage_FileList2_dt_GetFrontRmZ(dStage_FileList2_dt_c* p_fList2) {
inline f32 dStage_FileList2_dt_GetFrontRmZ(const dStage_FileList2_dt_c* p_fList2) {
return p_fList2->mFrontRmZ;
}