d_kankyo_wether / d_eye_hl (#178)

* d_eye_hl / d_kankyo_wether wip

* more d_kankyo_wether + format

* remove asm

* some d_kankyo wip

* fix dccs vtable

* some m_Do_graphic / d_meter2_draw work
This commit is contained in:
TakaRikka
2022-01-25 21:24:14 +01:00
committed by GitHub
parent 6f4d068f1d
commit 612f26c132
241 changed files with 3713 additions and 9753 deletions
+19 -21
View File
@@ -1,16 +1,16 @@
#ifndef DYNAMICLINK_H
#define DYNAMICLINK_H
#include "dolphin/types.h"
#include "dolphin/os/OSLink.h"
#include "m_Do/m_Do_dvd_thread.h"
#include "JSystem/JKernel/JKRFileCache.h"
#include "dolphin/os/OSLink.h"
#include "dolphin/types.h"
#include "m_Do/m_Do_dvd_thread.h"
struct DynamicModuleControlBase {
/* 0x00 */u16 mLinkCount;
/* 0x02 */u16 mDoLinkCount;
/* 0x04 */DynamicModuleControlBase* mPrev;
/* 0x08 */DynamicModuleControlBase* mNext;
/* 0x00 */ u16 mLinkCount;
/* 0x02 */ u16 mDoLinkCount;
/* 0x04 */ DynamicModuleControlBase* mPrev;
/* 0x08 */ DynamicModuleControlBase* mNext;
/* 0x0C */ /*vtable*/
/* 802621CC */ virtual ~DynamicModuleControlBase();
@@ -30,9 +30,8 @@ struct DynamicModuleControlBase {
/* 802623EC */ bool load_async();
/* 8026242C */ bool force_unlink();
static inline DynamicModuleControlBase* getFirstClass() {return mFirst;}
inline DynamicModuleControlBase* getNextClass() {return mNext;}
static inline DynamicModuleControlBase* getFirstClass() { return mFirst; }
inline DynamicModuleControlBase* getNextClass() { return mNext; }
static DynamicModuleControlBase* mFirst;
static DynamicModuleControlBase* mLast;
@@ -54,21 +53,20 @@ struct DynamicModuleControl : DynamicModuleControlBase {
/* 802626D0 */ static JKRArchive* mountCallback(void*);
/* 8026275C */ bool initialize();
/* 80262794 */ static void* callback(void*);
/* 0x10 */OSModuleInfo* mModule;
/* 0x14 */void* mBss;
/* 0x18 */u32 unk_24;
/* 0x1c */const char* mName;
/* 0x20 */u8 mResourceType;
/* 0x21 */u8 unk_33;
/* 0x22 */u16 mChecksum;
/* 0x24 */s32 mSize;
/* 0x28 */mDoDvdThd_callback_c* mAsyncLoadCallback;
/* 0x10 */ OSModuleInfo* mModule;
/* 0x14 */ void* mBss;
/* 0x18 */ u32 unk_24;
/* 0x1c */ const char* mName;
/* 0x20 */ u8 mResourceType;
/* 0x21 */ u8 unk_33;
/* 0x22 */ u16 mChecksum;
/* 0x24 */ s32 mSize;
/* 0x28 */ mDoDvdThd_callback_c* mAsyncLoadCallback;
static u32 sAllocBytes;
static JKRArchive* sArchive;
static JKRFileCache* sFileCache;
};
#endif /* DYNAMICLINK_H */
+1
View File
@@ -103,6 +103,7 @@ public:
bool isVisible() const { return mVisible; }
void show() { mVisible = true; }
void hide() { mVisible = false; }
void initiate();
void initialize(J2DPane*, bool, u64, const JGeometry::TBox2<f32>&);
+2 -2
View File
@@ -63,8 +63,8 @@ public:
/* 80053C6C */ virtual void setBlack(JUtility::TColor);
/* 80053C44 */ virtual void setWhite(JUtility::TColor);
/* 8018BEE0 */ virtual void setBlackWhite(JUtility::TColor, JUtility::TColor);
/* 801DFA4C */ virtual void getBlack() const;
/* 801DFA40 */ virtual void getWhite() const;
/* 801DFA4C */ virtual JUtility::TColor getBlack() const;
/* 801DFA40 */ virtual JUtility::TColor getWhite() const;
/* 8025603C */ virtual bool getMaterial() const;
/* 802FDBFC */ virtual void drawFullSet(f32, f32, f32, f32, Mtx*);
/* 802FE380 */ virtual void drawTexCoord(f32, f32, f32, f32, s16, s16, s16, s16, s16, s16, s16,
+21
View File
@@ -19,6 +19,11 @@ enum J2DTextBoxHBinding {
class J2DTextBox : public J2DPane {
public:
struct TFontSize {
/* 0x0 */ f32 mSizeX;
/* 0x4 */ f32 mSizeY;
};
/* 803001E0 */ virtual ~J2DTextBox();
/* 80300C68 */ virtual s32 getTypeID() const;
/* 80300AF8 */ virtual void resize(f32, f32);
@@ -51,6 +56,22 @@ public:
/* 8030074C */ s32 setString(s16, char const*, ...);
/* 80300660 */ s32 setString(char const*, ...);
void setFontSize(f32 sizeX, f32 sizeY) {
if (sizeX > 0.0f) {
sizeX = 0.0f;
}
field_0x11c = sizeX;
if (sizeY > 0.0f) {
sizeY = 0.0f;
}
field_0x120 = sizeY;
}
void setFontSize(TFontSize size) { setFontSize(size.mSizeX, size.mSizeY); }
void setCharSpace(f32 space) { mCharSpacing = space; }
private:
/* 0x0100 */ JUTFont* mFont;
/* 0x0104 */ JUtility::TColor mCharColor;
@@ -30,6 +30,7 @@ public:
J3DMaterial* getMaterialNodePointer(u16 idx) const { return mMaterialNodePointer[idx]; }
J3DTexture* getTexture() const { return mTexture; }
JUTNameTab* getTextureName() const { return mTextureName; }
u16 getMaterialNum() const { return mMaterialNum; }
@@ -67,6 +67,7 @@ public:
J3DShapePacket* getShapePacket(u16 idx) const { return &mShapePacket[idx]; }
Mtx33* getBumpMtxPtr(int idx) const { return mMtxBuffer->getBumpMtxPtr(idx); }
Mtx33* getNrmMtxPtr() const { return mMtxBuffer->getNrmMtxPtr(); }
void setBaseScale(const Vec& scale) { mBaseScale = scale; }
// is there a better way to handle inlines with same name as non-inlines?
MtxP i_getAnmMtx(int p1) { return mMtxBuffer->getAnmMtx(p1); }
@@ -34,6 +34,7 @@ public:
J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); }
J3DJointTree& getJointTree() { return mJointTree; }
J3DTexture* getTexture() const { return mMaterialTable.getTexture(); }
JUTNameTab* getTextureName() const { return mMaterialTable.getTextureName(); }
u16 getWEvlpMtxNum() const { return mJointTree.getWEvlpMtxNum(); }
void* getVtxPosArray() const { return mVertexData.getVtxPosArray(); }
void* getVtxNrmArray() const { return mVertexData.getVtxNrmArray(); }
+1 -1
View File
@@ -66,7 +66,7 @@ public:
virtual bool entry(J3DDrawBuffer*);
virtual void draw();
virtual ~J3DPacket();
virtual ~J3DPacket() {}
public:
/* 0x04 */ J3DPacket* mpNextSibling;
+16 -1
View File
@@ -11,6 +11,11 @@ enum J3DError {
kJ3DError_Alloc = 4,
};
enum J3DSysDrawBuffer {
/* 0x0 */ OPA_BUFFER,
/* 0x1 */ XLU_BUFFER
};
class J3DMtxCalc;
class J3DModel;
class J3DMatPacket;
@@ -64,7 +69,7 @@ struct J3DSys {
/* 0x4 */ XLU,
};
Mtx* getViewMtx() { return &mViewMtx; }
MtxP getViewMtx() { return mViewMtx; }
void setDrawModeOpaTexEdge() { mDrawMode = OPA_TEX_EDGE; }
@@ -102,6 +107,16 @@ struct J3DSys {
GXSetArray(GX_NRM_MTX_ARRAY, mModelNrmMtx, sizeof(*mModelNrmMtx));
}
// Type 0: Opa Buffer
// Type 1: Xlu Buffer
void setDrawBuffer(J3DDrawBuffer* buffer, int type) { mDrawBuffer[type] = buffer; }
// Type 0: Opa Buffer
// Type 1: Xlu Buffer
J3DDrawBuffer* getDrawBuffer(int type) { return mDrawBuffer[type]; }
void setViewMtx(Mtx m) { PSMTXCopy(m, mViewMtx); }
static Mtx mCurrentMtx;
static Vec mCurrentS;
static Vec mParentS;
+4 -1
View File
@@ -9,13 +9,16 @@
class J3DTexture {
private:
/* 0x0 */ u16 mNum;
/* 0x4 */ ResTIMG** mpRes;
/* 0x4 */ ResTIMG* mpRes;
public:
/* 8031204C */ void loadGX(u16, _GXTexMapID) const;
/* 803121A4 */ void entryNum(u16);
/* 8031221C */ void addResTIMG(u16, ResTIMG const*);
/* 803366A4 */ virtual ~J3DTexture();
u16 getNum() const { return mNum; }
ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; }
};
struct J3DTextureSRTInfo {
+4
View File
@@ -218,4 +218,8 @@ inline JKRCompression JKRConvertAttrToCompressionType(u32 attr) {
return JKRArchive::convertAttrToCompressionType(attr);
}
inline void* JKRGetTypeResource(u32 tag, const char* name, JKRArchive* arc) {
return JKRArchive::getGlbResource(tag, name, arc);
}
#endif
+4
View File
@@ -54,4 +54,8 @@ public:
static JSUList<JKRFileLoader> sVolumeList;
};
inline void* JKRGetNameResource(const char* name, JKRFileLoader* loader) {
return JKRFileLoader::getGlbResource(name, loader);
}
#endif /* JKRFILELOADER_H */
+2 -2
View File
@@ -221,8 +221,8 @@ inline JKRHeap* JKRGetCurrentHeap() {
return JKRHeap::getCurrentHeap();
}
inline u32 JKRGetMemBlockSize(JKRHeap* heap,void* block) {
return JKRHeap::getSize(block,heap);
inline u32 JKRGetMemBlockSize(JKRHeap* heap, void* block) {
return JKRHeap::getSize(block, heap);
}
#endif /* JKRHEAP_H */
+2
View File
@@ -124,6 +124,8 @@ public:
return isPushingReset;
}
static s8 getPortStatus(u32 port) { return mPadStatus[port].error; }
struct CButton {
CButton(); // inline
void clear();
+2
View File
@@ -66,6 +66,8 @@ public:
void idleStart() { mIdle.start(255, 129, 30); }
void idleEnd() { mIdle.end(); }
void setCostFrame(int frame) { mCostFrame = frame; }
void setVisible(bool visible) { mVisible = visible; }
void setVisibleHeapBar(bool visible) { mHeapBarVisible = visible; }
static JUTProcBar* getManager() { return sManager; }
@@ -3,4 +3,6 @@
#include "dolphin/types.h"
extern "C" int memcmp(const void*, const void*, size_t);
#endif /* MSL_COMMON_SRC_MEM_H */
+10 -8
View File
@@ -48,15 +48,17 @@ inline u8 cLib_checkBit(u8& pVar, u8 pBit) {
}
template <typename T>
inline T cLib_minMaxLimit(T param_0, T min, T max) {
if (param_0 < min) {
return max;
inline T cLib_minMaxLimit(T val, T min, T max) {
T ret;
if (val < min) {
ret = min;
} else {
ret = max;
if (val <= max) {
ret = val;
}
}
min = param_0;
if (min > max) {
min = max;
}
return min;
return ret;
}
void MtxInit(void);
+3 -1
View File
@@ -21,7 +21,9 @@ struct Z2StatusMgr {
void setCameraGroupInfo(u8);
void setCameraInWaterDepth(float);
//! @todo there are a number of inlines only called from rels: see CHN_debug
void setHour(s32 hour) { mHour = hour; }
void setMinute(s32 min) { mMinute = min; }
void setWeekday(s32 day) { mWeekday = day; }
/* 0x00 */ u8 mHour;
/* 0x01 */ u8 mMinute;
+15 -13
View File
@@ -14,32 +14,34 @@ public:
/* 80085F28 */ void ChkShieldFrontRange(cCcD_Obj*, cCcD_Obj*, int, cXyz const*);
/* 800860F8 */ void ChkShield(cCcD_Obj*, cCcD_Obj*, dCcD_GObjInf*, dCcD_GObjInf*, cXyz const*);
/* 800861B0 */ void CalcTgPlusDmg(cCcD_Obj*, cCcD_Obj*, cCcD_Stts*, cCcD_Stts*);
/* 800861B4 */ bool ChkAtTgHitAfterCross(bool, bool, cCcD_GObjInf const*, cCcD_GObjInf const*,
cCcD_Stts*, cCcD_Stts*, cCcD_GStts*, cCcD_GStts*);
/* 80086240 */ void SetCoGObjInf(bool, bool, cCcD_GObjInf*, cCcD_GObjInf*, cCcD_Stts*,
cCcD_Stts*, cCcD_GStts*, cCcD_GStts*);
/* 80086360 */ void GetRank(u8);
/* 80086404 */ bool ChkNoHitGCo(cCcD_Obj*, cCcD_Obj*);
/* 8008640C */ void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32);
/* 80086754 */ void CalcParticleAngle(dCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, csXyz*);
/* 8008685C */ void ProcAtTgHitmark(bool, bool, cCcD_Obj*, cCcD_Obj*, dCcD_GObjInf*,
dCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, dCcD_GStts*,
dCcD_GStts*, cXyz*, bool);
/* 80086AC0 */ void SetAtTgGObjInf(bool, bool, cCcD_Obj*, cCcD_Obj*, cCcD_GObjInf*,
cCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, cCcD_GStts*,
cCcD_GStts*, cXyz*);
/* 80086D8C */ void ChkCamera(cXyz&, cXyz&, f32, fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*);
/* 80086FBC */ void chkCameraPoint(cXyz const&, cCcD_ShapeAttr::Shape*, fopAc_ac_c*,
fopAc_ac_c*);
/* 800872A8 */ void MoveAfterCheck();
/* 800872AC */ void DrawAfter();
/* 800872B0 */ void Move();
/* 800872D0 */ void Draw();
/* 8008730C */ void MassClear();
/* 80087330 */ void ChkAtTgMtrlHit(u8, u8);
/* 8008734C */ bool ChkNoHitGAtTg(cCcD_GObjInf const*, cCcD_GObjInf const*, cCcD_GStts*,
cCcD_GStts*);
/* 8008640C */ virtual void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32);
/* 80086240 */ virtual void SetCoGObjInf(bool, bool, cCcD_GObjInf*, cCcD_GObjInf*, cCcD_Stts*,
cCcD_Stts*, cCcD_GStts*, cCcD_GStts*);
/* 80086AC0 */ virtual void SetAtTgGObjInf(bool, bool, cCcD_Obj*, cCcD_Obj*, cCcD_GObjInf*,
cCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, cCcD_GStts*,
cCcD_GStts*, cXyz*);
/* 8008734C */ virtual bool ChkNoHitGAtTg(cCcD_GObjInf const*, cCcD_GObjInf const*, cCcD_GStts*,
cCcD_GStts*);
/* 800861B4 */ virtual bool ChkAtTgHitAfterCross(bool, bool, cCcD_GObjInf const*,
cCcD_GObjInf const*, cCcD_Stts*, cCcD_Stts*,
cCcD_GStts*, cCcD_GStts*);
/* 80086404 */ virtual bool ChkNoHitGCo(cCcD_Obj*, cCcD_Obj*);
/* 8002FF40 */ virtual ~dCcS() {}
/* 800872A8 */ virtual void MoveAfterCheck();
/* 80086754 */ virtual void CalcParticleAngle(dCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, csXyz*);
static u8 m_mtrl_hit_tbl[64];
+105 -4
View File
@@ -14,6 +14,7 @@
#include "d/particle/d_particle.h"
#include "d/save/d_save.h"
#include "dolphin/types.h"
#include "f_op/f_op_camera_mng.h"
struct dTimer_c {
/* 8025D524 */ int deleteCheck();
@@ -46,8 +47,6 @@ public:
/* 0x4 */ JKRHeap* heap;
};
struct camera_class {};
class dComIfG_camera_info_class {
public:
dComIfG_camera_info_class() {}
@@ -241,6 +240,8 @@ public:
JKRArchive* getMain2DArchive() { return mMain2DArchive; }
JKRArchive* getAnmArchive() { return mAnmArchive; }
JKRArchive* getCollectResArchive() { return mCollectResArchive; }
JKRArchive* getItemIconArchive() { return mItemIconArchive; }
JKRExpHeap* getMsgExpHeap() { return mMsgExpHeap; }
J2DGrafContext* getCurrentGrafPort() { return mCurrentGrafPort; }
dVibration_c& getVibration() { return mVibration; }
void setPlayerStatus(int param_0, int i, u32 flag) { mPlayerStatus[i] |= flag; }
@@ -257,6 +258,8 @@ public:
m3DSetFlag = flag;
}
void offPauseFlag() { mPauseFlag = false; }
camera_class* getCamera(int idx) { return mCameraInfo[idx].mCamera; }
s32 checkStatus(u16 flags) { return flags & mStatus; }
public:
/* 0x00000 */ dBgS mDBgS;
@@ -488,7 +491,7 @@ public:
/* 0x05F64 */ dDlst_list_c drawlist;
/* 0x1C104 */ u8 field_0x1C104[0x1F4];
/* 0x1C2F8 */ dRes_control_c mResControl;
/* 0x1DDF8 */ u8 field_0x1ddf8; // related to fade, controls brightness
/* 0x1DDF8 */ u8 mFadeBrightness;
/* 0x1DDF9 */ u8 mWorldDark;
/* 0x1DDFA */ s8 field_0x1ddfa;
/* 0x1DDFB */ s8 field_0x1ddfb;
@@ -509,6 +512,8 @@ STATIC_ASSERT(122384 == sizeof(dComIfG_inf_c));
extern dComIfG_inf_c g_dComIfG_gameInfo;
extern GXColor g_blackColor;
extern GXColor g_clearColor;
extern GXColor g_whiteColor;
void dComIfGp_setItemLifeCount(float, u8);
void dComIfGp_setItemRupeeCount(long);
@@ -552,6 +557,8 @@ void dComIfGp_mapShow();
void dComIfGp_mapHide();
bool dComIfGp_checkMapShow();
s32 dComIfGp_setHeapLockFlag(u8);
s8 dComIfGs_sense_type_change_Get();
u8 dComIfGp_world_dark_get();
inline void dComIfGp_setRStatus(u8 status, u8 flag) {
g_dComIfG_gameInfo.play.setRStatus(status, flag);
@@ -858,7 +865,7 @@ inline u8 dComIfGs_getOptVibration() {
return g_dComIfG_gameInfo.info.getPlayer().getConfig().getVibration();
}
inline s8 dComIfGp_roomControl_getStayNo() {
inline s32 dComIfGp_roomControl_getStayNo() {
return dStage_roomControl_c::getStayNo();
}
@@ -976,6 +983,10 @@ inline JKRExpHeap* dComIfGp_getExpHeap2D() {
return g_dComIfG_gameInfo.play.getExpHeap2D();
}
inline JKRExpHeap* dComIfGp_getMsgExpHeap() {
return g_dComIfG_gameInfo.play.getMsgExpHeap();
}
inline s16 dComIfGs_getOil() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getOil();
}
@@ -1144,6 +1155,10 @@ inline JKRArchive* dComIfGp_getCollectResArchive() {
return g_dComIfG_gameInfo.play.getCollectResArchive();
}
inline JKRArchive* dComIfGp_getItemIconArchive() {
return g_dComIfG_gameInfo.play.getItemIconArchive();
}
inline J2DGrafContext* dComIfGp_getCurrentGrafPort() {
return g_dComIfG_gameInfo.play.getCurrentGrafPort();
}
@@ -1198,6 +1213,21 @@ inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* param_2,
param_10, param_11, 1.0f);
}
inline u32 dComIfGp_particle_set(u16 param_1, const cXyz* param_2, const dKy_tevstr_c* param_3,
const csXyz* param_4, const cXyz* param_5, u8 param_6,
dPa_levelEcallBack* param_7, s8 param_8, const GXColor* param_9,
const GXColor* param_10, const cXyz* param_11) {
return g_dComIfG_gameInfo.play.getParticle()->setNormal(param_1, param_2, param_3, param_4,
param_5, param_6, param_7, param_8,
param_9, param_10, param_11, 1.0f);
}
inline u32 dComIfGp_particle_set(u16 param_0, const cXyz* param_1, const csXyz* param_2,
const cXyz* param_3) {
return dComIfGp_particle_set(param_0, param_1, NULL, param_2, param_3, 0xFF, NULL, -1, NULL,
NULL, NULL);
}
inline void dComIfGp_particle_levelEmitterOnEventMove(u32 param_0) {
g_dComIfG_gameInfo.play.getParticle()->forceOnEventMove(param_0);
}
@@ -1444,4 +1474,75 @@ inline void dComIfGp_offPauseFlag() {
g_dComIfG_gameInfo.play.offPauseFlag();
}
inline view_class* dComIfGd_getView() {
return g_dComIfG_gameInfo.drawlist.getView();
}
inline J3DDrawBuffer* dComIfGd_getListFilter() {
return g_dComIfG_gameInfo.drawlist.getOpaListFilter();
}
inline J3DDrawBuffer* dComIfGd_getOpaListIndScreen() {
return g_dComIfG_gameInfo.drawlist.getOpaListP0();
}
inline void dComIfGd_setListSky() {
g_dComIfG_gameInfo.drawlist.setOpaListSky();
g_dComIfG_gameInfo.drawlist.setXluListSky();
}
inline void dComIfGd_setList() {
g_dComIfG_gameInfo.drawlist.setOpaList();
g_dComIfG_gameInfo.drawlist.setXluList();
}
inline void dComIfGd_setXluList2DScreen() {
g_dComIfG_gameInfo.drawlist.setXluList2DScreen();
}
inline void dComIfGd_setXluListBG() {
g_dComIfG_gameInfo.drawlist.setXluListBG();
}
inline camera_class* dComIfGp_getCamera(int idx) {
return g_dComIfG_gameInfo.play.getCamera(idx);
}
inline s32 dComIfGp_checkStatus(u16 flags) {
return g_dComIfG_gameInfo.play.checkStatus(flags);
}
inline s32 dComIfGp_roomControl_getTimePass() {
return g_dComIfG_gameInfo.play.getRoomControl()->GetTimePass();
}
inline u16 dComIfGs_getDate() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().getDate();
}
inline void dComIfGs_setDate(u16 date) {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().setDate(date);
}
inline f32 dComIfGs_getTime() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().getTime();
}
inline void dComIfGs_setTime(f32 time) {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().setTime(time);
}
inline u8 dComIfG_getBrightness() {
return g_dComIfG_gameInfo.mFadeBrightness;
}
inline void dComIfGd_drawListItem3d() {
g_dComIfG_gameInfo.drawlist.drawOpaListItem3d();
g_dComIfG_gameInfo.drawlist.drawXluListItem3d();
}
inline void dComIfGd_init() {
g_dComIfG_gameInfo.drawlist.init();
}
#endif /* D_COM_D_COM_INF_GAME_H */

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