d_scope 100% (#1112)

* First version of d_scope, everything is matching on all version, probably missing a few inline on undocumented field that i did not manage to find

* Readd stuff previously deleted but badly tested

* Rename some fields and a few more inline

doesn't improve matching but i think it looks more genuine

* clean up syntax

* move d_scptyp enum and add forgotten inline

* build fix

* replace seStart call with proper enum
This commit is contained in:
Benjamin ROELANDT
2026-08-02 17:45:21 +02:00
committed by GitHub
parent 6b911411f0
commit dbc093a3cf
15 changed files with 1414 additions and 149 deletions
+31 -3
View File
@@ -474,6 +474,12 @@ public:
u8 getScopeType() { return mScopeType; }
void setScopeType(u8 type) { mScopeType = type; }
void setItemScopeWipeTimer(u8 timer) { mItemScopeWipeTimer = timer; }
f32 getItemScopeWipeScale() { return mItemScopeWipeScale; }
void setItemScopeWipeScale(f32 scale) { mItemScopeWipeScale = scale; }
bool getScopeWipeFlag() { return mScopeWipeFlag; }
void setScopeWipeFlag(bool flag) { mScopeWipeFlag = flag; }
u8 getOperateWind() { return mOperateWind; }
void setOperateWindCancelOff() { mOperateWind = 0; }
void setOperateWindChangeOff() { mOperateWind = 1; }
@@ -602,6 +608,7 @@ public:
void setActionIconArchive(JKRArchive * pArc) { mpActionIconArchive = pArc; }
JKRArchive* getActionIconArchive() { return mpActionIconArchive; }
void setScopeResArchive(JKRArchive * pArc) { mpScopeResArchive = pArc; }
JKRArchive* getScopeResArchive() { return mpScopeResArchive; }
JKRArchive* getCameraResArchive() { return mpCameraResArchive; }
void setCameraResArchive(JKRArchive * pArc) { mpCameraResArchive = pArc; }
JKRArchive* getSwimResArchive() { return mpSwimResArchive; }
@@ -772,7 +779,7 @@ public:
/* 0x4 */ s8 mCameraID;
} mPlayerInfo[1];
/* 0x48AC */ fopAc_ac_c* mpPlayerPtr[3]; // 0: Link, 1: Partner, 2: Ship
/* 0x48B8 */ f32 field_0x48b8;
/* 0x48B8 */ f32 mItemScopeWipeScale;
/* 0x48BC */ f32 mItemLifeCount;
/* 0x48C0 */ s32 mItemRupeeCount;
/* 0x48C4 */ s32 mAirMeter;
@@ -800,7 +807,7 @@ public:
/* 0x4924 */ u16 mItemNowLife;
/* 0x4926 */ s16 mItemNowRupee;
/* 0x4928 */ bool mItemSwimTimerStatus;
/* 0x4929 */ u8 field_0x4929;
/* 0x4929 */ u8 mItemScopeWipeTimer;
/* 0x492A */ u8 mMesgStatus;
/* 0x492B */ u8 mScopeMesgStatus;
/* 0x492C */ u8 field_0x492c;
@@ -855,7 +862,7 @@ public:
/* 0x4965 */ u8 field_0x4965;
/* 0x4966 */ char mInputPassword[0x11];
/* 0x4977 */ u8 mMesgBgm;
/* 0x4978 */ u8 field_0x4978;
/* 0x4978 */ u8 mScopeWipeFlag;
/* 0x4979 */ u8 m2dShow;
/* 0x497A */ u8 field_0x497a;
/* 0x497B */ u8 field_0x497B[0x497C - 0x497B];
@@ -2752,6 +2759,26 @@ inline void dComIfGp_setScopeType(u8 type) {
g_dComIfG_gameInfo.play.setScopeType(type);
}
inline void dComIfGp_setItemScopeWipeTimer(u8 timer) {
g_dComIfG_gameInfo.play.setItemScopeWipeTimer(timer);
}
inline f32 dComIfGp_getItemScopeWipeScale() {
return g_dComIfG_gameInfo.play.getItemScopeWipeScale();
}
inline void dComIfGp_setItemScopeWipeScale(f32 scale) {
g_dComIfG_gameInfo.play.setItemScopeWipeScale(scale);
}
inline bool dComIfGp_getScopeWipeFlag() {
return g_dComIfG_gameInfo.play.getScopeWipeFlag();
}
inline void dComIfGp_setScopeWipeFlag(bool flag) {
g_dComIfG_gameInfo.play.setScopeWipeFlag(flag);
}
inline u8 dComIfGp_getOperateWind() {
return g_dComIfG_gameInfo.play.getOperateWind();
}
@@ -3937,6 +3964,7 @@ inline JKRArchive* dComIfGp_getErrorResArchive() { return g_dComIfG_gameInfo.pla
inline void dComIfGp_setActionIconArchive(JKRArchive * pArc) { g_dComIfG_gameInfo.play.setActionIconArchive(pArc); }
inline JKRArchive* dComIfGp_getActionIconArchive() { return g_dComIfG_gameInfo.play.getActionIconArchive(); }
inline void dComIfGp_setScopeResArchive(JKRArchive * pArc) { g_dComIfG_gameInfo.play.setScopeResArchive(pArc); }
inline JKRArchive* dComIfGp_getScopeResArchive() { return g_dComIfG_gameInfo.play.getScopeResArchive(); }
inline JKRArchive* dComIfGp_getCameraResArchive() { return g_dComIfG_gameInfo.play.getCameraResArchive(); }
inline void dComIfGp_setCameraResArchive(JKRArchive * pArc) { g_dComIfG_gameInfo.play.setCameraResArchive(pArc); }
inline JKRArchive* dComIfGp_getSwimResArchive() { return g_dComIfG_gameInfo.play.getSwimResArchive(); }
+2 -2
View File
@@ -31,8 +31,8 @@ public:
/* 0x01C */ f32 field_0x1c;
/* 0x020 */ f32 field_0x20;
/* 0x024 */ f32 field_0x24;
/* 0x028 */ f32 field_0x28;
/* 0x02C */ u8 field_0x2c;
/* 0x028 */ f32 mScopeWipeMaxScale;
/* 0x02C */ u8 mScopeWipeAlpha;
/* 0x02D */ u8 field_0x2d;
/* 0x02E */ s16 field_0x2e;
/* 0x030 */ s16 field_0x30;
+65 -6
View File
@@ -3,18 +3,77 @@
#include "dolphin/types.h"
#include "f_op/f_op_msg.h"
#include "f_op/f_op_msg_mng.h"
#include "JSystem/JUtility/TColor.h"
#include "d/d_drawlist.h"
class J2DTextBox;
enum dScpTyp {
dScpTyp_TELESCOPE_e = 0, // default/normal telescope
dScpTyp_PICTO_BOX_e = 1,
dScpTyp_DEMO_e = 2,
};
class sub_scp_class : public msg_class {
public:
/* Place member variables here */
};
/* 0x0FC */ JKRExpHeap* mpHeap;
/* 0x100 */ mesg_header* head_p;
/* 0x104 */ fopMsgM_pane_class mWipeCross;
/* 0x13C */ fopMsgM_pane_class mWipeNum;
/* 0x174 */ fopMsgM_pane_class mWipeCrossKage;
/* 0x1AC */ fopMsgM_pane_class mWipeNumKage;
/* 0x1E4 */ fopMsgM_pane_class mWipeBarA;
/* 0x21C */ fopMsgM_pane_class mWipeBarPivot;
/* 0x254 */ fopMsgM_pane_class mWipeScope;
/* 0x28C */ fopMsgM_pane_class mCursorReturn;
/* 0x2C4 */ fopMsgM_pane_class mCursorZoom;
/* 0x2FC */ fopMsgM_pane_class mCursorReturnAnime;
/* 0x334 */ fopMsgM_pane_class mCursorZoomAnime;
/* 0x36C */ fopMsgM_pane_class mArrowL;
/* 0x3A4 */ fopMsgM_pane_class mArrowR;
/* 0x3DC */ fopMsgM_pane_class mWipePanel[8];
/* 0x59C */ fopMsgM_pane_class mArrow;
/* 0x5D4 */ fopMsgM_pane_class mDot;
/* 0x60C */ J2DTextBox* mpTextBox;
/* 0x610 */ J2DTextBox* mpRubyBox;
/* 0x614 */ J2DTextBox* mpTextBoxSdw;
/* 0x618 */ J2DTextBox* mpRubyBoxSdw;
/* 0x61C */ JMSMesgEntry_c mMesgEntry;
/* 0x634 */ fopMsgM_msgDataProc_c mMesgDataProc;
/* 0x8D4 */ fopMsgM_msgGet_c mMsgGet;
/* 0x8E4 */ f32 mFontSizeX;
/* 0x8E8 */ f32 mFontSizeY;
/* 0x8EC */ f32 mRubyFontSizeX;
/* 0x8F0 */ f32 mRubyFontSizeY;
/* 0x8F4 */ JUtility::TColor mDotBlackOrig;
/* 0x8F8 */ JUtility::TColor mDotBlackNow;
/* 0x8FC */ JUtility::TColor mDotWhiteOrig;
/* 0x900 */ JUtility::TColor mDotWhiteNow;
/* 0x904 */ f32 mOffsetX;
/* 0x908 */ f32 mOffsetY;
/* 0x90C */ int mArrowBaseY;
/* 0x910 */ f32 mZoomScale;
/* 0x914 */ s16 mTransTimer;
/* 0x916 */ s16 mLineCount;
/* 0x918 */ s16 mAnimeTimer;
/* 0x91C */ const char* mpMesgStr;
/* 0x920 */ char* oTx;
/* 0x924 */ char* oRb;
/* 0x928 */ char* oTxSdw;
/* 0x92C */ char* oRbSdw;
/* 0x930 */ u8 mDemoCloseFlag;
}; // Size: 0x934
class dDlst_2DSCP_c {
class dDlst_2DSCP_c : public dDlst_base_c {
public:
void setActorP(sub_scp_class*) {}
void draw();
dDlst_2DSCP_c() {}
virtual ~dDlst_2DSCP_c();
virtual void draw();
void outFontDraw();
void setActorP(sub_scp_class* i_scp) { mpScp = i_scp; }
/* 0x04 */ sub_scp_class* mpScp;
};
#endif /* D_SCOPE_H */
+5 -2
View File
@@ -10,14 +10,17 @@ enum fopMsg_MessageStatus_e {
fopMsgStts_MSG_UNK0_e = 0x00,
fopMsgStts_MSG_PREPARING_e = 0x01,
fopMsgStts_BOX_OPENING_e = 0x02,
fopMsgStts_SCOPE_OPENING_1_e = 0x03, // Scope opening (picto box type)
fopMsgStts_SCOPE_OPENING_2_e = 0x04, // Scope opening (demo type)
fopMsgStts_MSG_UNK5_e = 0x05,
fopMsgStts_MSG_TYPING_e = 0x06,
fopMsgStts_STOP_e = 0x07,
fopMsgStts_SELECT_2_e = 0x08, // Selection box with 2 choices
fopMsgStts_SELECT_3_e = 0x09, // Selection box with 3 choices
fopMsgStts_CLOSE_WAIT_e = 0x0A, // Waiting for player input before closing the text box
fopMsgStts_UNKB_e = 0x0B,
fopMsgStts_UNKD_e = 0x0D,
fopMsgStts_SCOPE_ACTIVE_e = 0x0B, // Scope active/idle
fopMsgStts_SCOPE_DEMO_e = 0x0C, // Scope demo (cutscene) mode
fopMsgStts_SCOPE_WAIT_e = 0x0D, // Scope waiting for event/demo
fopMsgStts_MSG_DISPLAYED_e = 0x0E,
fopMsgStts_MSG_CONTINUES_e = 0x0F,
fopMsgStts_MSG_ENDS_e = 0x10,
+14 -12
View File
@@ -264,7 +264,7 @@ public:
void setMesgEntry(JMSMesgEntry_c* i_entry) { mesgEntry = i_entry; }
void dec_keyWaitTimer() {}
void dec_waitTimer() {}
void dec_waitTimer() { waitTimer = (int)waitTimer > 0 ? waitTimer - 1 : 0; }
u8 getCharAlpha() { return field_0x293; } // ?
u8 getGradAlpha() { return field_0x292; } // ?
int getLineCount() { return lineCount; }
@@ -272,15 +272,15 @@ public:
f32 getNowCursorPos() { return field_0x20; }
u8 getRCharAlpha() { return field_0x291; } // ?
u8 getRGradAlpha() { return field_0x290; } // ?
void getSelectFlag() {}
u8 getSelectFlag() { return selectFlag; }
void getSelectLength() {}
void getStringColor() {}
void get_waitTimer() {}
u32 getStringColor() { return field_0x25C;}
u32 get_waitTimer() { return waitTimer; }
void resetNowLine() { nowLine = 0; }
void selectArrow(J2DPicture*) {}
void setActorPosition(cXyz*) {}
void setAimLine(int i_line) { aimLine = i_line; }
void setAutoSendFlagOff() {}
void setAutoSendFlagOff() { autoSendFlag = 0; }
void setBmgData(char* i_data) { bmgData = i_data; }
void setCenterLineWidth(int i_width) { centerLineWidth = i_width; }
@@ -294,20 +294,20 @@ public:
void setCount(int i_count) { count = i_count; }
void setFont(JUTFont* i_font) { font[0] = i_font; }
void setFontSize(int i_size) { fontSize = i_size; }
void setHandSendFlagOff() {}
void setHandSendFlagOff() { handSendFlag = 0; }
void setLineCount(int i_count) { lineCount = i_count; }
void setLineWidth(int i_width) { lineWidth = i_width; }
void setRubyFont(JUTFont* i_font) { font[1] = i_font; }
void setRubyFontSize(int i_size) { rubyFontSize = i_size; }
void setSelectFlagOff() {}
void setSelectFlagOff() { selectFlag = 0; }
void setSelectNum(u8) {}
void setSendSpeed(int i_speed) { sendSpeed = i_speed; }
void setSpaceFlagOff() { spaceFlag = 0; }
void setSpaceFlagOn() {}
void setSpaceFlagOn() { spaceFlag = 1; }
void setSpaceTimer(int i_timer) { spaceTimer = i_timer; }
void setStringColor(u32) {}
void set_waitTimer(int) {}
void set_waitTimerZero() {}
void setStringColor(u32 color) { field_0x25C = color; }
void set_waitTimer(int i_timer) { waitTimer = i_timer; }
void set_waitTimerZero() { waitTimer = 0; }
void shortCut() { field_0x299 = 1; }
// fake, replace with real inline once it's figured out
@@ -359,7 +359,7 @@ public:
/* 0x14C */ int rubyFontSize;
/* 0x150 */ int field_0x150;
/* 0x154 */ u32 field_0x154;
/* 0x158 */ u32 field_0x158;
/* 0x158 */ u32 waitTimer;
/* 0x15C */ int spaceTimer;
/* 0x160 */ int sendSpeed;
/* 0x164 */ int field_0x164; // keyWaitTimer?
@@ -461,6 +461,8 @@ void fopMsgM_setAlpha(fopMsgM_pane_alpha_class* i_pane);
u32 fopMsgM_searchMessageNumber(u32 i_msgNo);
bool fopMsgM_forceSendOn();
bool fopMsgM_checkForceSend();
void fopMsgM_forceSendOff();
void fopMsgM_messageSendOn();
void fopMsgM_messageSendOff();
bool fopMsgM_checkMessageSend();