Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/JSystem/J3D/J3DGraphAnimator/J3DAnimation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class J3DFrameCtrl {
/// Test state flags, e.g. `checkState(STATE_COMPLETED_ONCE)`.
bool checkState(u32 mask) const { return (mState & mask) ? 1 : 0; }

// Fabricated
u8 getState() const { return mState; }

private:
/* 0x4 */ u8 mAttribute; ///< Playback mode (see ATTR_*).
/* 0x5 */ u8 mState; ///< State flags (see STATE_*), reset each update().
Expand Down
21 changes: 20 additions & 1 deletion include/M3DUtil/M3UModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class J3DMtxCalcSoftimageAnm;

class M3UModelCommon {
public:
M3UModelCommon()
: unk4(nullptr)
, unk8(nullptr)
, unk10(nullptr)
, unk14(nullptr)
{
}
virtual J3DMtxCalc* getMtxCalc(const M3UMtxCalcSetInfo&);

// Fabricated
Expand All @@ -37,6 +44,15 @@ class M3UMtxCalcSetInfo {

class M3UModel {
public:
M3UModel()
: unk4(nullptr)
, unk8(nullptr)
, unkC(nullptr)
, unk10(nullptr)
, unk14(nullptr)
, unk1C(nullptr)
{
}
virtual void changeMtxCalcAnmTransform(int, u8);
virtual void changeAnmTexPattern(int, u8);
virtual void setMtxCalc(const M3UMtxCalcSetInfo&) { }
Expand All @@ -52,7 +68,10 @@ class M3UModel {
void updateInMotion();

// Fabricated
J3DFrameCtrl& getFrameCtrl(u8 idx) { return unkC[idx]; }
J3DFrameCtrl& getFrameCtrl(int idx) { return unkC[idx]; }

// Fabricated
J3DModel* getModel() { return unk8; }

public:
/* 0x4 */ M3UModelCommon* unk4;
Expand Down
7 changes: 7 additions & 0 deletions include/M3DUtil/M3UModelMario.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define M3DUTIL_M3U_MODEL_MARIO_HPP

#include <M3DUtil/M3UModel.hpp>
#include <JSystem/J3D/J3DGraphAnimator/J3DJoint.hpp>

class M3UMtxCalcSIAnmBlendQuat;

Expand All @@ -20,6 +21,11 @@ class M3UMarioMtxCalcSetInfo {
/* 0x3 */ u8 mMtxCalcIdx;
/* 0x4 */ u16 mAnmTransformIdx[2];
/* 0x8 */ u8 mFrameCtrlIdx;
/* 0xA */ u16 unkA;
/* 0xC */ u16 unkC;
/* 0xE */ u16 unkE;
/* 0x10 */ u16 unk10;
/* 0x12 */ u16 unk12;
};

class M3UModelMario : public M3UModel {
Expand All @@ -33,6 +39,7 @@ class M3UModelMario : public M3UModel {
public:
/* 0x20 */ M3UModelCommonMario* unk20;
/* 0x24 */ M3UMarioMtxCalcSetInfo* unk24;
/* 0x28 */ J3DMtxCalcSoftimage unk28;
};

#endif
22 changes: 22 additions & 0 deletions include/MarioUtil/DrawUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@ class TTrembleModelEffect {
void clash(float);
void tremble(float, float, float, int);
void init(J3DModel*);

// Fabricated
bool checkUnk8(u8 flag) { return unk8 & flag ? true : false; }

public:
/* 0x0 */ J3DModel* unk0;
/* 0x4 */ void* unk4;
/* 0x8 */ u8 unk8;
/* 0xA */ u16 unkA;
/* 0xC */ u32 unkC;
/* 0x10 */ u32 unk10;
/* 0x14 */ u32 unk14;
/* 0x18 */ u32 unk18;
/* 0x1C */ u32 unk1C;
/* 0x20 */ u32 unk20;
/* 0x24 */ u32 unk24;
/* 0x28 */ u32 unk28;
/* 0x2C */ u32 unk2C;
/* 0x30 */ u32 unk30;
/* 0x34 */ u32 unk34;
/* 0x38 */ u32 unk38;
/* 0x3C */ u32 unk3C;
};

class J3DMaterial;
Expand Down
2 changes: 1 addition & 1 deletion include/MarioUtil/MtxUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class TMultiMtxEffect {
/* 0x04 */ u8* mMtxEffectType; // array of TMtxEffectBase types
/* 0x08 */ u16* mBoneIDs; // array of bone IDs to be manipulated
/* 0x0C */ J3DModel* mModel; // model to be manipulated
/* 0x14 */ TMtxEffectBase** mMtxEffectTbl; // array of TMtxEffectBase
/* 0x10 */ TMtxEffectBase** mMtxEffectTbl; // array of TMtxEffectBase
};

void SMS_MakeJointsToArc(J3DModel*, const JGeometry::TVec3<f32>&,
Expand Down
27 changes: 27 additions & 0 deletions include/Player/MarioAnimeData.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef PLAYER_MARIO_ANIME_DATA_HPP
#define PLAYER_MARIO_ANIME_DATA_HPP

#include <types.h>

struct TMarioAnimeData {
public:
bool isPumpOK() const;

public:
/* 0x0 */ u16 unk0;
/* 0x2 */ u16 unk2;
/* 0x4 */ u8 unk4;
/* 0x5 */ u8 unk5; // Hand id
/* 0x6 */ u8 unk6;
/* 0x7 */ u8 unk7;
};

extern TMarioAnimeData gMarioAnimeData[336];

struct unkTMarioAnimeFilesStruct {
public:
u32 unk0;
const char* unk4;
};

#endif
111 changes: 76 additions & 35 deletions include/Player/MarioMain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class J3DAnmTransform;
struct TBGWallCheckRecord;
class TMarioCap;
class TWaterEmitInfo;
class TBaseNPC;

// TODO: where should this be?
enum E_SIDEWALK_TYPE { };
Expand All @@ -32,6 +33,7 @@ enum E_MARIO_FLAG {
MARIO_FLAG_VISIBLE = (1 << 1),
MARIO_FLAG_NPC_TALKING = (1 << 3),
MARIO_FLAG_RECENTLY_LEFT_WATER = (1 << 4),
MARIO_FLAG_UNK_40 = (1 << 6),
MARIO_FLAG_GAME_OVER = (1 << 10),
MARIO_FLAG_GROUND_POUND_SIT_UP = (1 << 11),
MARIO_FLAG_HELMET_FLW_CAMERA = (1 << 12),
Expand Down Expand Up @@ -683,22 +685,22 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void calcBaseMtxPole(f32 (*)[4]);
void calcBaseMtxTorocco(f32 (*)[4]);
void considerWaist();
void isUpperPumpingStyle() const;
bool isUpperPumpingStyle() const;
void finalDrawInitialize();
void initMirrorModel();
void loadAnmTexPattern(J3DAnmTexPattern**, char*, J3DModelData*);
void loadBas(void**, const char*);
void loadAnm(J3DAnmTransform**, const char*);
void setReverseAnimation(int, f32);
void setAnimation(int, f32);
f32 setReverseAnimation(int, f32);
f32 setAnimation(int, f32);
void changeHandByRate(f32);
void changeHand(int);
void isAnimeLoopOrStop();
BOOL isAnimeLoopOrStop();
BOOL isLast1AnimeFrame();
J3DFrameCtrl* getMotionFrameCtrl();
void getCurrentFrame(int);
J3DFrameCtrl& getMotionFrameCtrl();
f32 getCurrentFrame(int);
void getRailMtx() const;
void getTakenMtx();
MtxPtr getTakenMtx();
void calcBodyPos(JGeometry::TVec3<f32>*);
u32 getTrampleCt();
void setPositions();
Expand All @@ -707,10 +709,10 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
bool isWearingHelm();
bool isWearingCap();
void setDivHelm();
void getWallAngle() const;
s16 getWallAngle() const;
f32 getPumpFrame() const;
void getCenterAnmMtx();
void getRootAnmMtx();
MtxPtr getCenterAnmMtx();
Mtx* getRootAnmMtx();
void getHeadRot();
void getJumpIntoWaterModelData();
void jumpMain();
Expand Down Expand Up @@ -764,7 +766,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void thinkAloha();
void thinkCube();
void thinkFreeze();
void isMario();
BOOL isMario();
void gunExec();
void checkWet();
void thinkSound();
Expand Down Expand Up @@ -835,7 +837,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void setNormalAttackArea();
void changePos(const Vec&);
void isSpeedZero();
void canBendBody();
BOOL canBendBody();
BOOL considerRotateJumpStart();
void addVelocity(f32);
BOOL onYoshi() const;
Expand All @@ -845,7 +847,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void warpRequest(const JGeometry::TVec3<f32>&, f32);
void isForceSlip();
void getRidingMtx(f32 (*)[4]);
void isWallInFront() const;
bool isWallInFront() const;
bool isInvincible() const;
bool isUnderWater() const;
void canSquat() const;
Expand Down Expand Up @@ -1153,6 +1155,12 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
return unk118 & attribute ? true : false;
}

// Fabricated
bool fabricatedIsPumping() const
{
return checkFlag(MARIO_FLAG_HAS_FLUDD) && isUpperPumpingStyle() != 0;
}

// Fabricated
bool checkActionFlag(u32 actionFlag) const
{
Expand All @@ -1165,6 +1173,15 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
return unk380 == message ? true : false;
}

// Fabricated
bool fabricatedUnk380Inline() const
{
if (unk380 == 0 || unk380 == 1) {
return true;
}
return false;
}

// Fabricated
bool fabricatedActionInline() const
{
Expand Down Expand Up @@ -1209,10 +1226,13 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
/* 0xF6 */ u16 unkF6;

/* 0xF8 */ u16 mLightID;
/* 0xFA */ u16 unk0FA;
/* 0xFA */ u16 mAnimationId;

/* 0xFC */ u32 unkFC[2];
/* 0xFC */ s16 unkFC;
/* 0xFA */ s16 unkFA;

/* 0x100 */ s16 unk100;
/* 0x102 */ s16 unk102;
/* 0x104 */ void* mController; // TMarioControllerWork

/* 0x108 */ u32 unk108;
Expand All @@ -1231,54 +1251,75 @@ class TMario : public TTakeActor, public TDrawSyncCallback {

/* 0x124 */ u32 unk124;
/* 0x128 */ u32 unk128;
/* 0x12C */ f32 unk12C; // under water health / air
/* 0x130 */ f32 unk130; // max air
/* 0x134 */ f32 unk134; // Pollution amount on model?
/* 0x12C */ u32 unk12C;
/* 0x130 */ u32 unk130;
/* 0x134 */ f32 unk134; // Amount of dirty?
/* 0x138 */ u32 unk138;
/* 0x13C */ u32 unk13C;
/* 0x140 */ u32 unk140;
/* 0x144 */ s32 unk144;
/* 0x144 */ u32 unk144;
/* 0x148 */ u32 unk148;
/* 0x14C */ s16 unk14C; // invincibility frames
/* 0x14C */ s16 unk14C;
/* 0x14E */ u16 unk14E;
/* 0x150 */ u32 unk150;
/* 0x154 */ TWaterEmitInfo* unk154;
/* 0x158 */ char unk158[0x19C - 0x158];
/* 0x158 */ u32 unk158;
/* 0x15C */ u32 unk15C;
/* 0x160 */ JGeometry::TVec3<f32>
unk160[4]; // Bone position, probably larger array
/* 0x190 */ u32 unk190;
/* 0x194 */ u32 unk194;
/* 0x198 */ u32 unk198;
/* 0x19C */ JGeometry::TVec3<f32> unk19C; // damage pos
/* 0x1A8 */ char unk1A8[0x29C - 0x1A8];
/* 0x1A8 */ char unk1A8[0x1CC - 0x1A8];
/* 0x1CC */ f32 unk1CC;
/* 0x1D0 */ u32 unk1D0;
/* 0x1D4 */ u32 unk1D4;
/* 0x1D8 */ u32 unk1D8;
/* 0x1DC */ f32 unk1DC;
/* 0x1E0 */ u32 unk1E0;
/* 0x1E4 */ u32 unk1E4;
/* 0x1E8 */ u32 unk1E8;
/* 0x1EC */ f32 unk1EC;
/* 0x1F0 */ char unk1F0[0x29C - 0x1F0];
/* 0x29C */ JGeometry::TVec3<f32> unk29C;
/* 0x2A8 */ char unk2A8[0x2BC - 0x2A8];
/* 0x2BC */ f32 unk2BC;
/* 0x2C0 */ char unk2C0[0x37C - 0x2C0];
/* 0x2C0 */ char unk2C0[0x348 - 0x2C0];
/* 0x348 */ f32 unk348;
/* 0x34C */ u16 unk34C;
/* 0x34E */ u16 unk34E;
/* 0x350 */ s32 unk350;
/* 0x354 */ char unk354[0x370 - 0x354];
/* 0x370 */ u32 unk370;
/* 0x374 */ u32 unk374;
/* 0x378 */ u32 unk378;
/* 0x37C */ u16 unk37C;
/* 0x37E */ u16 unk37E;
/* 0x380 */ u32 unk380; // pump state?
/* 0x384 */ THitActor* unk384; // Last receiveMessage sender

/* 0x388 */ u8 unk388;
// TODO: Make enum (0 = red, 1 = yellow, 2 = green)
/* 0x388 */ u16 mBlooperColor;
/* 0x389 */ u8 unk389; // Blooper color
/* 0x38A */ u16 unk38A;
/* 0x38C */ f32 mHolderHeightDiff;
/* 0x390 */ u32 unk390;
/* 0x394 */ J3DDrawBuffer* unk394;
/* 0x398 */ J3DDrawBuffer* unk398;
/* 0x39C */ u32 unk39C;
/* 0x3A0 */ u32 unk3A0;
/* 0x3A4 */ u32 unk3A4;
/* 0x3A4 */ SampleCtrlModelData* unk3A4;
/* 0x3A8 */ M3UModelMario* mModel; // Full model data
/* 0x3AC */ J3DModelData* mBodyModelData; // Body model data
/* 0x3B0 */ J3DModel* mRHand2ndModel; // R Hand 2nd model
/* 0x3B4 */ J3DModel* mLHand2ndModel; // L Hand 2nd model
/* 0x3B8 */ J3DModel* mRHand3ndModel; // R Hand 3nd model
/* 0x3BC */ J3DModel* mLHand3ndModel; // L Hand 3nd model
/* 0x3C0 */ J3DModel* mRHand4ndModel; // R Hand 4nd model
/* 0x3C4 */ u8 unk3C4;
/* 0x3B0 */ J3DModel* mHandModels[2][2]; // Hand models
/* 0x3C0 */ J3DModel* mRHand4ndModel;
/* 0x3C4 */ u8 unk3C4; // Cemter Anm mtx idx
/* 0x3C5 */ u8 mBoneIDs[12]; // Array of bone ids
/* 0x3D1 */ u8 unk3D1;
/* 0x3D2 */ u8 unk3D2;
/* 0x3D3 */ u8 unk3D3;
/* 0x3D4 */ u16 unk3D4;
/* 0x3D6 */ u16 unk3D6;
/* 0x3D4 */ u16 unk3D4; // _mat_eye_L idx
/* 0x3D6 */ u16 unk3D6; // _mat_eye_R idx
/* 0x3D8 */ f32 unk3D8;
/* 0x3DC */ f32 unk3DC;
/* 0x3E0 */ TMarioCap* mCap;
Expand Down Expand Up @@ -1317,7 +1358,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
/* 0x4E0 */ JAIAnimeSound** mAnmSoundTbl;
/* 0x4E4 */ JAISound* mSound;
/* 0x4E8 */ u32 mSoundFlags;
/* 0x4EC */ u8 unk4EC;
/* 0x4EC */ s8 unk4EC; // Bool if should do draw logic?
/* 0x4ED */ u8 mBlendLogicOp;
/* 0x4EE */ u16 mWaterWakeAlpha; // should be verified
/* 0x4F0 */ JGeometry::TVec3<f32> unk4F0;
Expand Down
Loading
Loading