d_a_vrbox / d_a_kytag02 / d_a_obj_eff OK (#327)

* d_a_vrbox / d_a_kytag02 / d_a_obj_eff OK

* some std header setups

* f_pc / profile cleanup

* setup cull data

* remove asm

* d_a_suspend OK
This commit is contained in:
TakaRikka
2023-05-05 16:17:19 -07:00
committed by GitHub
parent 8d01442f7c
commit 85827b28ff
148 changed files with 1924 additions and 2696 deletions
+5 -3
View File
@@ -538,7 +538,9 @@ struct J3DFogInfo {
/* 0x18 */ u16 field_0x18[10];
}; // Size: 0x2C
struct J3DFog : public J3DFogInfo {};
struct J3DFog : public J3DFogInfo {
J3DFogInfo* getFogInfo() { return (J3DFogInfo*)this; }
};
struct J3DAlphaComp {
/* 0x0 */ u16 field_0x0;
@@ -558,7 +560,7 @@ public:
virtual u32 getType() = 0;
/* 80317368 */ virtual void setFog(J3DFog);
/* 80317364 */ virtual void setFog(J3DFog*);
/* 8000DF5C */ virtual bool getFog();
/* 8000DF5C */ virtual J3DFog* getFog();
/* 8031736C */ virtual void setAlphaComp(J3DAlphaComp const*);
/* 8000E01C */ virtual void setAlphaComp(J3DAlphaComp const&);
/* 8000DF54 */ virtual bool getAlphaComp();
@@ -617,7 +619,7 @@ public:
/* 8032194C */ virtual u32 getType();
/* 8032197C */ virtual void setFog(J3DFog);
/* 80321958 */ virtual void setFog(J3DFog*);
/* 803219A0 */ virtual bool getFog();
/* 803219A0 */ virtual J3DFog* getFog();
/* 803219C4 */ virtual void setAlphaComp(J3DAlphaComp const*);
/* 803219A8 */ virtual void setAlphaComp(J3DAlphaComp const&);
/* 803219E0 */ virtual bool getAlphaComp();
@@ -62,10 +62,12 @@ public:
J3DNBTScale* getNBTScale() const { return mTexGenBlock->getNBTScale(); }
u32 getTexNo(u32 idx) const { return mTevBlock->getTexNo(idx); }
GXColor* getTevKColor(u32 param_0) { return mTevBlock->getTevKColor(param_0); }
J3DFog* getFog() { return mPEBlock->getFog(); }
void setTevColor(u32 i, const J3DGXColorS10* i_color) { mTevBlock->setTevColor(i, i_color); }
void setTevKColor(u32 i, const J3DGXColor* i_color) { mTevBlock->setTevKColor(i, i_color); }
void setMaterialAnm(J3DMaterialAnm* i_anm) { mMaterialAnm = i_anm; }
void setCullMode(u8 i_mode) { mColorBlock->setCullMode(i_mode); }
public:
/* 0x04 */ J3DMaterial* mNext;
+3 -14
View File
@@ -2,24 +2,13 @@
#define JMATRIGONOMETRIC_H
#include "dolphin/types.h"
namespace std {
template <typename A1, typename B1>
struct pair {
A1 a1;
B1 b1;
pair() {
a1 = A1();
b1 = B1();
}
};
} // namespace std
#include "MSL_C/utility.h"
struct TSinCosTable {
std::pair<f32, f32> table[0x2000];
f32 sinShort(s16 v) const { return table[static_cast<u16>(v) >> 3].a1; }
f32 cosShort(s16 v) const { return table[static_cast<u16>(v) >> 3].b1; }
f32 sinShort(s16 v) const { return table[static_cast<u16>(v) >> 3].first; }
f32 cosShort(s16 v) const { return table[static_cast<u16>(v) >> 3].second; }
};
struct TAtanTable {
+15
View File
@@ -0,0 +1,15 @@
#ifndef MSL_ALGORITHM_H_
#define MSL_ALGORITHM_H_
namespace std {
template <class ForwardIterator, class T>
ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& val);
template <class ForwardIterator, class T>
ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T& val);
template<class InputIt, class UnaryPredicate>
InputIt find_if(InputIt first, InputIt last, UnaryPredicate p);
} // namespace std
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef MSL_BITSET_H_
#define MSL_BITSET_H_
#include "stddef.h"
namespace std {
template<size_t N> class bitset {
bitset();
void set(size_t pos, bool val);
void reset(size_t pos);
bool test(size_t pos) const;
};
} // namespace std
#endif
+8
View File
@@ -0,0 +1,8 @@
#ifndef MSL_FUNCTIONAL_H_
#define MSL_FUNCTIONAL_H_
namespace std {
template <class T> struct less {};
} // namespace std
#endif
+17
View File
@@ -0,0 +1,17 @@
#ifndef MSL_UTILITY_H_
#define MSL_UTILITY_H_
namespace std {
template <class T1, class T2>
struct pair {
T1 first;
T2 second;
pair() {
first = T1();
second = T2();
}
};
} // namespace std
#endif
+2 -2
View File
@@ -18,11 +18,11 @@ float cM_rndF2(float);
float cM_rndFX2(float);
inline f32 cM_scos(s16 s) {
return JMath::sincosTable_.table[static_cast<u16>(s) >> 3].b1;
return JMath::sincosTable_.table[static_cast<u16>(s) >> 3].second;
}
inline f32 cM_ssin(s16 s) {
return JMath::sincosTable_.table[static_cast<u16>(s) >> 3].a1;
return JMath::sincosTable_.table[static_cast<u16>(s) >> 3].first;
}
inline s16 cM_deg2s(f32 val) {
+3 -1
View File
@@ -80,6 +80,8 @@ struct Z2EnvSeMgr : public JASGlobalInstance<Z2EnvSeMgr> {
/* 802C9F58 */ void registLv3WaterSePos(u8, Vec*);
/* 802CA794 */ void startLv3WaterSe(s8);
void setWindType(u8 i_type) { mWindType = i_type; }
/* 0x000 */ Z2EnvSeAutoPan field_0x0;
/* 0x01C */ Z2EnvSeAutoPan field_0x1c;
/* 0x038 */ u8 field_0x38;
@@ -112,7 +114,7 @@ struct Z2EnvSeMgr : public JASGlobalInstance<Z2EnvSeMgr> {
/* 0x140 */ u8 field_0x140;
/* 0x141 */ u8 field_0x141;
/* 0x144 */ Z2EnvSeDir field_0x144;
/* 0x160 */ u8 field_0x160;
/* 0x160 */ u8 mWindType;
/* 0x164 */ Z2MultiSeMgr field_0x164;
/* 0x180 */ Z2EnvSeBase field_0x180;
/* 0x188 */ u8 field_0x188;
+14
View File
@@ -321,6 +321,8 @@ public:
mZSetFlagForce = flag;
}
void onStatus(u16 i_status) { mStatus |= i_status; }
void setItemRupeeCount(s32 rupees) { mItemRupeeCount += rupees; }
void setItemMagicCount(s16 magic) { mItemMagicCount += magic; }
void setItemMaxMagicCount(s16 max) { mItemMaxMagicCount += max; }
@@ -2207,6 +2209,10 @@ inline u8 dComIfGp_get3DSetFlagForce() {
return g_dComIfG_gameInfo.play.get3DSetFlagForce();
}
inline void dComIfGp_onStatus(u16 i_status) {
g_dComIfG_gameInfo.play.onStatus(i_status);
}
inline void dComIfGp_setItemMagicCount(s16 count) {
g_dComIfG_gameInfo.play.setItemMagicCount(count);
}
@@ -2858,6 +2864,10 @@ inline BOOL i_dComIfGp_event_runCheck() {
return g_dComIfG_gameInfo.play.getEvent().runCheck();
}
inline f32 dComIfGp_event_getCullRate() {
return g_dComIfG_gameInfo.play.getEvent().getCullRate();
}
inline u16 dComIfGp_event_checkHind(u16 flag) {
if (!i_dComIfGp_event_runCheck()) {
return false;
@@ -3258,6 +3268,10 @@ inline Mtx44* dComIfGd_getProjViewMtx() {
return &(g_dComIfG_gameInfo.drawlist.getView()->mProjViewMtx);
}
inline MtxP dComIfGd_getInvViewMtx() {
return g_dComIfG_gameInfo.drawlist.getView()->mInvViewMtx;
}
inline view_port_class* dComIfGd_getViewport() {
return g_dComIfG_gameInfo.drawlist.getViewport();
}
+1 -54
View File
@@ -1,61 +1,8 @@
#ifndef D_COM_D_COM_STATIC_H
#define D_COM_D_COM_STATIC_H
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
#include "rel/d/a/d_a_suspend/d_a_suspend.h"
int daNpcKakashi_getSwdTutorialStep();
class daSus_c {
public:
class data_c {
public:
/* 80030F14 */ void set(s8, cXyz const&, cXyz const&, u8, u8, u8);
/* 80030FBC */ data_c* reset();
/* 80030FCC */ u8 isSwitch();
/* 800310C8 */ u8 check(fopAc_ac_c*);
/* 80031038 */ bool check(cXyz const&);
/* 80031150 */ void execute();
/* 80031F28 */ ~data_c();
/* 80031F64 */ data_c();
void setNext(data_c* i_next) { mpNext = i_next; }
data_c* getNext() { return mpNext; }
u8 getType() { return mType; }
/* 0x00 */ s8 mRoomNo;
/* 0x01 */ bool field_0x1;
/* 0x02 */ u8 field_0x2;
/* 0x03 */ u8 field_0x3;
/* 0x04 */ u8 mType;
/* 0x08 */ cXyz field_0x8;
/* 0x14 */ cXyz field_0x14;
/* 0x20 */ data_c* mpNext;
}; // Size: 0x24
class room_c {
public:
/* 80031190 */ void add(daSus_c::data_c*);
/* 800311FC */ void reset();
/* 80031EE4 */ room_c();
/* 0x0 */ data_c* mpData;
}; // Size: 0x4
/* 80031248 */ void newData(s8, cXyz const&, cXyz const&, u8, u8, u8);
/* 800313BC */ void reset();
/* 800314D4 */ static void check(fopAc_ac_c*);
/* 80031434 */ static bool check(s8 i_roomNo, cXyz const& i_pos);
/* 800315A4 */ static void execute();
static void reset(int roomNo) {
room_c* room = (room_c*)mRoom; // tmp
room[roomNo].reset();
}
static u8 mData[1152];
static u8 mRoom[256];
static s16 mSetTop;
};
#endif /* D_COM_D_COM_STATIC_H */
+4
View File
@@ -1063,6 +1063,10 @@ inline int dStage_FileList_dt_GetBitSw(dStage_FileList_dt_c* p_fList) {
return p_fList->mBitSw;
}
inline f32 dStage_FileList_dt_SeaLevel(dStage_FileList_dt_c* p_fList) {
return p_fList->mSeaLevel;
}
inline f32 dStage_FileList2_dt_GetLeftRmX(dStage_FileList2_dt_c* p_fList2) {
return p_fList2->mLeftRmX;
}
+1
View File
@@ -143,6 +143,7 @@ public:
u16 chkFlag2(u16 flag) { return flag & mFlag2; }
bool runCheck() { return mEventStatus != 0; }
f32 getCullRate() { return mCullRate; }
u16 chkEventFlag(u16 flag) { return flag & mEventFlag; }
void onEventFlag(u16 flag) { mEventFlag |= flag; }
void offEventFlag(u16 flag) { mEventFlag &= ~flag; }
+1
View File
@@ -21,6 +21,7 @@ f32 dKyw_get_wind_pow();
static void squal_proc();
void dKyw_rain_set(int count);
void dKyw_wind_set();
cXyz* dKyw_get_wind_vec();
cXyz dKyw_get_wind_vecpow();
void dKyw_evt_wind_set(s16 angleX, s16 angleY);
void dKyw_custom_windpower(f32 pow);
+16 -9
View File
@@ -18,7 +18,10 @@ struct actor_process_profile_definition {
/* 0x28 */ u32 mStatus;
/* 0x2C */ u8 mActorType;
/* 0x2D */ u8 mCullType;
/* 0x2E */ u8 field_0x2e[2]; // Likely padding
};
enum {
ACTOR_TYPE_ENEMY = 2,
};
struct JKRSolidHeap;
@@ -93,6 +96,16 @@ struct actor_attention_types {
class dJntCol_c;
struct cull_sphere {
/* 0x0 */ Vec mCenter;
/* 0xC */ f32 mRadius;
};
struct cull_box {
/* 0x0 */ Vec mMin;
/* 0xC */ Vec mMax;
};
class fopAc_ac_c : public leafdraw_class {
public:
/* 0x0C0 */ int mAcType;
@@ -119,14 +132,8 @@ public:
/* 0x4F8 */ cXyz speed;
/* 0x504 */ MtxP mCullMtx;
union {
struct {
/* 0x508 */ cXyz mMin;
/* 0x514 */ cXyz mMax;
} mBox;
struct {
/* 0x508 */ cXyz mCenter;
/* 0x514 */ f32 mRadius;
} mSphere;
/* 0x508 */ cull_box mBox;
/* 0x508 */ cull_sphere mSphere;
} mCull;
/* 0x520 */ f32 mCullSizeFar;
/* 0x524 */ J3DModel* model;
+20
View File
@@ -305,6 +305,26 @@ inline dJntCol_c* fopAcM_GetJntCol(fopAc_ac_c* i_actor) {
return i_actor->mJntCol;
}
inline f32 fopAcM_getCullSizeFar(const fopAc_ac_c* i_actor) {
return i_actor->mCullSizeFar;
}
inline int fopAcM_GetCullSize(const fopAc_ac_c* i_actor) {
return i_actor->mCullType;
}
inline BOOL fopAcM_CULLSIZE_IS_BOX(int i_culltype) {
return (i_culltype >= 0 && i_culltype < 14) || i_culltype == 14;
}
inline Vec fopAcM_getCullSizeSphereCenter(const fopAc_ac_c* i_actor) {
return i_actor->mCull.mSphere.mCenter;
}
inline f32 fopAcM_getCullSizeSphereR(const fopAc_ac_c* i_actor) {
return i_actor->mCull.mSphere.mRadius;
}
inline void dComIfGs_onSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
-1
View File
@@ -24,7 +24,6 @@ typedef struct leaf_process_profile_definition {
/* 0x00 */ process_profile_definition mBase;
/* 0x1C */ leafdraw_method_class* mSubMtd; // Subclass methods
/* 0x20 */ s16 mPriority; // mDrawPriority
/* 0x22 */ u8 unk22[2]; // Likely padding...
} leaf_process_profile_definition;
s16 fpcLf_GetPriority(const leafdraw_class* pLeaf);
-1
View File
@@ -13,7 +13,6 @@ typedef struct process_profile_definition {
/* 0x04 */ u16 mListID;
/* 0x06 */ u16 mListPrio;
/* 0x08 */ s16 mProcName;
/* 0x0A */ s16 unkA; // probably padding
/* 0x0C */ process_method_class* mSubMtd; // Subclass methods
/* 0x10 */ s32 mSize;
/* 0x14 */ s32 mSizeOther;
+16
View File
@@ -128,4 +128,20 @@ inline void mDoAud_mEnvSe_startFarThunderSe(const Vec* param_0) {
g_mEnvSeMgr.startFarThunderSe((Vec*)param_0, 0);
}
inline void mDoAud_mEnvse_initStrongWind() {
g_mEnvSeMgr.initStrongWindSe();
}
inline void mDoAud_mEnvse_setWindDirection(Vec* i_direction) {
g_mEnvSeMgr.setWindDirection(i_direction);
}
inline void mDoAud_mEnvse_startStrongWindSe(s8 i_reverb) {
g_mEnvSeMgr.startStrongWindSe(i_reverb);
}
inline void mDoAud_mEnvse_setWindType(u8 i_type) {
g_mEnvSeMgr.setWindType(i_type);
}
#endif /* M_DO_M_DO_AUDIO_H */
+11
View File
@@ -17,6 +17,17 @@ struct mDoLib_clipper {
return mClipper.clip(m, (Vec*)param_1, (Vec*)param_2);
}
static u32 clip(const Mtx m, Vec param_1, f32 param_2) {
return mClipper.clip(m, param_1, param_2);
}
static f32 getFar() { return mSystemFar; }
static void resetFar() {
mClipper.setFar(mSystemFar);
mClipper.calcViewFrustum();
}
static J3DUClipper mClipper;
static f32 mSystemFar;
static f32 mFovyRate;

Some files were not shown because too many files have changed in this diff Show More