summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-12-24 19:57:36 -0500
committerGitHub <noreply@github.com>2025-12-24 16:57:36 -0800
commit229527daf71c76965ef0735abca530cee68b7358 (patch)
tree0325055c01866d359b1556a2cbc6b65cbd238466 /include
parentcefe919b8d39cb5b60d79b1dc7452e80abdf9657 (diff)
Resolve all gameInfo fakematches (#2995)
* Clean up various inlines/fakematches/comments * Copy OptRuby inline name from TWW debug * Resolve all dEvt_control_c related fakematches, return pointer instead of reference * Fix some more missing inline usages
Diffstat (limited to 'include')
-rw-r--r--include/d/actor/d_a_alink.h2
-rw-r--r--include/d/actor/d_a_obj_table.h12
-rw-r--r--include/d/d_com_inf_game.h140
-rw-r--r--include/d/d_save.h9
-rw-r--r--include/d/d_stage.h3
5 files changed, 82 insertions, 84 deletions
diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h
index ff727effba..418aec0e84 100644
--- a/include/d/actor/d_a_alink.h
+++ b/include/d/actor/d_a_alink.h
@@ -8271,7 +8271,7 @@ static void* daAlink_searchBoar(fopAc_ac_c* param_0, void* param_1);
static fopAc_ac_c* daAlink_searchLightBall(fopAc_ac_c* p_actor, void* param_1);
inline daAlink_c* daAlink_getAlinkActorClass() {
- return (daAlink_c*)g_dComIfG_gameInfo.play.getPlayerPtr(LINK_PTR);
+ return (daAlink_c*)dComIfGp_getLinkPlayer();
}
#endif /* D_A_D_A_ALINK_H */
diff --git a/include/d/actor/d_a_obj_table.h b/include/d/actor/d_a_obj_table.h
index a52b90081d..cea036783c 100644
--- a/include/d/actor/d_a_obj_table.h
+++ b/include/d/actor/d_a_obj_table.h
@@ -15,17 +15,17 @@
*/
class daObjTable_c : public dBgS_MoveBgActor {
public:
- int CreateHeap();
- int Create();
- int Execute(Mtx**);
- int Draw();
- int Delete();
+ inline int CreateHeap();
+ inline int Create();
+ inline int Execute(Mtx**);
+ inline int Draw();
+ inline int Delete();
inline void initBaseMtx();
inline void setBaseMtx();
inline int create();
- s16 getMessageNo() { return (s16)fopAcM_GetParamBit(this, 0, 16); }
+ s16 getMessageNo() { return fopAcM_GetParam(this) & 0xFFFF; }
private:
/* 0x5A0 */ J3DModel* mpModel;
diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h
index df64a28249..c4e922971e 100644
--- a/include/d/d_com_inf_game.h
+++ b/include/d/d_com_inf_game.h
@@ -285,7 +285,7 @@ public:
dMsgObject_c* getMsgObjectClass() { return mItemInfo.mMsgObjectClass; }
dStage_roomControl_c* getRoomControl() { return &mRoomControl; }
dStage_dt_c& getStage() { return mStageData; }
- dEvt_control_c& getEvent() { return mEvent; }
+ dEvt_control_c* getEvent() { return &mEvent; }
daHorse_c* getHorseActor() { return (daHorse_c*)mPlayerPtr[1]; }
J2DGrafContext* getCurrentGrafPort() { return (J2DGrafContext*)mCurrentGrafPort; }
dVibration_c& getVibration() { return mVibration; }
@@ -566,7 +566,7 @@ public:
void setStartStageLayer(s8 layer) { mStartStage.setLayer(layer); }
const char* getNextStageName() { return mNextStage.getName(); }
- dStage_startStage_c* getNextStartStage() { return &mNextStage; }
+ dStage_startStage_c* getNextStartStage() { return mNextStage.getStartStage(); }
s8 getNextStageRoomNo() { return mNextStage.getRoomNo(); }
s8 getNextStageLayer() { return mNextStage.getLayer(); }
s16 getNextStagePoint() { return mNextStage.getPoint(); }
@@ -840,7 +840,6 @@ public:
~dComIfG_inf_c() {}
void ct();
void createBaseCsr();
- dComIfG_play_c& getPlay() { return play; } // fake inline
#if PLATFORM_WII || VERSION == VERSION_SHIELD_DEBUG
class baseCsr_c : public mDoGph_gInf_c::csr_c {
@@ -1462,27 +1461,63 @@ inline u8 dComIfGs_getSelectItemIndex(int i_no) {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectItemIndex(i_no);
}
-//TODO: actual name is unknown
-inline u8 dComIfGs_getOptUnk0() {
- return g_dComIfG_gameInfo.info.getPlayer().getConfig().getUnk0();
+// Ruby inline names are from TWW debug.
+inline u8 dComIfGs_getOptRuby() {
+ return g_dComIfG_gameInfo.info.getPlayer().getConfig().getRuby();
+}
+
+inline void dComIfGs_setOptRuby(u8 i_ruby) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setRuby(i_ruby);
}
inline u8 dComIfGs_getOptVibration() {
return g_dComIfG_gameInfo.info.getPlayer().getConfig().getVibration();
}
+inline void dComIfGs_setOptVibration(u8 i_status) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setVibration(i_status);
+}
+
inline u8 dComIfGs_getOptAttentionType() {
return g_dComIfG_gameInfo.info.getPlayer().getConfig().getAttentionType();
}
+inline void dComIfGs_setOptAttentionType(u8 i_attentionType) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setAttentionType(i_attentionType);
+}
+
inline u8 dComIfGs_getOptCameraControl() {
return g_dComIfG_gameInfo.info.getPlayer().getConfig().getCameraControl();
}
+inline void dComIfGs_setOptCameraControl(u8 i_cameraControl) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setCameraControl(i_cameraControl);
+}
+
inline u8 dComIfGs_getOptSound() {
return g_dComIfG_gameInfo.info.getPlayer().getConfig().getSound();
}
+inline void dComIfGs_setOptSound(u8 i_mode) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(i_mode);
+}
+
+inline void dComIfGs_setOptCalValue(s8 i_calValue) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalValue(i_calValue);
+}
+
+inline void dComIfGs_setOptCalibrateDist(u16 i_calibrateDist) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalibrateDist(i_calibrateDist);
+}
+
+inline u8 dComIfGs_getOptPointer() {
+ return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPointer();
+}
+
+inline void dComIfGs_setOptPointer(u8 i_pointer) {
+ g_dComIfG_gameInfo.info.getPlayer().getConfig().setPointer(i_pointer);
+}
+
inline BOOL dComIfGs_isTbox(int i_no) {
return g_dComIfG_gameInfo.info.getMemory().getBit().isTbox(i_no);
}
@@ -2034,35 +2069,6 @@ inline void dComIfGs_setLastWarpAcceptStage(s8 param_0) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().setWarpAcceptStage(param_0);
}
-//TODO: actual name is unknown
-inline void dComIfGs_setOptUnk0(u8 i_unk0) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setUnk0(i_unk0);
-}
-
-inline void dComIfGs_setOptSound(u8 i_mode) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(i_mode);
-}
-
-inline void dComIfGs_setOptVibration(u8 i_status) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setVibration(i_status);
-}
-
-inline void dComIfGs_setOptAttentionType(u8 i_attentionType) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setAttentionType(i_attentionType);
-}
-
-inline void dComIfGs_setOptCameraControl(u8 i_cameraControl) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setCameraControl(i_cameraControl);
-}
-
-inline void dComIfGs_setOptPointer(u8 i_pointer) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setPointer(i_pointer);
-}
-
-inline u8 dComIfGs_getOptPointer() {
- return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPointer();
-}
-
inline u8 dComIfGs_getNewFile() {
return g_dComIfG_gameInfo.info.getNewFile();
}
@@ -2091,14 +2097,6 @@ inline u8 dComIfGs_getWalletSize() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getWalletSize();
}
-inline void dComIfGs_setOptCalValue(s8 i_calValue) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalValue(i_calValue);
-}
-
-inline void dComIfGs_setOptCalibrateDist(u16 i_calibrateDist) {
- g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalibrateDist(i_calibrateDist);
-}
-
inline u16 dComIfGs_getFishNum(u8 param_0) {
return g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().getFishCount(param_0);
}
@@ -2572,7 +2570,7 @@ inline s8 dComIfGp_getNextStageLayer() {
return g_dComIfG_gameInfo.play.getNextStageLayer();
}
-inline s32 dComIfGp_getNextStageWipe() {
+inline s8 dComIfGp_getNextStageWipe() {
return g_dComIfG_gameInfo.play.getNextStageWipe();
}
@@ -3582,7 +3580,7 @@ inline u8 dComIfGp_getAdvanceDirection() {
return g_dComIfG_gameInfo.play.getDirection();
}
-inline dEvt_control_c& dComIfGp_getEvent() {
+inline dEvt_control_c* dComIfGp_getEvent() {
return g_dComIfG_gameInfo.play.getEvent();
}
@@ -3611,41 +3609,41 @@ inline s16 dComIfGp_getItemMaxBombNumCount() {
}
inline BOOL dComIfGp_event_compulsory(void* i_actor, const char* i_eventname, u16 i_hindFlag) {
- return g_dComIfG_gameInfo.play.getEvent().compulsory(i_actor, i_eventname, i_hindFlag);
+ return g_dComIfG_gameInfo.play.getEvent()->compulsory(i_actor, i_eventname, i_hindFlag);
}
inline int dComIfGp_event_moveApproval(void* i_actor) {
- return g_dComIfG_gameInfo.play.getEvent().moveApproval(i_actor);
+ return g_dComIfG_gameInfo.play.getEvent()->moveApproval(i_actor);
}
inline int dComIfGp_event_order(u16 i_type, u16 i_prio, u16 i_flags, u16 i_hindFlags, void* i_requestActor,
void* i_targetActor, s16 i_eventID, u8 i_mapToolId) {
- return g_dComIfG_gameInfo.play.getEvent().order(i_type, i_prio, i_flags, i_hindFlags, i_requestActor,
+ return g_dComIfG_gameInfo.play.getEvent()->order(i_type, i_prio, i_flags, i_hindFlags, i_requestActor,
i_targetActor, i_eventID, i_mapToolId);
}
inline void dComIfGp_event_setGtItm(int i_itemNo) {
- g_dComIfG_gameInfo.play.getEvent().setGtItm(i_itemNo);
+ g_dComIfG_gameInfo.play.getEvent()->setGtItm(i_itemNo);
}
inline void dComIfGp_event_reset() {
- g_dComIfG_gameInfo.play.getEvent().reset();
+ g_dComIfG_gameInfo.play.getEvent()->reset();
}
inline void dComIfGp_event_remove() {
- g_dComIfG_gameInfo.play.getEvent().remove();
+ g_dComIfG_gameInfo.play.getEvent()->remove();
}
inline void dComIfGp_event_onEventFlag(u16 i_flag) {
- g_dComIfG_gameInfo.play.getEvent().onEventFlag(i_flag);
+ g_dComIfG_gameInfo.play.getEvent()->onEventFlag(i_flag);
}
inline void dComIfGp_event_onHindFlag(u16 i_flag) {
- g_dComIfG_gameInfo.play.getEvent().onHindFlag(i_flag);
+ g_dComIfG_gameInfo.play.getEvent()->onHindFlag(i_flag);
}
inline void dComIfGp_event_offHindFlag(u16 i_flag) {
- g_dComIfG_gameInfo.play.getEvent().offHindFlag(i_flag);
+ g_dComIfG_gameInfo.play.getEvent()->offHindFlag(i_flag);
}
inline void dComIfGp_evmng_cutEnd(int i_staffId) {
@@ -3677,19 +3675,19 @@ inline int dComIfGp_evmng_cameraPlay() {
}
inline u8 dComIfGp_event_getPreItemNo() {
- return g_dComIfG_gameInfo.play.getEvent().getPreItemNo();
+ return g_dComIfG_gameInfo.play.getEvent()->getPreItemNo();
}
inline void dComIfGp_event_setItemPartner(void* i_actor) {
- g_dComIfG_gameInfo.play.getEvent().setPtI(i_actor);
+ g_dComIfG_gameInfo.play.getEvent()->setPtI(i_actor);
}
inline void dComIfGp_event_setItemPartnerId(fpc_ProcID i_id) {
- g_dComIfG_gameInfo.play.getEvent().setPtI_Id(i_id);
+ g_dComIfG_gameInfo.play.getEvent()->setPtI_Id(i_id);
}
inline u8 dComIfGp_event_getGtItm() {
- return g_dComIfG_gameInfo.play.getEvent().getGtItm();
+ return g_dComIfG_gameInfo.play.getEvent()->getGtItm();
}
inline int dComIfGp_evmng_startDemo(int i_mapToolId) {
@@ -3697,58 +3695,58 @@ inline int dComIfGp_evmng_startDemo(int i_mapToolId) {
}
inline void dComIfGp_event_setTalkPartner(void* i_actor) {
- g_dComIfG_gameInfo.play.getEvent().setPtT(i_actor);
+ g_dComIfG_gameInfo.play.getEvent()->setPtT(i_actor);
}
inline fopAc_ac_c* dComIfGp_event_getTalkPartner() {
- return g_dComIfG_gameInfo.play.getEvent().getPtT();
+ return g_dComIfG_gameInfo.play.getEvent()->getPtT();
}
inline fopAc_ac_c* dComIfGp_event_getItemPartner() {
- return g_dComIfG_gameInfo.play.getEvent().getPtI();
+ return g_dComIfG_gameInfo.play.getEvent()->getPtI();
}
inline fopAc_ac_c* dComIfGp_event_getPt1() {
- return g_dComIfG_gameInfo.play.getEvent().getPt1();
+ return g_dComIfG_gameInfo.play.getEvent()->getPt1();
}
inline fopAc_ac_c* dComIfGp_event_getPt2() {
- return g_dComIfG_gameInfo.play.getEvent().getPt2();
+ return g_dComIfG_gameInfo.play.getEvent()->getPt2();
}
inline BOOL dComIfGp_event_runCheck() {
- return g_dComIfG_gameInfo.play.getEvent().runCheck();
+ return g_dComIfG_gameInfo.play.getEvent()->runCheck();
}
inline f32 dComIfGp_event_getCullRate() {
- return g_dComIfG_gameInfo.play.getEvent().getCullRate();
+ return g_dComIfG_gameInfo.play.getEvent()->getCullRate();
}
inline u16 dComIfGp_event_checkHind(u16 i_hindFlag) {
if (!dComIfGp_event_runCheck()) {
return false;
}
- return g_dComIfG_gameInfo.play.getEvent().checkHind(i_hindFlag);
+ return g_dComIfG_gameInfo.play.getEvent()->checkHind(i_hindFlag);
}
inline u16 dComIfGp_event_chkEventFlag(u16 i_flag) {
- return g_dComIfG_gameInfo.play.getEvent().chkEventFlag(i_flag);
+ return g_dComIfG_gameInfo.play.getEvent()->chkEventFlag(i_flag);
}
inline BOOL dComIfGp_event_chkTalkXY() {
- return g_dComIfG_gameInfo.play.getEvent().chkTalkXY();
+ return g_dComIfG_gameInfo.play.getEvent()->chkTalkXY();
}
inline void dComIfGp_event_setCullRate(f32 i_rate) {
- g_dComIfG_gameInfo.play.getEvent().setCullRate(i_rate);
+ g_dComIfG_gameInfo.play.getEvent()->setCullRate(i_rate);
}
inline u8 dComIfGp_event_getMode() {
- return g_dComIfG_gameInfo.play.getEvent().getMode();
+ return g_dComIfG_gameInfo.play.getEvent()->getMode();
}
inline fopAc_ac_c* dComIfGp_event_getDoorPartner() {
- return g_dComIfG_gameInfo.play.getEvent().getPtD();
+ return g_dComIfG_gameInfo.play.getEvent()->getPtD();
}
inline int dComIfGp_evmng_getMyStaffId(const char* i_staffname, fopAc_ac_c* i_actor, int i_tagId) {
diff --git a/include/d/d_save.h b/include/d/d_save.h
index e8eccb9d1b..fff3db0a7a 100644
--- a/include/d/d_save.h
+++ b/include/d/d_save.h
@@ -506,10 +506,9 @@ public:
void setVibration(u8 i_status);
u8 getPalLanguage() const;
- //TODO: placeholder name, actual name is not known
- u8 getUnk0() { return unk0; }
- void setUnk0(u8 i_unk0) { unk0 = i_unk0; }
-
+ // Ruby inline names are from TWW debug.
+ u8 getRuby() { return mRuby; }
+ void setRuby(u8 i_ruby) { mRuby = i_ruby; }
u8 getAttentionType() { return mAttentionType; }
void setAttentionType(u8 i_mAttentionType) { mAttentionType = i_mAttentionType; }
u16 getCalibrateDist() { return mCalibrateDist; }
@@ -532,7 +531,7 @@ public:
};
private:
- /* 0x0 */ u8 unk0;
+ /* 0x0 */ u8 mRuby;
/* 0x1 */ u8 mSoundMode;
/* 0x2 */ u8 mAttentionType; // Lock-On Type; 0 : hold, 1 : switch
/* 0x3 */ u8 mVibration; // Rumble status
diff --git a/include/d/d_stage.h b/include/d/d_stage.h
index 4afb1e9afb..2838afa6a7 100644
--- a/include/d/d_stage.h
+++ b/include/d/d_stage.h
@@ -1100,7 +1100,7 @@ public:
static void setZoneNo(int, int);
static dBgp_c* getBgp(int i_roomNo) {
#if DEBUG
- // NONMATCHING
+ // DEBUG NONMATCHING
#else
return NULL;
#endif
@@ -1230,6 +1230,7 @@ public:
BOOL isEnable() const { return enabled; }
s8 getWipe() const { return wipe; }
u8 getWipeSpeed() const { return wipe_speed; }
+ dStage_startStage_c* getStartStage() { return this; }
private:
s8 enabled;