Skip to content
Merged
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
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,10 @@ def MatchingFor(*versions):
Object(NonMatching, "System/MarNameRefGen_MapObj.cpp"),
Object(NonMatching, "System/MarNameRefGen_NPC.cpp"),
Object(NonMatching, "System/CardManager.cpp"),
Object(NonMatching, "System/MarDirectorLoadResource.cpp"),
Object(NonMatching, "System/MarDirectorLoadResource.cpp", extra_cflags=["-inline deferred"]),
Object(NonMatching, "System/MovieDirector.cpp"),
Object(Matching, "System/MarDirectorCreateObjects.cpp"),
Object(NonMatching, "System/MarDirectorSetupObjects.cpp"),
Object(NonMatching, "System/MarDirectorSetupObjects.cpp", extra_cflags=["-inline deferred"]),
Object(NonMatching, "System/MSoundMainSide.cpp"),
Object(Matching, "System/TargetArrow.cpp", extra_cflags=["-inline deferred"]),
],
Expand Down
6 changes: 4 additions & 2 deletions include/Camera/Camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CPolarSubCamera : public JDrama::TLookAtCamera {
void execSecureView_(s16, Vec*);
bool isLButtonCameraSpecifyMode(int) const;
void isLButtonCameraInbetween() const;
void isJetCoaster1stCamera() const;
bool isJetCoaster1stCamera() const;
void isTalkCameraSpecifyMode(int) const;
void isTalkCameraInbetween() const;
void isNormalCameraSpecifyMode(int) const;
Expand Down Expand Up @@ -131,7 +131,9 @@ class CPolarSubCamera : public JDrama::TLookAtCamera {

public:
/* 0x50 */ int mMode;
/* 0x54 */ char unk54[0x120 - 0x54];
/* 0x54 */ char unk54[0xA4 - 0x54];
/* 0xA4 */ s16 unkA4;
/* 0xA6 */ char unkA6[0x120 - 0xA6];
/* 0x120 */ TMarioGamePad* unk120;
/* 0x124 */ JGeometry::TVec3<f32> unk124;
/* 0x130 */ char unk130[0xC];
Expand Down
1 change: 1 addition & 0 deletions include/Camera/CameraShake.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enum EnumCamShakeMode {
CAM_SHAKE_MODE_UNK3 = 0x3,
CAM_SHAKE_MODE_UNK4 = 0x4,
CAM_SHAKE_MODE_UNK5 = 0x5,
CAM_SHAKE_MODE_UNK6 = 0x6,
CAM_SHAKE_MODE_UNK7 = 0x7,
CAM_SHAKE_MODE_UNK12 = 0x12,
CAM_SHAKE_MODE_UNK13 = 0x13,
Expand Down
13 changes: 9 additions & 4 deletions include/Camera/cameralib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ void CLBCalcPointInCubeRatio(const Vec&, const Vec&, const Vec&, const Vec&,
f32*, f32*, f32*);
void CLBCalcRotateZXYTranslateMatrix(MtxPtr, const Vec&, const Vec&);
void CLBCalcScaleTranslateMatrix(MtxPtr, const Vec&, const Vec&);
void CLBChaseAngleDecrease(s16*, s16, s16);
void CLBChaseDecrease(f32*, f32, f32, f32);
void CLBChaseSpecialDecrease(f32*, f32, f32, f32);
bool CLBChaseAngleDecrease(s16*, s16, s16);
bool CLBChaseDecrease(f32*, f32, f32, f32);
bool CLBChaseSpecialDecrease(f32*, f32, f32, f32);
void CLBCrossToPolar(const Vec&, const Vec&, f32*, s16*, s16*);
bool CLBIsPointInCube(const Vec&, const Vec&, const Vec&, const Vec&);
void CLBPolarToCross(const Vec&, Vec*, f32, s16, s16);
Expand Down Expand Up @@ -62,7 +62,12 @@ bool CLBChaseGeneralConstantSpecifySpeed(T* param_1, T param_2, T param_3)
}
template <class T> void CLBEaseInInbetween(T, T, T);
template <class T> void CLBEaseOutInbetween(T, T, T);
template <class T> void CLBLinearInbetween(T, T, T);

template <class T> T CLBLinearInbetween(T a, T b, f32 f)
{
return (T)(a + f * (b - a));
}

template <class T> void CLBPalFrame(T);
template <class T> void CLBPalIntSpeed(T);
template <class T> T CLBRoundf(f32);
Expand Down
23 changes: 23 additions & 0 deletions include/Enemy/BathtubKiller.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef BATHTUB_KILLER
#define BATHTUB_KILLER

#include <Enemy/Enemy.hpp>
#include <Enemy/SmallEnemy.hpp>
#include <Enemy/Walker.hpp>
#include <Enemy/Graph.hpp>
#include <Enemy/Spider.hpp>
#include <Enemy/Conductor.hpp>

class TBathtubKiller : public TSmallEnemy {
public:
TBathtubKiller(const char* name = "バスタブキラー");

void makeQuat(JGeometry::TVec3<f32> axis, float moveAmountY,
float moveAmountX);

/* 0x194 */ u8 unk194[0x1AC - 0x194];
/* 0x1AC */ JGeometry::TQuat4<f32> mQuat;
/* 0x1BC */ u8 unk1BC[0x250 - 0x1BC];
};

#endif
126 changes: 126 additions & 0 deletions include/Enemy/CoasterKiller.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#ifndef COASTER_KILLER
#define COASTER_KILLER

#include "Enemy/SmallEnemy.hpp"
#include <Enemy/EnemyManager.hpp>
#include <Enemy/Enemy.hpp>
#include <Enemy/WalkerEnemy.hpp>
#include <Strategic/Strategy.hpp>
#include <JSystem/JGeometry/JGVec4.hpp>

class TCoasterEnemyParams : public TWalkerEnemyParams {
public:
TCoasterEnemyParams(const char* path)
: TWalkerEnemyParams(path)
, PARAM_INIT(mSLCoasterSpeedInOrder, 20.0f)
, PARAM_INIT(mSLCoasterSpeedReverse, 20.0f)
{
TParams::load(mPrmPath);
mSLCoasterSpeedInOrder.value = 20.0f;
mSLCoasterSpeedReverse.value = 16.0f;
}

/* 0x338 */ TParamRT<f32> mSLCoasterSpeedInOrder;
/* 0x34C */ TParamRT<f32> mSLCoasterSpeedReverse;
};

class TCoasterKillerSaveLoadParams : public TCoasterEnemyParams {
public:
TCoasterKillerSaveLoadParams(const char* path)
: TCoasterEnemyParams(path)
, PARAM_INIT(mSLBombRange, 300.0f)
{
TParams::load(mPrmPath);
}

/* 0x360 */ TParamRT<f32> mSLBombRange;
};

class TCoasterEnemy : public TWalkerEnemy {
public:
TCoasterEnemy(const char* name)
: TWalkerEnemy(name)
, mPathIdx(0) {};
virtual ~TCoasterEnemy() { }

virtual void calcRootMatrix();
virtual void makeCoasterGoalPath();
virtual void moveCoaster();
virtual float getGravityY() const;
virtual void setNormalFlyAnm();
virtual void setWalkAnm();
virtual void moveObject();
virtual void init(TLiveManager* manager);
virtual void bind();
virtual void perform(u32, JDrama::TGraphics*);
virtual void reset();

TCoasterEnemyParams* getSaveParam2() const
{
return (TCoasterEnemyParams*)getSaveParam();
}
int getPathIdx() const { return mPathIdx; }
int getPathDir() const { return mPathDir; }
const JGeometry::TQuat4<f32>& getQuat() const { return mQuat; }

/* 0x194 */ int mPathIdx;
/* 0x198 */ int mPathDir;
/* 0x19C */ JGeometry::TQuat4<f32> mQuat;
};

DECLARE_NERVE(TNerveCoasterEnemyWander, TLiveActor);

class TCoasterKillerManager : public TSmallEnemyManager {
public:
TCoasterKillerManager(const char* name = "コースターキラーマネージャー");
virtual ~TCoasterKillerManager() { }

virtual void load(JSUMemoryInputStream&);
virtual void loadAfter();
virtual void createModelData();
virtual TSpineEnemy* createEnemyInstance();

/* 0x60 */ u8 unk60;
};

class TCoasterKiller : public TCoasterEnemy {
public:
TCoasterKiller(const char* name = "コースターキラー");
virtual ~TCoasterKiller() { }

virtual void init(TLiveManager* manager);
virtual void reset();
virtual void perform(u32, JDrama::TGraphics*);
virtual void setMActorAndKeeper();
virtual void attackToMario();
virtual bool isCollidMove(THitActor*);
virtual void behaveToWater(THitActor*);
virtual const char** getBasNameTable() const;
virtual void setNormalFlyAnm();
virtual void setDeadAnm();

TCoasterKillerSaveLoadParams* getSaveParam2() const
{
return (TCoasterKillerSaveLoadParams*)getSaveParam();
}
float get1AC() const { return unk1AC; }
GXColorS10& getBodyColor() { return mBodyColor; }
GXColorS10& getEyesColor() { return mEyesColor; }
GXColorS10& getNoseColor() { return mNoseColor; }
GXColorS10& getBaseColor() { return mBaseColor; }
TCoasterKillerManager* getManager()
{
return (TCoasterKillerManager*)mManager;
}

/* 0x1AC */ float unk1AC;
/* 0x1B0 */ GXColorS10 mBodyColor;
/* 0x1B8 */ GXColorS10 mNoseColor;
/* 0x1C0 */ GXColorS10 mEyesColor;
/* 0x1C8 */ GXColorS10 mBaseColor;
/* 0x1D0 */ TPosition3f mParticlePos;
};

DECLARE_NERVE(TNerveCoasterKillerExplosion, TLiveActor);

#endif
1 change: 1 addition & 0 deletions include/Enemy/Graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class TGraphTracer {
setTo(unk0->findNearestNodeIndex(pos, 0xffffffff));
}
TGraphWeb* getGraph() { return unk0; }
void setGraph(TGraphWeb* web) { unk0 = web; }

public:
/* 0x0 */ TGraphWeb* unk0;
Expand Down
19 changes: 19 additions & 0 deletions include/Enemy/Rocket.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef ROCKET_H
#define ROCKET_H

#include <Enemy/EnemyManager.hpp>
#include <Enemy/Enemy.hpp>
#include <Enemy/SmallEnemy.hpp>
#include <Strategic/Strategy.hpp>
#include <Map/MapData.hpp>

class TRocket : public TSmallEnemy {
public:
TRocket(const char* name);
virtual ~TRocket() { }

// TODO: add other methods
bool isAttack();
};

#endif
10 changes: 10 additions & 0 deletions include/GC2D/Talk2D2.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef GC2D_TALK_2D_2_HPP
#define GC2D_TALK_2D_2_HPP

#include <JSystem/JDrama/JDRViewObj.hpp>

class TTalk2D2 : public JDrama::TViewObj {
public:
};

#endif
4 changes: 2 additions & 2 deletions include/JSystem/J3D/J3DGraphAnimator/J3DModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ class J3DModel {
/* 0x08 */ u32 unk8;
/* 0x0C */ J3DCalcCallBack unkC;
char pad1[0x4];
/* 0x14 */ Vec unk14;
/* 0x20 */ Mtx unk20;
/* 0x14 */ Vec unk14; // mBaseScale
/* 0x20 */ Mtx unk20; // mBaseMtx
/* 0x50 */ u8* mScaleFlagArr;
/* 0x54 */ u8* mEvlpScaleFlagArr;
/* 0x58 */ Mtx* mNodeMatrices;
Expand Down
10 changes: 8 additions & 2 deletions include/JSystem/JDrama/JDRDisplay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class TDisplay {
virtual void startRendering();
virtual void endRendering();

void* getCurrentFrameBuffer() { return unk4[unkC]; }
const GXRenderModeObj& getRenderMode() const { return unk10; }
GXFBClamp getFBClamp() const { return unk54; }
JUtility::TColor getClearColor() const { return mFrameBufferClearColor; }
u32 getClearZ() const { return mFrameBufferClearZ; }

public:
/* 0x4 */ void* unk4[2];
/* 0xC */ u16 unkC;
Expand All @@ -23,8 +29,8 @@ class TDisplay {
/* 0x4C */ u16 unk4C;
/* 0x50 */ GXGamma unk50;
/* 0x54 */ GXFBClamp unk54;
/* 0x58 */ JUtility::TColor unk58;
/* 0x5C */ u32 unk5C;
/* 0x58 */ JUtility::TColor mFrameBufferClearColor;
/* 0x5C */ u32 mFrameBufferClearZ;
/* 0x60 */ TVideo* unk60;
/* 0x64 */ u16 unk64; // TODO: TFlagT?
};
Expand Down
8 changes: 5 additions & 3 deletions include/JSystem/JDrama/JDREfbSetting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ bool IsCanEnableDither(GXPixelFmt);
void IssueGXPixelFormatSetting(bool, bool, bool, bool, bool);
void IssueGXPixelFormatSetting(const GXRenderModeObj&, bool, bool);
void IssueGXSetCopyFilter(bool, const u8 (*)[2], bool, const u8*);
bool IssueGXSetCopyClear(JUtility::TColor, u32, u16);
void IssueGXCopyDisp(void*, const TRect&, const GXRenderModeObj&,
JUtility::TColor, u32, GXFBClamp, u16);
bool IssueGXSetCopyClear(JUtility::TColor clear_color, u32 clear_z, u16 flags);
void IssueGXCopyDisp(void* param_1, const TRect& src_rect,
const GXRenderModeObj& render_mode,
JUtility::TColor clear_color, u32 clear_z,
GXFBClamp framebuffer_clamp, u16 flags);

} // namespace JDrama

Expand Down
8 changes: 8 additions & 0 deletions include/JSystem/JDrama/JDRFlag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ template <class T> class TFlagT {
void set(T v) { mValue = v; }
T get() const { return mValue; }

void setBit(T bit, bool on)
{
if (on)
mValue |= bit;
else
mValue &= ~bit;
}

public:
T mValue;
};
Expand Down
10 changes: 9 additions & 1 deletion include/JSystem/JDrama/JDRFrmGXSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@
#define JDR_FRM_GX_SET_HPP

#include <JSystem/JDrama/JDRViewObj.hpp>
#include <JSystem/JDrama/JDRDisplay.hpp>

namespace JDrama {

class TFrmGXSet : public TViewObj {
public:
TFrmGXSet();
TFrmGXSet(TDisplay* display, const char* name = "<TFrmGXSet>")
: TViewObj(name)
, unk10(display)
{
}

virtual ~TFrmGXSet() { }
virtual void perform(u32, TGraphics*);

public:
/* 0x10 */ TDisplay* unk10;
};

} // namespace JDrama
Expand Down
2 changes: 2 additions & 0 deletions include/JSystem/JDrama/JDRGraphics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ struct TGraphics {
MtxPtr getUnkB4() { return unkB4.mMtx; }
f32 getNearPlane() { return mNearPlane; }

TFlagT<u16>& getUnkFC() { return unkFC; }

/* 0x00 */ u16 unk0;
/* 0x02 */ u16 unk2;
/* 0x04 */ void* unk4;
Expand Down
2 changes: 2 additions & 0 deletions include/JSystem/JDrama/JDRNameRefPtrList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class TNameRefPtrListT : public U, public JGadget::TList_pointer<T*> {

return nullptr;
}

void insert(T* obj) { this->push_back(obj); }
};

} // namespace JDrama
Expand Down
10 changes: 7 additions & 3 deletions include/JSystem/JGadget/std-list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ template <class T, class A = TAllocator<T> > class TList {
// but it isn't
T* operator->() { return (T*)(p_ + 1); }

iterator operator++()
iterator& operator++()
{
p_ = p_->pNext_;
return *this;
Expand Down Expand Up @@ -246,9 +246,13 @@ template <class T> class TList_pointer : TList_pointer_void {
}

T operator*() { return (T)this->Base::operator*(); }
T operator->() { return (T)this->Base::operator->(); }
T operator->() { return *(T*)this->Base::operator->(); }

iterator operator++() { return iterator(this->Base::operator++()); }
iterator& operator++()
{
this->Base::operator++();
return *this;
}
iterator operator++(int) { return iterator(this->Base::operator++(0)); }

friend bool operator==(iterator fst, iterator snd)
Expand Down
Loading
Loading