mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-07 05:14:58 -04:00
d_a_goal_flag - matching (#918)
* initial work on d_a_goal_flag * Update config.yml to extract symbols from d_a_goal_flag; also add l_pos and l_texCoord * 17% matching in .text * daGoal_Flag_c::CreateHeap matched * RopeMove 99% * Update d_a_goal_flag.cpp * getRacePath 100% * 31% in .text * 47% matching in .text * 56% matching in .text * 70% matching in .text Add definitions to inlines in daGFlag_packet_c and fully matched some daGFlag_packet_c methods. * 84% matching in .text Match daGFlag_packet_c::draw * 91% matching in .text - Formatting tweaks - Match TimerExecute - Add fopMsgM_MiniGameTerminater_create inline - Move daGoal_Flag_c::_create in the correct place to match .data * d_a_goal_flag matching 100% for retail * d_a_goal_flag demo 99% * Resolve _create fakematch * d_a_goal_flag demo matching 100% * link d_a_goal_flag for demo * Renaming of fields/variables and some refactoring * Refactoring continued - Change direct calls to VECDotProduct to cXyz::getDotProduct * Named more HIO fields and packet fields * Implement fopMsgM_MiniGameStarter_create * Name all used HIO fields * Named all fields in daGoal_Flag_c * Finishing touches
This commit is contained in:
@@ -1564,6 +1564,18 @@ modules:
|
||||
symbols: config/D44J01/rels/d_a_goal_flag/symbols.txt
|
||||
# map: orig/D44J01/files/maps/d_a_goal_flag.map
|
||||
ldscript_template: config/GZLE01/rels/ldscript.tpl
|
||||
extract:
|
||||
- symbol: l_txa_dummy_hataTEX
|
||||
binary: assets/l_txa_dummy_hataTEX.bin
|
||||
header: assets/l_txa_dummy_hataTEX.h
|
||||
- symbol: l_goal_flag_DL
|
||||
binary: assets/l_goal_flag_DL.bin
|
||||
header: assets/l_goal_flag_DL.h
|
||||
- symbol: l_goal_flag_matDL
|
||||
binary: assets/l_goal_flag_matDL.bin
|
||||
header: assets/l_goal_flag_matDL.h
|
||||
header_type: none
|
||||
custom_type: matDL
|
||||
|
||||
- object: files/rels/d_a_gy.rel
|
||||
hash: c211c153be3b6349186f77d84bc86b13b66aa139
|
||||
|
||||
@@ -1353,6 +1353,18 @@ modules:
|
||||
splits: config/GZLE01/rels/d_a_goal_flag/splits.txt
|
||||
symbols: config/GZLE01/rels/d_a_goal_flag/symbols.txt
|
||||
ldscript_template: config/GZLE01/rels/ldscript.tpl
|
||||
extract:
|
||||
- symbol: l_txa_dummy_hataTEX
|
||||
binary: assets/l_txa_dummy_hataTEX.bin
|
||||
header: assets/l_txa_dummy_hataTEX.h
|
||||
- symbol: l_goal_flag_DL
|
||||
binary: assets/l_goal_flag_DL.bin
|
||||
header: assets/l_goal_flag_DL.h
|
||||
- symbol: l_goal_flag_matDL
|
||||
binary: assets/l_goal_flag_matDL.bin
|
||||
header: assets/l_goal_flag_matDL.h
|
||||
header_type: none
|
||||
custom_type: matDL
|
||||
|
||||
- object: files/rels/d_a_gy.rel
|
||||
hash: 6acc3205358c2770f479b59e282a84e1826874ab
|
||||
|
||||
@@ -1135,6 +1135,18 @@ modules:
|
||||
splits: config/GZLJ01/rels/d_a_goal_flag/splits.txt
|
||||
symbols: config/GZLJ01/rels/d_a_goal_flag/symbols.txt
|
||||
ldscript_template: config/GZLE01/rels/ldscript.tpl
|
||||
extract:
|
||||
- symbol: l_txa_dummy_hataTEX
|
||||
binary: assets/l_txa_dummy_hataTEX.bin
|
||||
header: assets/l_txa_dummy_hataTEX.h
|
||||
- symbol: l_goal_flag_DL
|
||||
binary: assets/l_goal_flag_DL.bin
|
||||
header: assets/l_goal_flag_DL.h
|
||||
- symbol: l_goal_flag_matDL
|
||||
binary: assets/l_goal_flag_matDL.bin
|
||||
header: assets/l_goal_flag_matDL.h
|
||||
header_type: none
|
||||
custom_type: matDL
|
||||
|
||||
- object: files/rels/d_a_gy.rel
|
||||
splits: config/GZLJ01/rels/d_a_gy/splits.txt
|
||||
|
||||
@@ -1135,6 +1135,18 @@ modules:
|
||||
splits: config/GZLP01/rels/d_a_goal_flag/splits.txt
|
||||
symbols: config/GZLP01/rels/d_a_goal_flag/symbols.txt
|
||||
ldscript_template: config/GZLE01/rels/ldscript.tpl
|
||||
extract:
|
||||
- symbol: l_txa_dummy_hataTEX
|
||||
binary: assets/l_txa_dummy_hataTEX.bin
|
||||
header: assets/l_txa_dummy_hataTEX.h
|
||||
- symbol: l_goal_flag_DL
|
||||
binary: assets/l_goal_flag_DL.bin
|
||||
header: assets/l_goal_flag_DL.h
|
||||
- symbol: l_goal_flag_matDL
|
||||
binary: assets/l_goal_flag_matDL.bin
|
||||
header: assets/l_goal_flag_matDL.h
|
||||
header_type: none
|
||||
custom_type: matDL
|
||||
|
||||
- object: files/rels/d_a_gy.rel
|
||||
splits: config/GZLP01/rels/d_a_gy/splits.txt
|
||||
|
||||
+1
-1
@@ -1599,7 +1599,7 @@ config.libs = [
|
||||
ActorRel(NonMatching, "d_a_fm"),
|
||||
ActorRel(NonMatching, "d_a_gm"),
|
||||
ActorRel(NonMatching, "d_a_gnd"),
|
||||
ActorRel(NonMatching, "d_a_goal_flag"),
|
||||
ActorRel(Matching, "d_a_goal_flag"),
|
||||
ActorRel(NonMatching, "d_a_gy"),
|
||||
ActorRel(NonMatching, "d_a_icelift"),
|
||||
ActorRel(NonMatching, "d_a_kb"),
|
||||
|
||||
+134
-31
@@ -1,50 +1,153 @@
|
||||
#ifndef D_A_GOAL_FLAG_H
|
||||
#define D_A_GOAL_FLAG_H
|
||||
|
||||
#include "JSystem/J3DGraphBase/J3DPacket.h"
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
|
||||
class daGoal_Flag_c : public fopAc_ac_c {
|
||||
class dPath;
|
||||
|
||||
class daGFlag_HIO_c {
|
||||
public:
|
||||
inline cPhs_State _create();
|
||||
inline bool _delete();
|
||||
inline bool _draw();
|
||||
inline bool _execute();
|
||||
void getRopePos(int, int) {}
|
||||
void setAction(int (daGoal_Flag_c::*)()) {}
|
||||
daGFlag_HIO_c() {
|
||||
m04 = -1; // Unused HIO field
|
||||
mDrawCelShaded = true;
|
||||
m07 = 0; // Unused HIO field
|
||||
m06 = 0; // Unused HIO field
|
||||
m08 = 0; // Unused HIO field
|
||||
mWindScalePhaseInc = 0x2ee;
|
||||
mNormalFlutterPhaseInc = 0x800;
|
||||
mFlagWavePhaseInc = 0xbd1;
|
||||
mTimeLimit = 240; // In seconds; 4 minutes
|
||||
|
||||
void getRacePath(unsigned char);
|
||||
void RopeMove();
|
||||
void CreateBuoyRaces();
|
||||
void goal_check();
|
||||
void flag_move();
|
||||
void get_cloth_anim_factor(cXyz*, cXyz*, cXyz*, int, int);
|
||||
void CreateHeap();
|
||||
void getDemoAction(int);
|
||||
void RaceStart();
|
||||
void TimerExecute();
|
||||
void RaceEnd();
|
||||
// Maximum amount of rupees you can get in these minigames
|
||||
mPerfectRupeeScore = 150;
|
||||
|
||||
// How long the player must wait until they can end the results screen; 5 seconds (150 frames)
|
||||
mEndCamEarlyFrame = 150;
|
||||
|
||||
m09 = 0; // Unused HIO field
|
||||
mWindScale1 = 12.0f;
|
||||
mWindScale2 = 4.0f;
|
||||
mFlagSagFactor = -1.0f;
|
||||
mClothStiffness = 0.4f;
|
||||
mRopeColorR = 0xff;
|
||||
mRopeColorG = 0x80;
|
||||
mRopeColorB = 0x80;
|
||||
}
|
||||
inline virtual ~daGFlag_HIO_c();
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
/* 0x04 */ s8 m04;
|
||||
/* 0x05 */ bool mDrawCelShaded;
|
||||
/* 0x06 */ s8 m06;
|
||||
/* 0x07 */ s8 m07;
|
||||
/* 0x08 */ s8 m08;
|
||||
/* 0x09 */ s8 m09;
|
||||
/* 0x0A */ /* 2 bytes of alignment padding */
|
||||
/* 0x0C */ u32 mWindScalePhaseInc;
|
||||
/* 0x10 */ u32 mNormalFlutterPhaseInc;
|
||||
/* 0x14 */ u32 mFlagWavePhaseInc;
|
||||
/* 0x18 */ u32 mTimeLimit;
|
||||
/* 0x1C */ s32 mPerfectRupeeScore;
|
||||
/* 0x20 */ s32 mEndCamEarlyFrame;
|
||||
/* 0x24 */ u32 mRopeColorR;
|
||||
/* 0x28 */ u32 mRopeColorG;
|
||||
/* 0x2C */ u32 mRopeColorB;
|
||||
/* 0x30 */ f32 mWindScale1;
|
||||
/* 0x34 */ f32 mWindScale2;
|
||||
/* 0x38 */ f32 mFlagSagFactor;
|
||||
/* 0x3C */ f32 mClothStiffness;
|
||||
}; // Size: 0x40
|
||||
STATIC_ASSERT(sizeof(daGFlag_HIO_c) == 0x40);
|
||||
|
||||
class daGFlag_packet_c {
|
||||
class daGFlag_packet_c : public J3DPacket {
|
||||
public:
|
||||
void changeCurrentPos() {}
|
||||
void getDPos() {}
|
||||
void getMtx() {}
|
||||
void getNrm() {}
|
||||
void getOffsetVec() {}
|
||||
void getPos() {}
|
||||
void getTexObjP() {}
|
||||
void getToonTexObjP() {}
|
||||
void setTevStr(dKy_tevstr_c*) {}
|
||||
daGFlag_packet_c() {
|
||||
mCurrArr = 0;
|
||||
mNormalFlutterPhase = 0;
|
||||
}
|
||||
virtual ~daGFlag_packet_c() {}
|
||||
void changeCurrentPos() { mCurrArr ^= 1; }
|
||||
cXyz* getDPos() { return mDPos[mCurrArr]; }
|
||||
MtxP getMtx() { return mMtx; }
|
||||
cXyz* getNrm() { return mNrm[mCurrArr]; }
|
||||
cXyz* getOffsetVec() { return mVelocity; }
|
||||
cXyz* getPos() { return mPos[mCurrArr]; }
|
||||
GXTexObj* getTexObjP() { return &mTexObj; }
|
||||
GXTexObj* getToonTexObjP() { return &mToonTexObj; }
|
||||
void setTevStr(dKy_tevstr_c* i_tevStr_p) { mpTevStr = i_tevStr_p; }
|
||||
cXyz* getBackNrm() { return mBackNrm[mCurrArr]; }
|
||||
|
||||
void setTexObj(unsigned char);
|
||||
void setToonTexObj();
|
||||
void draw();
|
||||
void setBackNrm();
|
||||
void setNrmVtx(cXyz*, int, int);
|
||||
};
|
||||
public:
|
||||
/* 0x0010 */ s16 mNormalFlutterPhase;
|
||||
/* 0x0012 */ s16 mFlagWavePhase;
|
||||
/* 0x0014 */ GXTexObj mTexObj;
|
||||
/* 0x0034 */ GXTexObj mToonTexObj;
|
||||
/* 0x0054 */ Mtx mMtx;
|
||||
/* 0x0084 */ dKy_tevstr_c* mpTevStr;
|
||||
/* 0x0088 */ cXyz mPos[2][45];
|
||||
/* 0x04C0 */ cXyz mDPos[2][45];
|
||||
/* 0x08F8 */ cXyz mNrm[2][45];
|
||||
/* 0x0D30 */ cXyz mBackNrm[2][45];
|
||||
/* 0x1168 */ cXyz mVelocity[45];
|
||||
/* 0x1384 */ u8 mCurrArr;
|
||||
/* 0x1385 */ /* 3 bytes of alignment padding */
|
||||
}; // Size: 0x1388
|
||||
STATIC_ASSERT(sizeof(daGFlag_packet_c) == 0x1388);
|
||||
|
||||
class daGoal_Flag_c : public fopAc_ac_c {
|
||||
public:
|
||||
typedef BOOL (daGoal_Flag_c::*ProcFunc)();
|
||||
|
||||
public:
|
||||
inline cPhs_State _create();
|
||||
inline bool _delete();
|
||||
inline bool _draw();
|
||||
inline bool _execute();
|
||||
cXyz* getRopePos(int i_matIdx, int i_segmentIdx) {
|
||||
return &mRopeLines[i_matIdx].getPos(0)[i_segmentIdx * 4];
|
||||
}
|
||||
void setAction(ProcFunc i_proc) { mCurrProc = i_proc; }
|
||||
|
||||
BOOL getRacePath(u8);
|
||||
void RopeMove();
|
||||
BOOL CreateBuoyRaces();
|
||||
int goal_check();
|
||||
void flag_move();
|
||||
cXyz get_cloth_anim_factor(cXyz*, cXyz*, cXyz*, int, int);
|
||||
BOOL CreateHeap();
|
||||
int getDemoAction(int);
|
||||
BOOL RaceStart();
|
||||
BOOL TimerExecute();
|
||||
BOOL RaceEnd();
|
||||
|
||||
public:
|
||||
/* 0x0290 */ daGFlag_packet_c mFlagPacket;
|
||||
/* 0x1618 */ request_of_phase_process_class mClothPhs;
|
||||
/* 0x1620 */ request_of_phase_process_class mFlagPhs;
|
||||
/* 0x1628 */ Mtx mMtx;
|
||||
/* 0x1658 */ cXyz mGoalFlagPolePos[2];
|
||||
/* 0x1670 */ s16 mWindScalePhase;
|
||||
/* 0x1672 */ /* 2 bytes of alignment padding */
|
||||
/* 0x1674 */ fpc_ProcID mTimerProcID;
|
||||
/* 0x1678 */ fpc_ProcID mMgameStartProcID;
|
||||
/* 0x167C */ fpc_ProcID mMgameTermProcID;
|
||||
/* 0x1680 */ f32 mPrevPlayerLineSide;
|
||||
/* 0x1684 */ s16 mRaceEndState;
|
||||
/* 0x1686 */ s16 mCamFramesPassed;
|
||||
/* 0x1688 */ u8 mRaceStartState;
|
||||
/* 0x1689 */ /* 3 bytes of alignment padding */
|
||||
/* 0x168C */ dPath* mpRopePaths[4];
|
||||
/* 0x169C */ s32 mNumRopeBuoys[4];
|
||||
/* 0x16AC */ s32 mNumRopes;
|
||||
/* 0x16B0 */ mDoExt_3DlineMat0_c mRopeLines[4];
|
||||
/* 0x1720 */ ProcFunc mCurrProc;
|
||||
}; // Size: 0x172C
|
||||
STATIC_ASSERT(sizeof(daGoal_Flag_c) == 0x172C);
|
||||
|
||||
#endif /* D_A_GOAL_FLAG_H */
|
||||
|
||||
@@ -584,6 +584,7 @@ public:
|
||||
mMinigameFlags ^= 1 << (i_gameType - 1); // toggle Nth bit
|
||||
mMinigameResult = 0;
|
||||
}
|
||||
u8 getMiniGameResult() { return mMinigameResult; }
|
||||
void setMiniGameResult(u8 i_result) {
|
||||
mMinigameResult = i_result;
|
||||
}
|
||||
@@ -2687,6 +2688,10 @@ inline void dComIfGp_setMiniGameResult(u8 result) {
|
||||
g_dComIfG_gameInfo.play.setMiniGameResult(result);
|
||||
}
|
||||
|
||||
inline u8 dComIfGp_getMiniGameResult() {
|
||||
return g_dComIfG_gameInfo.play.getMiniGameResult();
|
||||
}
|
||||
|
||||
enum dActionStatus_e {
|
||||
/* 0x00 */ dActStts_BLANK_e,
|
||||
/* 0x01 */ dActStts_LOOK_e, // "Look"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define D_MINIGAME_STARTER_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "f_op/f_op_msg.h"
|
||||
|
||||
class JKRArchive;
|
||||
struct fopMsgM_pane_class;
|
||||
@@ -18,16 +19,20 @@ public:
|
||||
void draw();
|
||||
};
|
||||
|
||||
class dMinigame_Starter_c {
|
||||
class dMinigame_Starter_c : public msg_class {
|
||||
public:
|
||||
void countStart() {}
|
||||
void countStart() { if (!field_0x111) field_0x111 = true; }
|
||||
|
||||
void _create();
|
||||
void _execute();
|
||||
void _draw();
|
||||
void _delete();
|
||||
void startCheck();
|
||||
void deleteCheck();
|
||||
};
|
||||
BOOL startCheck();
|
||||
BOOL deleteCheck();
|
||||
public:
|
||||
/* 0x0FC */ u8 field_0x0FC[0x111 - 0x0FC];
|
||||
/* 0x111 */ bool field_0x111;
|
||||
/* 0x112 */ u8 field_0x112[0x114 - 0x112];
|
||||
}; // Size: 0x114
|
||||
|
||||
#endif /* D_MINIGAME_STARTER_H */
|
||||
|
||||
@@ -323,7 +323,15 @@ JKRExpHeap* fopMsgM_createExpHeap(u32);
|
||||
fpc_ProcID fopMsgM_Create(s16, fopMsgCreateFunc, void*);
|
||||
fpc_ProcID fopMsgM_create(s16 i_procName, fopAc_ac_c* param_1 = NULL, cXyz* param_2 = NULL,
|
||||
u32* param_3 = NULL, u32* param_4 = NULL, fopMsgCreateFunc createFunc = NULL);
|
||||
inline fpc_ProcID fopMsgM_MiniGameStarter_create(s16 i_procName, u8 param_1, u16 param_2, fopMsgCreateFunc createFunc) {
|
||||
u32 parameter = param_1;
|
||||
parameter |= param_2 << 16;
|
||||
return fopMsgM_create(i_procName, NULL, NULL, ¶meter, ¶meter, createFunc);
|
||||
}
|
||||
fpc_ProcID fop_MGameTerm_create(s16, s16, s16, int, int, fopMsgCreateFunc);
|
||||
inline fpc_ProcID fopMsgM_MiniGameTerminater_create(s16 param_0, s16 param_1, s16 param_2, int param_3, int param_4, fopMsgCreateFunc createFunc) {
|
||||
return fop_MGameTerm_create(param_0, param_1, param_2, param_3, param_4, createFunc);
|
||||
}
|
||||
void fopMsgM_Delete(void* process);
|
||||
fopMsg_prm_class* fopMsgM_GetAppend(void* msg);
|
||||
void fopMsgM_destroyExpHeap(JKRExpHeap*);
|
||||
@@ -340,7 +348,7 @@ char* fopMsgM_messageGet(char* msg, u32 string_id);
|
||||
void fopMsgM_passwordGet(char*, u32);
|
||||
fpc_ProcID fop_Timer_create(s16 param_0, u8 param_1, u16 param_2, u8 param_3, u8 param_4, f32 param_5,
|
||||
f32 param_6, f32 param_7, f32 param_8, fopMsgCreateFunc createFunc);
|
||||
inline fpc_ProcID fopMsgM_Timer_create(s16 param_0, u8 param_1, u32 param_2, u8 param_3, u8 param_4,
|
||||
inline fpc_ProcID fopMsgM_Timer_create(s16 param_0, u8 param_1, u16 param_2, u8 param_3, u8 param_4,
|
||||
f32 param_5, f32 param_6, f32 param_7, f32 param_8,
|
||||
fopMsgCreateFunc createFunc) {
|
||||
return fop_Timer_create(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7,
|
||||
|
||||
+967
-43
File diff suppressed because it is too large
Load Diff
@@ -29,12 +29,12 @@ void dMinigame_Starter_c::_delete() {
|
||||
}
|
||||
|
||||
/* 80206328-8020634C .text startCheck__19dMinigame_Starter_cFv */
|
||||
void dMinigame_Starter_c::startCheck() {
|
||||
BOOL dMinigame_Starter_c::startCheck() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8020634C-80206360 .text deleteCheck__19dMinigame_Starter_cFv */
|
||||
void dMinigame_Starter_c::deleteCheck() {
|
||||
BOOL dMinigame_Starter_c::deleteCheck() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user