mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-02 00:38:46 -04:00
26 02 27 pjb dev 2 (#41)
* fix kankyo UB
* Fix TEV Stage DL writing
BE issue
* BE Fixes in materials/shapes
* Move to Aurora GD impl
* JUTDataFileHeader
* j3d: load vertex and texture not through GD
* Endian swap vertex data (mostly)
* Just exit(0) when closing the game
Fix crashes :godo:
* fix fopAcM_ct_placement and remove memcpy
* J3D: track vertex arrays correctly, swap work
* fix visibility, turn off overridden new/delete when we call into aurora
* event: cut name be
* Default window improvements
Double size, allow OS to decide position
* survive TParse::parseHeader_next
* color swap fix
* swap endian/fixes oob function pointer
* Remove GXGetViewportv stub
Aurora has it now
* Set array pointers via GD again
Relies on https://github.com/encounter/aurora/pull/35
* Let Aurora decide graphics backend
* disable procbar drawing
* Fix TColor endianness conversion issues
Fixes the wrong color for the flashing logo
* cam param swap
* simplify vtx loading, mat/amb color fix
* endian swap stb/fvb data
* aurora stat changes
* fix storage buffer crash
dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things
* set bgobj spec fix
* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped
* JKRExpHeap: fix bad allocator slowdown
* solid tex
* texture caching
* log level
* fix window aspect ratio, disable bloom, endian swap camera type data
camera is now actually playing opening cutscene!!!!
* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs
* endian swap joint weight envelope data
* move to dusk config
* verbose arg errors
* better stub logging (for now)
* less logging, more BE
* more stubbing, move logging stuff around
* move all logging to aurora logging
* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.
* update aurora
* fix heap alignment mismatch and always head align for now
* prevent them from fucking up my shit
* forward jut warning to DuskLog
* remove report logging
* maybe and i must emphasize maybe fix JMessage parsing
* this was a dumb idea
* preserve negative alignment for JKRHeap
* use normal free on macos and linux
* ^
* fix JMAHermiteInterpolation c impl
* endian swap J2DScreen mColor (oops)
* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm
* typo fix
* Fix aligned_alloc() size issues on POSIX
aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.
Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.
* _Exit instead of exit()
Seriously I don't want destructors to run. Let the OS reclaim that shit.
* Reapply "Isolate JKRHeap operator overloads" (#39)
This reverts commit 3623b27f37.
* Fix some oopsies
* Fix hardcoded pointer size in JUTCacheFont::allocArray
* More operator overload fixes
Add void template specialization for jkrDelete
Add new[] placement overload. Apparently.
* Fix delete macros on nullptr
TIL C++ allows that.
* fix delete[]
* fix new(std::nothrow) overload
* fix avoid ub
* swap remaining anim data needed for title logo
* get rid of op 7
* move aurora_end_frame to correct spot
* juttexture destroy tex
* j2d animation be
* shutdown crash
* link warp material fix
* mDoExt_3DlineMat1_c fix
* hacky keyboard controls
* endian swap J2DResReference, add kb_pad to files.cmake
* fix some missing endian swaps in J2D, remove addr alignment check
* Remove heap unsetting in aurora calls
Never worked properly and not the right solution even if it did
* Don't print in DC stubs
They're fine to never implement
* Fix alignment stuff again
* Compile GF from dolphin lib
Doesn't seem to break anything and shuts up some stub warnings
* j3dtexture tlut obj fix
* addTexMtxIndexInDL fix
* don't recreate null tex data every frame
* the actual fix i wanted to push
* its kinda fakematch city over here
* insert hte efb copy
* limited window size / viewport support
* IsDelete FIX
---------
Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
820e2e3df6
commit
b289dece80
@@ -1,9 +1,10 @@
|
||||
#ifndef J2DANIMATION_H
|
||||
#define J2DANIMATION_H
|
||||
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
|
||||
#include "JSystem/JUtility/JUTPalette.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
|
||||
class J2DScreen;
|
||||
struct ResTIMG;
|
||||
@@ -74,14 +75,14 @@ public:
|
||||
J3D_PANIC(345, param_2 < mAnmTableNum[param_1], "Error : range over.");
|
||||
return &mVtxColorIndexData[param_1][param_2];
|
||||
}
|
||||
u16* getVtxColorIndexPointer(u8 param_0) const {
|
||||
BE(u16)* getVtxColorIndexPointer(u8 param_0) const {
|
||||
J3D_PANIC(351, param_0 < 2, "Error : range over.");
|
||||
return mVtxColorIndexPointer[param_0];
|
||||
}
|
||||
|
||||
/* 0x10 */ u16 mAnmTableNum[2];
|
||||
/* 0x14 */ J3DAnmVtxColorIndexData* mVtxColorIndexData[2];
|
||||
/* 0x1C */ u16* mVtxColorIndexPointer[2];
|
||||
/* 0x1C */ BE(u16)* mVtxColorIndexPointer[2];
|
||||
}; // Size: 0x24
|
||||
|
||||
struct J3DTransformInfo;
|
||||
@@ -102,10 +103,10 @@ public:
|
||||
virtual void getColor(u8, u16, GXColor*) const;
|
||||
|
||||
/* 0x24 */ J3DAnmColorKeyTable* mInfoTable[2];
|
||||
/* 0x2C */ s16* mRValues;
|
||||
/* 0x30 */ s16* mGValues;
|
||||
/* 0x34 */ s16* mBValues;
|
||||
/* 0x38 */ s16* mAValues;
|
||||
/* 0x2C */ BE(s16)* mRValues;
|
||||
/* 0x30 */ BE(s16)* mGValues;
|
||||
/* 0x34 */ BE(s16)* mBValues;
|
||||
/* 0x38 */ BE(s16)* mAValues;
|
||||
}; // Size: 0x3C
|
||||
|
||||
/**
|
||||
@@ -157,7 +158,7 @@ public:
|
||||
*/
|
||||
class J2DAnmTransform : public J2DAnmBase {
|
||||
public:
|
||||
J2DAnmTransform(s16 frameMax, f32* pScaleValues, s16* pRotationValues, f32* pTranslateValues) : J2DAnmBase(frameMax) {
|
||||
J2DAnmTransform(s16 frameMax, BE(f32)* pScaleValues, BE(s16)* pRotationValues, BE(f32)* pTranslateValues) : J2DAnmBase(frameMax) {
|
||||
mScaleValues = pScaleValues;
|
||||
mRotationValues = pRotationValues;
|
||||
mTranslateValues = pTranslateValues;
|
||||
@@ -166,9 +167,9 @@ public:
|
||||
virtual ~J2DAnmTransform() {}
|
||||
virtual void getTransform(u16, J3DTransformInfo*) const {}
|
||||
|
||||
/* 0x10 */ f32* mScaleValues;
|
||||
/* 0x14 */ s16* mRotationValues;
|
||||
/* 0x18 */ f32* mTranslateValues;
|
||||
/* 0x10 */ BE(f32)* mScaleValues;
|
||||
/* 0x14 */ BE(s16)* mRotationValues;
|
||||
/* 0x18 */ BE(f32)* mTranslateValues;
|
||||
}; // Size: 0x1C
|
||||
|
||||
/**
|
||||
@@ -250,25 +251,25 @@ public:
|
||||
/* 0x1A */ u16 field_0x1a;
|
||||
/* 0x1C */ u16 field_0x1c;
|
||||
/* 0x1E */ u16 field_0x1e;
|
||||
/* 0x20 */ f32* mScaleValues;
|
||||
/* 0x24 */ s16* mRotationValues;
|
||||
/* 0x28 */ f32* mTranslationValues;
|
||||
/* 0x20 */ BE(f32)* mScaleValues;
|
||||
/* 0x24 */ BE(s16)* mRotationValues;
|
||||
/* 0x28 */ BE(f32)* mTranslationValues;
|
||||
/* 0x2C */ u8* mUpdateTexMtxID;
|
||||
/* 0x30 */ u16* mUpdateMaterialID;
|
||||
/* 0x30 */ BE(u16)* mUpdateMaterialID;
|
||||
/* 0x34 */ JUTNameTab field_0x34;
|
||||
/* 0x44 */ Vec* field_0x44;
|
||||
/* 0x44 */ BE(Vec)* field_0x44;
|
||||
/* 0x48 */ u16 field_0x48;
|
||||
/* 0x4A */ u16 field_0x4a;
|
||||
/* 0x4C */ u16 field_0x4c;
|
||||
/* 0x4E */ u16 field_0x4e;
|
||||
/* 0x50 */ f32* field_0x50;
|
||||
/* 0x54 */ s16* field_0x54;
|
||||
/* 0x58 */ f32* field_0x58;
|
||||
/* 0x50 */ BE(f32)* field_0x50;
|
||||
/* 0x54 */ BE(s16)* field_0x54;
|
||||
/* 0x58 */ BE(f32)* field_0x58;
|
||||
/* 0x5C */ J3DAnmTransformKeyTable* field_0x5c;
|
||||
/* 0x60 */ u8* field_0x60;
|
||||
/* 0x64 */ u16* field_0x64;
|
||||
/* 0x64 */ BE(u16)* field_0x64;
|
||||
/* 0x68 */ JUTNameTab field_0x68;
|
||||
/* 0x78 */ Vec* field_0x78;
|
||||
/* 0x78 */ BE(Vec)* field_0x78;
|
||||
/* 0x7C */ int field_0x7c;
|
||||
};
|
||||
|
||||
@@ -284,7 +285,7 @@ public:
|
||||
mPalette = NULL;
|
||||
}
|
||||
~J2DAnmTexPatternTIMGPointer() {
|
||||
delete mPalette;
|
||||
JKR_DELETE(mPalette);
|
||||
}
|
||||
|
||||
/* 0x0 */ ResTIMG* mRes;
|
||||
@@ -304,7 +305,7 @@ public:
|
||||
ResTIMG* getResTIMG(u16) const;
|
||||
JUTPalette* getPalette(u16) const;
|
||||
|
||||
virtual ~J2DAnmTexPattern() { delete[] mTIMGPtrArray; }
|
||||
virtual ~J2DAnmTexPattern() { JKR_DELETE_ARRAY(mTIMGPtrArray); }
|
||||
virtual void searchUpdateMaterialID(J2DScreen*);
|
||||
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
|
||||
u16 getUpdateMaterialID(u16 i) const {
|
||||
@@ -313,11 +314,11 @@ public:
|
||||
}
|
||||
J3DAnmTexPatternFullTable* getAnmTable() const { return mAnmTable; }
|
||||
|
||||
/* 0x10 */ u16* mValues;
|
||||
/* 0x10 */ BE(u16)* mValues;
|
||||
/* 0x14 */ J3DAnmTexPatternFullTable* mAnmTable;
|
||||
/* 0x18 */ u16 field_0x18;
|
||||
/* 0x1A */ u16 mUpdateMaterialNum;
|
||||
/* 0x1C */ u16* mUpdateMaterialID;
|
||||
/* 0x1C */ BE(u16)* mUpdateMaterialID;
|
||||
/* 0x20 */ JUTNameTab field_0x20;
|
||||
/* 0x30 */ J2DAnmTexPatternTIMGPointer* mTIMGPtrArray;
|
||||
};
|
||||
@@ -368,20 +369,20 @@ public:
|
||||
/* 0x1E */ u16 field_0x1e;
|
||||
/* 0x20 */ u16 field_0x20;
|
||||
/* 0x22 */ u16 field_0x22;
|
||||
/* 0x24 */ u16* mCRegUpdateMaterialID;
|
||||
/* 0x24 */ BE(u16)* mCRegUpdateMaterialID;
|
||||
/* 0x28 */ JUTNameTab mCRegNameTab;
|
||||
/* 0x38 */ u16* mKRegUpdateMaterialID;
|
||||
/* 0x38 */ BE(u16)* mKRegUpdateMaterialID;
|
||||
/* 0x3C */ JUTNameTab mKRegNameTab;
|
||||
/* 0x4C */ J3DAnmCRegKeyTable* mAnmCRegKeyTable;
|
||||
/* 0x50 */ J3DAnmKRegKeyTable* mAnmKRegKeyTable;
|
||||
/* 0x54 */ s16* mCRValues;
|
||||
/* 0x58 */ s16* mCGValues;
|
||||
/* 0x5C */ s16* mCBValues;
|
||||
/* 0x60 */ s16* mCAValues;
|
||||
/* 0x64 */ s16* mKRValues;
|
||||
/* 0x68 */ s16* mKGValues;
|
||||
/* 0x6C */ s16* mKBValues;
|
||||
/* 0x70 */ s16* mKAValues;
|
||||
/* 0x54 */ BE(s16)* mCRValues;
|
||||
/* 0x58 */ BE(s16)* mCGValues;
|
||||
/* 0x5C */ BE(s16)* mCBValues;
|
||||
/* 0x60 */ BE(s16)* mCAValues;
|
||||
/* 0x64 */ BE(s16)* mKRValues;
|
||||
/* 0x68 */ BE(s16)* mKGValues;
|
||||
/* 0x6C */ BE(s16)* mKBValues;
|
||||
/* 0x70 */ BE(s16)* mKAValues;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -410,7 +411,7 @@ public:
|
||||
/* 0x14 */ u16 field_0x14;
|
||||
/* 0x16 */ u16 field_0x16;
|
||||
/* 0x18 */ u16 mUpdateMaterialNum;
|
||||
/* 0x1C */ u16* mUpdateMaterialID;
|
||||
/* 0x1C */ BE(u16)* mUpdateMaterialID;
|
||||
/* 0x20 */ JUTNameTab field_0x20;
|
||||
}; // Size: 0x30
|
||||
|
||||
@@ -430,10 +431,10 @@ public:
|
||||
virtual ~J2DAnmColorKey() {}
|
||||
virtual void getColor(u16, GXColor*) const;
|
||||
|
||||
/* 0x30 */ s16* mRValues;
|
||||
/* 0x34 */ s16* mGValues;
|
||||
/* 0x38 */ s16* mBValues;
|
||||
/* 0x3C */ s16* mAValues;
|
||||
/* 0x30 */ BE(s16)* mRValues;
|
||||
/* 0x34 */ BE(s16)* mGValues;
|
||||
/* 0x38 */ BE(s16)* mBValues;
|
||||
/* 0x3C */ BE(s16)* mAValues;
|
||||
/* 0x40 */ J3DAnmColorKeyTable* mInfoTable;
|
||||
};
|
||||
|
||||
@@ -475,14 +476,14 @@ public:
|
||||
/* 0x40 */ J3DAnmColorFullTable* mInfoTable;
|
||||
};
|
||||
|
||||
inline f32 J2DHermiteInterpolation(f32 f1, const f32* f2, const f32* f3, const f32* f4, const f32* f5, const f32* f6,
|
||||
const f32* f7) {
|
||||
inline f32 J2DHermiteInterpolation(f32 f1, const BE(f32)* f2, const BE(f32)* f3, const BE(f32)* f4,
|
||||
const BE(f32)* f5, const BE(f32)* f6, const BE(f32)* f7) {
|
||||
return JMAHermiteInterpolation(f1, *f2, *f3, *f4, *f5, *f6, *f7);
|
||||
}
|
||||
|
||||
inline f32 J2DHermiteInterpolation(__REGISTER f32 pp1, __REGISTER s16* pp2, __REGISTER s16* pp3,
|
||||
__REGISTER s16* pp4, __REGISTER s16* pp5, __REGISTER s16* pp6,
|
||||
__REGISTER s16* pp7) {
|
||||
inline f32 J2DHermiteInterpolation(__REGISTER f32 pp1, __REGISTER BE(s16)* pp2, __REGISTER BE(s16)* pp3,
|
||||
__REGISTER BE(s16)* pp4, __REGISTER BE(s16)* pp5, __REGISTER BE(s16)* pp6,
|
||||
__REGISTER BE(s16)* pp7) {
|
||||
#ifdef __MWERKS__
|
||||
__REGISTER f32 p1 = pp1;
|
||||
__REGISTER f32 ff8;
|
||||
|
||||
@@ -10,8 +10,8 @@ class JSUInputStream;
|
||||
*
|
||||
*/
|
||||
struct J2DResReference {
|
||||
/* 0x00 */ u16 mCount;
|
||||
/* 0x02 */ u16 mOffsets[1];
|
||||
/* 0x00 */ BE(u16) mCount;
|
||||
/* 0x02 */ BE(u16) mOffsets[1];
|
||||
|
||||
char* getResReference(u16) const;
|
||||
char* getName(u16) const;
|
||||
|
||||
@@ -47,7 +47,7 @@ struct J2DScrnBlockPictureParameter {
|
||||
/* 0x06 */ BE(u16) field_0x6;
|
||||
/* 0x08 */ BE(u16) field_0x8[4];
|
||||
/* 0x10 */ JGeometry::TVec2<BE(s16)> field_0x10[4];
|
||||
/* 0x20 */ u32 mCornerColor[4];
|
||||
/* 0x20 */ BE(u32) mCornerColor[4];
|
||||
}; // Size: 0x30
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ struct J2DScrnInfoHeader {
|
||||
/* 0x4 */ BE(u32) mSize;
|
||||
/* 0x8 */ BE(u16) mWidth;
|
||||
/* 0xA */ BE(u16) mHeight;
|
||||
/* 0xC */ u32 mColor;
|
||||
/* 0xC */ BE(u32) mColor;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,8 +47,8 @@ struct J2DTextBoxInfo {
|
||||
/* 0x14 */ BE(u32) mGradColor;
|
||||
/* 0x18 */ u8 mConnected;
|
||||
/* 0x19 */ char field_0x19[3];
|
||||
/* 0x1C */ u16 field_0x1c;
|
||||
/* 0x1E */ u16 field_0x1e;
|
||||
/* 0x1C */ BE(u16) field_0x1c;
|
||||
/* 0x1E */ BE(u16) field_0x1e;
|
||||
}; // Size: 0x20
|
||||
|
||||
/**
|
||||
|
||||
@@ -611,7 +611,7 @@ public:
|
||||
}
|
||||
bool isValidUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx] != 0xffff; }
|
||||
u32 getTexMtxCalcType() { return mTexMtxCalcType; }
|
||||
Vec* getSRTCenter(u16 idx) {
|
||||
BE(Vec)* getSRTCenter(u16 idx) {
|
||||
J3D_ASSERT_RANGE(1047, idx < mTrackNum / 3);
|
||||
return &mSRTCenter[idx];
|
||||
}
|
||||
@@ -622,13 +622,13 @@ public:
|
||||
/* 0x16 */ u16 mScaleNum;
|
||||
/* 0x18 */ u16 mRotNum;
|
||||
/* 0x1A */ u16 mTransNum;
|
||||
/* 0x1C */ f32* mScaleData;
|
||||
/* 0x20 */ s16* mRotData;
|
||||
/* 0x24 */ f32* mTransData;
|
||||
/* 0x1C */ BE(f32)* mScaleData;
|
||||
/* 0x20 */ BE(s16)* mRotData;
|
||||
/* 0x24 */ BE(f32)* mTransData;
|
||||
/* 0x28 */ u8* mUpdateTexMtxID;
|
||||
/* 0x2C */ u16* mUpdateMaterialID;
|
||||
/* 0x2C */ BE(u16)* mUpdateMaterialID;
|
||||
/* 0x30 */ JUTNameTab mUpdateMaterialName;
|
||||
/* 0x40 */ Vec* mSRTCenter;
|
||||
/* 0x40 */ BE(Vec)* mSRTCenter;
|
||||
/* 0x44 */ u16 field_0x44;
|
||||
/* 0x46 */ u16 field_0x46;
|
||||
/* 0x48 */ u16 field_0x48;
|
||||
@@ -638,9 +638,9 @@ public:
|
||||
/* 0x54 */ void* field_0x54;
|
||||
/* 0x58 */ void* field_0x58;
|
||||
/* 0x5C */ u8* mPostUpdateTexMtxID;
|
||||
/* 0x60 */ u16* mPostUpdateMaterialID;
|
||||
/* 0x60 */ BE(u16)* mPostUpdateMaterialID;
|
||||
/* 0x64 */ JUTNameTab mPostUpdateMaterialName;
|
||||
/* 0x74 */ Vec* mPostSRTCenter;
|
||||
/* 0x74 */ BE(Vec)* mPostSRTCenter;
|
||||
/* 0x78 */ u32 mTexMtxCalcType;
|
||||
}; // Size: 0x7C
|
||||
|
||||
@@ -787,7 +787,7 @@ public:
|
||||
/* 0x10 */ u16 field_0x10;
|
||||
/* 0x12 */ u16 field_0x12;
|
||||
/* 0x14 */ u16 mUpdateMaterialNum;
|
||||
/* 0x18 */ u16* mUpdateMaterialID;
|
||||
/* 0x18 */ BE(u16)* mUpdateMaterialID;
|
||||
/* 0x1C */ JUTNameTab mUpdateMaterialName;
|
||||
}; // Size: 0x2C
|
||||
|
||||
@@ -822,10 +822,10 @@ public:
|
||||
virtual s32 getKind() const { return 11; }
|
||||
virtual void getColor(u16, GXColor*) const;
|
||||
|
||||
/* 0x2C */ s16* mColorR;
|
||||
/* 0x30 */ s16* mColorG;
|
||||
/* 0x34 */ s16* mColorB;
|
||||
/* 0x38 */ s16* mColorA;
|
||||
/* 0x2C */ BE(s16)* mColorR;
|
||||
/* 0x30 */ BE(s16)* mColorG;
|
||||
/* 0x34 */ BE(s16)* mColorB;
|
||||
/* 0x38 */ BE(s16)* mColorA;
|
||||
/* 0x3C */ J3DAnmColorKeyTable* mAnmTable;
|
||||
};
|
||||
|
||||
@@ -872,20 +872,20 @@ public:
|
||||
/* 0x1A */ u16 mKRegDataCountG;
|
||||
/* 0x1C */ u16 mKRegDataCountB;
|
||||
/* 0x1E */ u16 mKRegDataCountA;
|
||||
/* 0x20 */ u16* mCRegUpdateMaterialID;
|
||||
/* 0x20 */ BE(u16)* mCRegUpdateMaterialID;
|
||||
/* 0x24 */ JUTNameTab mCRegUpdateMaterialName;
|
||||
/* 0x34 */ u16* mKRegUpdateMaterialID;
|
||||
/* 0x34 */ BE(u16)* mKRegUpdateMaterialID;
|
||||
/* 0x38 */ JUTNameTab mKRegUpdateMaterialName;
|
||||
/* 0x48 */ J3DAnmCRegKeyTable* mAnmCRegKeyTable;
|
||||
/* 0x4C */ J3DAnmKRegKeyTable* mAnmKRegKeyTable;
|
||||
/* 0x50 */ s16* mAnmCRegDataR;
|
||||
/* 0x54 */ s16* mAnmCRegDataG;
|
||||
/* 0x58 */ s16* mAnmCRegDataB;
|
||||
/* 0x5C */ s16* mAnmCRegDataA;
|
||||
/* 0x60 */ s16* mAnmKRegDataR;
|
||||
/* 0x64 */ s16* mAnmKRegDataG;
|
||||
/* 0x68 */ s16* mAnmKRegDataB;
|
||||
/* 0x6C */ s16* mAnmKRegDataA;
|
||||
/* 0x50 */ BE(s16)* mAnmCRegDataR;
|
||||
/* 0x54 */ BE(s16)* mAnmCRegDataG;
|
||||
/* 0x58 */ BE(s16)* mAnmCRegDataB;
|
||||
/* 0x5C */ BE(s16)* mAnmCRegDataA;
|
||||
/* 0x60 */ BE(s16)* mAnmKRegDataR;
|
||||
/* 0x64 */ BE(s16)* mAnmKRegDataG;
|
||||
/* 0x68 */ BE(s16)* mAnmKRegDataB;
|
||||
/* 0x6C */ BE(s16)* mAnmKRegDataA;
|
||||
}; // Size: 0x70
|
||||
|
||||
/**
|
||||
@@ -910,11 +910,11 @@ public:
|
||||
bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; }
|
||||
J3DAnmTexPatternFullTable* getAnmTable() { return mAnmTable; }
|
||||
|
||||
/* 0x0C */ u16* mTextureIndex;
|
||||
/* 0x0C */ BE(u16)* mTextureIndex;
|
||||
/* 0x10 */ J3DAnmTexPatternFullTable* mAnmTable;
|
||||
/* 0x14 */ u16 field_0x14;
|
||||
/* 0x16 */ u16 mUpdateMaterialNum;
|
||||
/* 0x18 */ u16* mUpdateMaterialID;
|
||||
/* 0x18 */ BE(u16)* mUpdateMaterialID;
|
||||
/* 0x1C */ JUTNameTab mUpdateMaterialName;
|
||||
}; // Size: 0x2C
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ struct J3DDrawMtxData {
|
||||
/* 0x0 */ u16 mEntryNum;
|
||||
/* 0x2 */ u16 mDrawFullWgtMtxNum;
|
||||
/* 0x4 */ u8* mDrawMtxFlag;
|
||||
/* 0x8 */ u16* mDrawMtxIndex;
|
||||
/* 0x8 */ BE(u16)* mDrawMtxIndex;
|
||||
}; // Size: 0xC
|
||||
|
||||
class J3DShapeTable;
|
||||
@@ -55,10 +55,10 @@ public:
|
||||
void setHierarchy(J3DModelHierarchy* hierarchy) { mHierarchy = hierarchy; }
|
||||
void setBasicMtxCalc(J3DMtxCalc* calc) { mBasicMtxCalc = calc; }
|
||||
u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; }
|
||||
u16* getWEvlpMixIndex() const { return mWEvlpMixMtxIndex; }
|
||||
BE(u16)* getWEvlpMixIndex() const { return mWEvlpMixMtxIndex; }
|
||||
u8 getWEvlpMixMtxNum(u16 idx) const { return mWEvlpMixMtxNum[idx]; }
|
||||
u16 * getWEvlpMixMtxIndex() const { return mWEvlpMixMtxIndex; }
|
||||
f32 * getWEvlpMixWeight() const { return mWEvlpMixWeight; }
|
||||
BE(u16) * getWEvlpMixMtxIndex() const { return mWEvlpMixMtxIndex; }
|
||||
BE(f32) * getWEvlpMixWeight() const { return mWEvlpMixWeight; }
|
||||
u16 * getWEvlpImportantMtxIndex() const { return mWEvlpImportantMtxIdx; }
|
||||
u16 getDrawFullWgtMtxNum() const { return mDrawMtxData.mDrawFullWgtMtxNum; }
|
||||
u16 getJointNum() const { return mJointNum; }
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
return mJointNodePointer[idx];
|
||||
}
|
||||
J3DMtxCalc* getBasicMtxCalc() { return mBasicMtxCalc; }
|
||||
Mtx& getInvJointMtx(int idx) { return mInvJointMtx[idx]; }
|
||||
BE(Mtx)& getInvJointMtx(int idx) { return mInvJointMtx[idx]; }
|
||||
u32 getModelDataType() const { return mModelDataType; }
|
||||
void setModelDataType(u32 type) { mModelDataType = type; }
|
||||
bool checkFlag(u32 flag) const { return mFlags & flag ? true : false; }
|
||||
@@ -91,9 +91,9 @@ private:
|
||||
/* 0x1C */ u16 mJointNum;
|
||||
/* 0x1E */ u16 mWEvlpMtxNum;
|
||||
/* 0x20 */ u8* mWEvlpMixMtxNum;
|
||||
/* 0x24 */ u16* mWEvlpMixMtxIndex;
|
||||
/* 0x28 */ f32* mWEvlpMixWeight;
|
||||
/* 0x2C */ Mtx* mInvJointMtx;
|
||||
/* 0x24 */ BE(u16)* mWEvlpMixMtxIndex;
|
||||
/* 0x28 */ BE(f32)* mWEvlpMixWeight;
|
||||
/* 0x2C */ BE(Mtx)* mInvJointMtx;
|
||||
/* 0x30 */ u16* mWEvlpImportantMtxIdx;
|
||||
/* 0x34 */ J3DDrawMtxData mDrawMtxData;
|
||||
/* 0x40 */ u32 field_0x40;
|
||||
|
||||
@@ -38,6 +38,9 @@ public:
|
||||
}
|
||||
u32 getVtxNum() const { return mVertexData.getVtxNum(); }
|
||||
u32 getNrmNum() const { return mVertexData.getNrmNum(); }
|
||||
#if TARGET_PC
|
||||
u32 getColNum() const { return mVertexData.getColNum(); }
|
||||
#endif
|
||||
u8 getDrawMtxFlag(u16 idx) const { return mJointTree.getDrawMtxFlag(idx); }
|
||||
u16 getDrawMtxIndex(u16 idx) const { return mJointTree.getDrawMtxIndex(idx); }
|
||||
J3DDrawMtxData* getDrawMtxData() { return mJointTree.getDrawMtxData(); }
|
||||
@@ -49,12 +52,12 @@ public:
|
||||
void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); }
|
||||
void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); }
|
||||
JUTNameTab* getJointName() const { return mJointTree.getJointName(); }
|
||||
Mtx& getInvJointMtx(int idx) { return mJointTree.getInvJointMtx(idx); }
|
||||
BE(Mtx)& getInvJointMtx(int idx) { return mJointTree.getInvJointMtx(idx); }
|
||||
J3DTexture* getTexture() const { return mMaterialTable.getTexture(); }
|
||||
JUTNameTab* getTextureName() const { return mMaterialTable.getTextureName(); }
|
||||
u16 getWEvlpMtxNum() const { return mJointTree.getWEvlpMtxNum(); }
|
||||
u16* getWEvlpMixMtxIndex() const { return mJointTree.getWEvlpMixMtxIndex(); }
|
||||
f32* getWEvlpMixWeight() const { return mJointTree.getWEvlpMixWeight(); }
|
||||
BE(u16)* getWEvlpMixMtxIndex() const { return mJointTree.getWEvlpMixMtxIndex(); }
|
||||
BE(f32)* getWEvlpMixWeight() const { return mJointTree.getWEvlpMixWeight(); }
|
||||
u8 getWEvlpMixMtxNum(u16 idx) const { return mJointTree.getWEvlpMixMtxNum(idx); }
|
||||
u16* getWEvlpImportantMtxIndex() const { return mJointTree.getWEvlpImportantMtxIndex(); }
|
||||
u32 getModelDataType() const { return mJointTree.getModelDataType(); }
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
virtual void deform(J3DVertexBuffer*, J3DMtxBuffer*);
|
||||
virtual ~J3DSkinDeform();
|
||||
|
||||
static u16* sWorkArea_WEvlpMixMtx[1024];
|
||||
static f32* sWorkArea_WEvlpMixWeight[1024];
|
||||
static BE(u16)* sWorkArea_WEvlpMixMtx[1024];
|
||||
static BE(f32)* sWorkArea_WEvlpMixWeight[1024];
|
||||
static u16 sWorkArea_MtxReg[1024];
|
||||
|
||||
private:
|
||||
|
||||
@@ -587,6 +587,9 @@ public:
|
||||
virtual void patchTexNoAndTexCoordScale() {}
|
||||
virtual void ptrToIndex() = 0;
|
||||
virtual void indexToPtr() = 0;
|
||||
#if TARGET_PC
|
||||
virtual void loadTexture() = 0;
|
||||
#endif
|
||||
virtual u32 getType() = 0;
|
||||
virtual s32 countDLSize() { return 0; }
|
||||
virtual void setTexNo(u32, u16 const*) {}
|
||||
@@ -644,6 +647,7 @@ public:
|
||||
virtual void reset(J3DTevBlock*) {}
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
virtual void loadTexture() {}
|
||||
virtual u32 getType() { return 'TVNL'; }
|
||||
virtual ~J3DTevBlockNull() {}
|
||||
};
|
||||
@@ -671,6 +675,9 @@ public:
|
||||
virtual void patchTevReg();
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex();
|
||||
#if TARGET_PC
|
||||
virtual void loadTexture();
|
||||
#endif
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
virtual u32 getType() { return 'TVPT'; }
|
||||
virtual void setTevStageNum(u8 const* num) {
|
||||
@@ -814,6 +821,9 @@ public:
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
#if TARGET_PC
|
||||
virtual void loadTexture();
|
||||
#endif
|
||||
virtual u32 getType() { return 'TVB1'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 idx, u16 const* no) {
|
||||
@@ -904,6 +914,9 @@ public:
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
#if TARGET_PC
|
||||
virtual void loadTexture();
|
||||
#endif
|
||||
virtual u32 getType() { return 'TVB2'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 idx, u16 const* texNo) {
|
||||
@@ -1080,6 +1093,9 @@ public:
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
#if TARGET_PC
|
||||
virtual void loadTexture();
|
||||
#endif
|
||||
virtual u32 getType() { return 'TVB4'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 idx, u16 const* texNo) {
|
||||
@@ -1256,6 +1272,9 @@ public:
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex();
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
#if TARGET_PC
|
||||
virtual void loadTexture();
|
||||
#endif
|
||||
virtual u32 getType() { return 'TV16'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 idx, u16 const* texNo) {
|
||||
|
||||
@@ -56,7 +56,11 @@ public:
|
||||
J3DIndBlock* getIndBlock() { return mIndBlock; }
|
||||
J3DJoint* getJoint() { return mJoint; }
|
||||
J3DMaterialAnm* getMaterialAnm() {
|
||||
#if TARGET_PC
|
||||
return mMaterialAnm;
|
||||
#else
|
||||
return (uintptr_t)mMaterialAnm < 0xC0000000 ? mMaterialAnm : NULL;
|
||||
#endif
|
||||
}
|
||||
u32 getMaterialMode() { return mMaterialMode; }
|
||||
J3DNBTScale* getNBTScale() { return mTexGenBlock->getNBTScale(); }
|
||||
|
||||
@@ -15,8 +15,8 @@ class J3DShapeMtx;
|
||||
*/
|
||||
class J3DCurrentMtxInfo {
|
||||
public:
|
||||
u32 mMtxIdxRegA;
|
||||
u32 mMtxIdxRegB;
|
||||
BE(u32) mMtxIdxRegA;
|
||||
BE(u32) mMtxIdxRegB;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,11 @@ public:
|
||||
initialize();
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static const int kVcdVatDLSize = 0x180;
|
||||
#else
|
||||
static const int kVcdVatDLSize = 0xC0;
|
||||
#endif
|
||||
|
||||
void initialize();
|
||||
void addTexMtxIndexInDL(GXAttr, u32);
|
||||
|
||||
@@ -65,6 +65,11 @@ struct J3DSys {
|
||||
/* 0x10C */ void* mVtxPos;
|
||||
/* 0x110 */ void* mVtxNrm;
|
||||
/* 0x114 */ GXColor* mVtxCol;
|
||||
#if TARGET_PC
|
||||
int mVtxPosNum = 0;
|
||||
int mVtxNrmNum = 0;
|
||||
int mVtxColNum = 0;
|
||||
#endif
|
||||
/* 0x118 */ BE(Vec)* mNBTScale;
|
||||
|
||||
J3DSys();
|
||||
@@ -151,21 +156,34 @@ struct J3DSys {
|
||||
void setModelNrmMtx(Mtx33* pMtxArr) {
|
||||
J3D_ASSERT_NULLPTR(241, pMtxArr);
|
||||
mModelNrmMtx = pMtxArr;
|
||||
GXSETARRAY(GX_POS_MTX_ARRAY, mModelNrmMtx, sizeof(*mModelNrmMtx), sizeof(*mModelNrmMtx));
|
||||
GXSETARRAY(GX_NRM_MTX_ARRAY, mModelNrmMtx, sizeof(*mModelNrmMtx), sizeof(*mModelNrmMtx));
|
||||
}
|
||||
|
||||
void* getVtxPos() { return mVtxPos; }
|
||||
|
||||
void setVtxPos(void* pVtxPos) {
|
||||
void setVtxPos(void* pVtxPos, int num) {
|
||||
J3D_ASSERT_NULLPTR(252, pVtxPos != NULL);
|
||||
mVtxPos = pVtxPos;
|
||||
#if TARGET_PC
|
||||
mVtxPosNum = num;
|
||||
#endif
|
||||
}
|
||||
|
||||
void* getVtxNrm() { return mVtxNrm; }
|
||||
void setVtxNrm(void* pVtxNrm) { mVtxNrm = pVtxNrm; }
|
||||
void setVtxNrm(void* pVtxNrm, int num) {
|
||||
mVtxNrm = pVtxNrm;
|
||||
#if TARGET_PC
|
||||
mVtxNrmNum = num;
|
||||
#endif
|
||||
}
|
||||
|
||||
void* getVtxCol() { return mVtxCol; }
|
||||
void setVtxCol(GXColor* pVtxCol) { mVtxCol = pVtxCol; }
|
||||
void setVtxCol(GXColor* pVtxCol, int num) {
|
||||
mVtxCol = pVtxCol;
|
||||
#if TARGET_PC
|
||||
mVtxColNum = num;
|
||||
#endif
|
||||
}
|
||||
|
||||
Mtx& getModelDrawMtx(u16 no) { return mModelDrawMtx[no]; }
|
||||
J3DShapePacket* getShapePacket() { return mShapePacket; }
|
||||
|
||||
@@ -112,8 +112,8 @@ struct J3DTevStage {
|
||||
void setTexSel(u8 tex_sel) { mTevSwapModeInfo = (mTevSwapModeInfo & ~0xc) | (tex_sel << 2); }
|
||||
|
||||
void load(u32 param_1) const {
|
||||
J3DGDWriteBPCmd(*(u32*)&field_0x0);
|
||||
J3DGDWriteBPCmd(*(u32*)&field_0x4);
|
||||
J3DGDWriteBPCmd(*(BE(u32)*)&field_0x0);
|
||||
J3DGDWriteBPCmd(*(BE(u32)*)&field_0x4);
|
||||
}
|
||||
|
||||
J3DTevStage& operator=(const J3DTevStage& other) {
|
||||
|
||||
@@ -17,15 +17,45 @@ private:
|
||||
/* 0x2 */ u16 unk_0x2;
|
||||
/* 0x4 */ ResTIMG* mpRes;
|
||||
|
||||
#if TARGET_PC
|
||||
GXTlutObj* mpTlutObj;
|
||||
GXTexObj* mpTexObj;
|
||||
u8** mpImgDataPtr;
|
||||
u8** mpTlutDataPtr;
|
||||
#endif
|
||||
|
||||
public:
|
||||
J3DTexture(u16 num, ResTIMG* res) : mNum(num), unk_0x2(0), mpRes(res) {
|
||||
J3D_ASSERT_NULLPTR(52, res != NULL || num == 0);
|
||||
#if TARGET_PC
|
||||
mpTexObj = new GXTexObj[num];
|
||||
mpTlutObj = new GXTlutObj[num];
|
||||
mpImgDataPtr = new u8*[num];
|
||||
mpTlutDataPtr = new u8*[num];
|
||||
for (u16 i = 0; i < num; i++) {
|
||||
mpImgDataPtr[i] = (u8*)(&mpRes[i]) + mpRes[i].imageOffset;
|
||||
mpTlutDataPtr[i] = (u8*)(&mpRes[i]) + mpRes[i].paletteOffset;
|
||||
loadGXTexObj(i);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void loadGX(u16, GXTexMapID) const;
|
||||
#if TARGET_PC
|
||||
void loadGXTexObj(u16);
|
||||
#endif
|
||||
void entryNum(u16);
|
||||
void addResTIMG(u16, ResTIMG const*);
|
||||
virtual ~J3DTexture() {}
|
||||
virtual ~J3DTexture(){
|
||||
#if TARGET_PC
|
||||
for (int i = 0; i < mNum; i++)
|
||||
GXDestroyTexObj(&mpTexObj[i]);
|
||||
delete[] mpTexObj;
|
||||
delete[] mpTlutObj;
|
||||
delete[] mpImgDataPtr;
|
||||
delete[] mpTlutDataPtr;
|
||||
#endif
|
||||
}
|
||||
|
||||
u16 getNum() const { return mNum; }
|
||||
|
||||
@@ -34,11 +64,24 @@ public:
|
||||
return &mpRes[index];
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
u8* getImgDataPtr(u16 index) const {
|
||||
return mpImgDataPtr[index];
|
||||
}
|
||||
#endif
|
||||
|
||||
void setResTIMG(u16 index, const ResTIMG& timg) {
|
||||
J3D_ASSERT_RANGE(81, index < mNum);
|
||||
mpRes[index] = timg;
|
||||
|
||||
#if TARGET_PC
|
||||
mpImgDataPtr[index] = ((u8*)&timg) + timg.imageOffset;
|
||||
mpTlutDataPtr[index] = ((u8*)&timg) + timg.paletteOffset;
|
||||
loadGXTexObj(index);
|
||||
#else
|
||||
mpRes[index].imageOffset = ((mpRes[index].imageOffset + (uintptr_t)&timg - (uintptr_t)(mpRes + index)));
|
||||
mpRes[index].paletteOffset = ((mpRes[index].paletteOffset + (uintptr_t)&timg - (uintptr_t)(mpRes + index)));
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -52,6 +52,22 @@ public:
|
||||
void setVtxNrmFrac(u8 frac) { mVtxNrmFrac = frac; }
|
||||
void setVtxNrmType(GXCompType type) { mVtxNrmType = type; }
|
||||
|
||||
#if TARGET_PC
|
||||
u32 getVtxArrNum(GXAttr attr) const {
|
||||
JUT_ASSERT(1234, attr >= GX_VA_POS && attr <= GX_VA_TEX7);
|
||||
return mVtxArrNum[attr - GX_VA_POS];
|
||||
}
|
||||
|
||||
u32 getVtxArrStride(GXAttr attr) const {
|
||||
JUT_ASSERT(1234, attr >= GX_VA_POS && attr <= GX_VA_TEX7);
|
||||
return mVtxArrStride[attr - GX_VA_POS];
|
||||
}
|
||||
|
||||
u32 getVtxArrByteSize(GXAttr attr) const {
|
||||
return getVtxArrNum(attr) * getVtxArrStride(attr);
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend class J3DModelLoader;
|
||||
|
||||
@@ -70,6 +86,12 @@ private:
|
||||
/* 0x50 */ GXCompType mVtxPosType;
|
||||
/* 0x54 */ u8 mVtxNrmFrac;
|
||||
/* 0x58 */ GXCompType mVtxNrmType;
|
||||
|
||||
#if TARGET_PC
|
||||
bool mHasReadInformation = false;
|
||||
u32 mVtxArrStride[12]{};
|
||||
u32 mVtxArrNum[12]{};
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,12 +67,12 @@ struct J3DIndInitData {
|
||||
*
|
||||
*/
|
||||
struct J3DPatchingInfo {
|
||||
/* 0x0 */ u16 mMatColorOffset;
|
||||
/* 0x2 */ u16 mColorChanOffset;
|
||||
/* 0x4 */ u16 mTexMtxOffset;
|
||||
/* 0x6 */ u16 mTexNoOffset;
|
||||
/* 0x8 */ u16 mTevRegOffset;
|
||||
/* 0xA */ u16 mFogOffset;
|
||||
/* 0x0 */ BE(u16) mMatColorOffset;
|
||||
/* 0x2 */ BE(u16) mColorChanOffset;
|
||||
/* 0x4 */ BE(u16) mTexMtxOffset;
|
||||
/* 0x6 */ BE(u16) mTexNoOffset;
|
||||
/* 0x8 */ BE(u16) mTevRegOffset;
|
||||
/* 0xA */ BE(u16) mFogOffset;
|
||||
/* 0xC */ u8 field_0xc[4];
|
||||
}; // size 0x10
|
||||
|
||||
@@ -81,8 +81,8 @@ struct J3DPatchingInfo {
|
||||
*
|
||||
*/
|
||||
struct J3DDisplayListInit {
|
||||
/* 0x0 */ u32 mOffset;
|
||||
/* 0x4 */ u32 field_0x4;
|
||||
/* 0x0 */ BE(u32) mOffset;
|
||||
/* 0x4 */ BE(u32) field_0x4;
|
||||
}; // size 8
|
||||
|
||||
struct J3DTexCoord2Info;
|
||||
|
||||
@@ -22,26 +22,26 @@ struct J3DMaterialInitData_v21 {
|
||||
/* 0x005 */ u8 mZCompLocIdx;
|
||||
/* 0x006 */ u8 mZModeIdx;
|
||||
/* 0x007 */ u8 mDitherIdx;
|
||||
/* 0x008 */ u16 mMatColorIdx[2];
|
||||
/* 0x00C */ u16 mColorChanIdx[4];
|
||||
/* 0x014 */ u16 mTexCoordIdx[8];
|
||||
/* 0x008 */ BE(u16) mMatColorIdx[2];
|
||||
/* 0x00C */ BE(u16) mColorChanIdx[4];
|
||||
/* 0x014 */ BE(u16) mTexCoordIdx[8];
|
||||
/* 0x024 */ u8 field_0x038[0x10];
|
||||
/* 0x034 */ u16 mTexMtxIdx[8];
|
||||
/* 0x034 */ BE(u16) mTexMtxIdx[8];
|
||||
/* 0x044 */ u8 field_0x058[0x2c];
|
||||
/* 0x070 */ u16 mTexNoIdx[8];
|
||||
/* 0x080 */ u16 mTevKColorIdx[4];
|
||||
/* 0x070 */ BE(u16) mTexNoIdx[8];
|
||||
/* 0x080 */ BE(u16) mTevKColorIdx[4];
|
||||
/* 0x088 */ u8 mTevKColorSel[0x10];
|
||||
/* 0x098 */ u8 mTevKAlphaSel[0x10];
|
||||
/* 0x0A8 */ u16 mTevOrderIdx[0x10];
|
||||
/* 0x0C8 */ u16 mTevColorIdx[4];
|
||||
/* 0x0D0 */ u16 mTevStageIdx[0x10];
|
||||
/* 0x0F0 */ u16 mTevSwapModeIdx[0x10];
|
||||
/* 0x110 */ u16 mTevSwapModeTableIdx[4];
|
||||
/* 0x0A8 */ BE(u16) mTevOrderIdx[0x10];
|
||||
/* 0x0C8 */ BE(u16) mTevColorIdx[4];
|
||||
/* 0x0D0 */ BE(u16) mTevStageIdx[0x10];
|
||||
/* 0x0F0 */ BE(u16) mTevSwapModeIdx[0x10];
|
||||
/* 0x110 */ BE(u16) mTevSwapModeTableIdx[4];
|
||||
/* 0x118 */ u8 field_0x12c[0x18];
|
||||
/* 0x130 */ u16 mFogIdx;
|
||||
/* 0x132 */ u16 mAlphaCompIdx;
|
||||
/* 0x134 */ u16 mBlendIdx;
|
||||
/* 0x136 */ u16 mNBTScaleIdx;
|
||||
/* 0x130 */ BE(u16) mFogIdx;
|
||||
/* 0x132 */ BE(u16) mAlphaCompIdx;
|
||||
/* 0x134 */ BE(u16) mBlendIdx;
|
||||
/* 0x136 */ BE(u16) mNBTScaleIdx;
|
||||
}; // size 0x138
|
||||
|
||||
/**
|
||||
|
||||
@@ -309,6 +309,11 @@ public:
|
||||
/* 0x18 */ u8 field_0x18;
|
||||
/* 0x19 */ u8 field_0x19;
|
||||
/* 0x1A */ u16 mEnvelopeSize;
|
||||
|
||||
#if TARGET_PC
|
||||
private:
|
||||
static void readVertexData(const J3DVertexBlock& block, J3DVertexData& data);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef JAHPUBDEFINE_H
|
||||
#define JAHPUBDEFINE_H
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
template<class T>
|
||||
@@ -12,7 +13,7 @@ public:
|
||||
static T* newInstance() {
|
||||
JUT_ASSERT(82, sInstance==NULL);
|
||||
if (!sInstance) {
|
||||
sInstance = new T();
|
||||
sInstance = JKR_NEW T();
|
||||
}
|
||||
JUT_ASSERT(85, sInstance!=NULL);
|
||||
return sInstance;
|
||||
|
||||
@@ -209,12 +209,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
MemoryChunk* pMVar4 = field_0x18;
|
||||
field_0x18 = new (JASKernel::getSystemHeap(), 0) MemoryChunk(pMVar4);
|
||||
field_0x18 = JKR_NEW_ARGS (JASKernel::getSystemHeap(), 0) MemoryChunk(pMVar4);
|
||||
if (field_0x18 != NULL) {
|
||||
return true;
|
||||
}
|
||||
JUT_WARN(428, "%s", "Not enough JASSystemHeap");
|
||||
field_0x18 = new (JKRHeap::getSystemHeap(), 0) MemoryChunk(pMVar4);
|
||||
field_0x18 = JKR_NEW_ARGS (JKRHeap::getSystemHeap(), 0) MemoryChunk(pMVar4);
|
||||
if (field_0x18 != NULL) {
|
||||
return true;
|
||||
}
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
bool r26 = false;
|
||||
if (chunk != field_0x18 && chunk->isEmpty()) {
|
||||
MemoryChunk* nextChunk = chunk->getNextChunk();
|
||||
delete chunk;
|
||||
JKR_DELETE(chunk);
|
||||
prevChunk->setNextChunk(nextChunk);
|
||||
}
|
||||
return;
|
||||
@@ -283,6 +283,12 @@ namespace JASKernel {
|
||||
template <typename T>
|
||||
class JASPoolAllocObject {
|
||||
public:
|
||||
#if TARGET_PC
|
||||
static void* operator new(size_t n, JKRHeapToken) {
|
||||
return operator new(n);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void* operator new(size_t n) {
|
||||
#if PLATFORM_GCN
|
||||
JASMemPool<T>& memPool_ = getMemPool_();
|
||||
@@ -292,6 +298,13 @@ public:
|
||||
static void* operator new(size_t n, void* ptr) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void operator delete(void* ptr, size_t n, JKRHeapToken) {
|
||||
operator delete(ptr, n);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void operator delete(void* ptr, size_t n) {
|
||||
#if PLATFORM_GCN
|
||||
JASMemPool<T>& memPool_ = getMemPool_();
|
||||
@@ -362,6 +375,12 @@ public:
|
||||
template <typename T>
|
||||
class JASPoolAllocObject_MultiThreaded {
|
||||
public:
|
||||
#if TARGET_PC
|
||||
static void* operator new(size_t n, JKRHeapToken) {
|
||||
return operator new(n);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void* operator new(size_t n) {
|
||||
#if PLATFORM_GCN
|
||||
JASMemPool_MultiThreaded<T>& memPool_ = getMemPool();
|
||||
@@ -371,6 +390,13 @@ public:
|
||||
static void* operator new(size_t n, void* ptr) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void operator delete(void* ptr, size_t n, JKRHeapToken) {
|
||||
return operator delete(ptr, n);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void operator delete(void* ptr, size_t n) {
|
||||
#if PLATFORM_GCN
|
||||
JASMemPool_MultiThreaded<T>& memPool_ = getMemPool();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef POINTER_H
|
||||
#define POINTER_H
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
namespace JGadget {
|
||||
|
||||
template<class T>
|
||||
@@ -18,12 +20,12 @@ public:
|
||||
#ifdef __MWERKS__
|
||||
TPointer_delete(T* ptr) : TPointer(ptr) {}
|
||||
~TPointer_delete() {
|
||||
delete mPtr;
|
||||
JKR_DELETE(mPtr);
|
||||
}
|
||||
#else
|
||||
TPointer_delete(T* ptr) : TPointer<T>(ptr) {}
|
||||
~TPointer_delete() {
|
||||
delete this->mPtr;
|
||||
JKR_DELETE(this->mPtr);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define STD_MEMORY_H
|
||||
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
namespace JGadget {
|
||||
template <typename T>
|
||||
@@ -19,12 +20,12 @@ struct TAllocator {
|
||||
}
|
||||
|
||||
void DeallocateRaw(void* mem) {
|
||||
delete mem;
|
||||
JKR_DELETE(mem);
|
||||
}
|
||||
|
||||
void construct(T* p, const T& other) {
|
||||
JUT_ASSERT(67, p!=NULL);
|
||||
new(p) T(other);
|
||||
JKR_NEW_ARGS(p) T(other);
|
||||
}
|
||||
|
||||
void destroy(T* p) {
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include "JSystem/JHostIO/JHIComm.h"
|
||||
#include <os.h>
|
||||
|
||||
template<typename T, int I>
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
template <typename T, int I>
|
||||
class JHIpvector {
|
||||
public:
|
||||
JHIpvector() { m_size = 0; }
|
||||
@@ -89,7 +91,7 @@ public:
|
||||
|
||||
static JHIComPortManager<T>* create() {
|
||||
if (instance == NULL) {
|
||||
instance = new JHIComPortManager<T>();
|
||||
instance = JKR_NEW JHIComPortManager<T>();
|
||||
}
|
||||
|
||||
return instance;
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include <os.h>
|
||||
|
||||
#include "JKRHeap.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jkernel
|
||||
*
|
||||
*
|
||||
*/
|
||||
class JKRAramHeap : public JKRDisposer {
|
||||
public:
|
||||
@@ -30,7 +32,7 @@ public:
|
||||
u32 getUsedSize(u8);
|
||||
void dump();
|
||||
void free(JKRAramBlock *block) {
|
||||
delete block;
|
||||
JKR_DELETE(block);
|
||||
}
|
||||
|
||||
u8 getCurrentGroupID() const { return mGroupId; }
|
||||
|
||||
@@ -224,21 +224,63 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef TARGET_PC
|
||||
void* operator new(size_t size);
|
||||
#endif
|
||||
void* operator new(size_t size, int alignment);
|
||||
void* operator new(size_t size, JKRHeap* heap, int alignment);
|
||||
#if TARGET_PC
|
||||
enum class JKRHeapToken {
|
||||
Dummy
|
||||
};
|
||||
|
||||
#ifndef TARGET_PC
|
||||
void* operator new[](size_t size);
|
||||
#endif
|
||||
void* operator new[](size_t size, int alignment);
|
||||
void* operator new[](size_t size, JKRHeap* heap, int alignment);
|
||||
inline void* operator new(size_t, JKRHeapToken, void* where) {
|
||||
return where;
|
||||
}
|
||||
|
||||
#ifndef TARGET_PC
|
||||
void operator delete(void* ptr);
|
||||
inline void* operator new[](size_t, JKRHeapToken, void* where) {
|
||||
return where;
|
||||
}
|
||||
|
||||
#define JKR_NEW new (JKRHeapToken::Dummy)
|
||||
#define JKR_NEW_ARGS(...) new (JKRHeapToken::Dummy, __VA_ARGS__ )
|
||||
#define JKR_DELETE(expr) jkrDelete(expr)
|
||||
#define JKR_DELETE_ARRAY(expr) delete[] (expr)
|
||||
#define JKR_HEAP_TOKEN , JKRHeapToken::Dummy
|
||||
#define JKR_HEAP_TOKEN_PARAM , JKRHeapToken
|
||||
#else
|
||||
#define JKR_NEW new
|
||||
#define JKR_NEW_ARGS(...) new (__VA_ARGS__ )
|
||||
#define JKR_DELETE(expr) delete (expr)
|
||||
#define JKR_DELETE_ARRAY(expr) delete[] (expr)
|
||||
#define JKR_HEAP_TOKEN
|
||||
#define JKR_HEAP_TOKEN_PARAM
|
||||
#endif
|
||||
|
||||
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM);
|
||||
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment);
|
||||
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment);
|
||||
|
||||
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM);
|
||||
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, int alignment);
|
||||
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment);
|
||||
|
||||
void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM);
|
||||
void operator delete[](void* ptr);
|
||||
|
||||
#if TARGET_PC
|
||||
template<typename T>
|
||||
void jkrDelete(T* ptr) {
|
||||
if (ptr == nullptr) {
|
||||
return;
|
||||
}
|
||||
ptr->~T();
|
||||
operator delete(ptr, JKRHeapToken::Dummy);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void jkrDelete(void* ptr) {
|
||||
if (ptr == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
operator delete(ptr, JKRHeapToken::Dummy);
|
||||
}
|
||||
#endif
|
||||
|
||||
void JKRDefaultMemoryErrorRoutine(void* heap, u32 size, int alignment);
|
||||
|
||||
@@ -105,14 +105,15 @@ inline f32 JMAHermiteInterpolation(__REGISTER f32 p1, __REGISTER f32 p2, __REGIS
|
||||
// clang-format on
|
||||
return ff25;
|
||||
#else
|
||||
f32 t = (p1 - p2) / (p5 - p2);
|
||||
f32 t2 = t * t;
|
||||
f32 t3 = t2 * t;
|
||||
f32 h1 = 2.0f * t3 - 3.0f * t2 + 1.0f;
|
||||
f32 h2 = -2.0f * t3 + 3.0f * t2;
|
||||
f32 h3 = t3 - 2.0f * t2 + t;
|
||||
f32 h4 = t3 - t2;
|
||||
return h1 * p4 + h2 * p7 + h3 * (p3 - p4) + h4 * (p6 - p3);
|
||||
f32 a = p1 - p2;
|
||||
f32 b = a * (1.0 / (p5 - p2));
|
||||
f32 c = b - 1.0;
|
||||
f32 d = (3.0 + -2.0 * b) * (b * b);
|
||||
f32 cab = (c * a * b);
|
||||
f32 coeffx3 = cab * p7;
|
||||
f32 cca = (c * c * a);
|
||||
f32 coeffc2 = cca * p4;
|
||||
return ((1.0 - d) * p3 + (d * p6)) + coeffc2 + coeffx3;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ struct data {
|
||||
char* get() const { return (char*)getRaw(); }
|
||||
|
||||
u32* get_signature() const { return (u32*)(get() + 0x0); }
|
||||
u32 get_type() const { return *(u32*)(get() + 0x4); }
|
||||
u32 get_blockNumber() const { return *(u32*)(get() + 0xC); }
|
||||
u32 get_type() const { return *(BE(u32)*)(get() + 0x4); }
|
||||
u32 get_blockNumber() const { return *(BE(u32)*)(get() + 0xC); }
|
||||
u32 get_encoding() const { return *(u8*)(get() + 0x10); }
|
||||
};
|
||||
|
||||
@@ -28,9 +28,9 @@ struct data {
|
||||
TParse_TBlock(const void* pData) : TParseData_aligned(pData) {}
|
||||
|
||||
const char* get() const { return (char*)getRaw(); }
|
||||
u32 get_size() const { return *(u32*)(get() + 0x4); }
|
||||
u32 get_size() const { return *(BE(u32)*)(get() + 0x4); }
|
||||
const void* getNext() const { return (char*)getRaw() + get_size(); }
|
||||
u32 get_type() const { return *(u32*)(get() + 0x0); }
|
||||
u32 get_type() const { return *(BE(u32)*)(get() + 0x0); }
|
||||
};
|
||||
|
||||
// TParse_TBlock_info handles parsing INF1 section data
|
||||
@@ -41,11 +41,11 @@ struct data {
|
||||
|
||||
char* getContent() const { return (char*)getRaw() + 0x10; }
|
||||
|
||||
u32 get_messageEntrySize() const { return *(u16*)(get() + 0xA); }
|
||||
u32 get_messageEntrySize() const { return *(BE(u16)*)(get() + 0xA); }
|
||||
|
||||
u32 get_messageEntryNumber() const { return *(u16*)(get() + 0x8); }
|
||||
u32 get_messageEntryNumber() const { return *(BE(u16)*)(get() + 0x8); }
|
||||
|
||||
u16 get_groupID() const { return *(u16*)(get() + 0xC); }
|
||||
u16 get_groupID() const { return *(BE(u16)*)(get() + 0xC); }
|
||||
};
|
||||
|
||||
// TParse_TBlock_messageID handles parsing MID1 section data
|
||||
@@ -54,7 +54,7 @@ struct data {
|
||||
|
||||
char* get() const { return (char*)getRaw(); }
|
||||
u8 get_formSupplement() const { return *(u8*)(get() + 0xB); }
|
||||
int get_number() const { return *(u16*)(get() + 0x8); }
|
||||
int get_number() const { return *(BE(u16)*)(get() + 0x8); }
|
||||
u32* getContent() const { return (u32*)((uintptr_t)getRaw() + 0x10); }
|
||||
u32 get_form() const { return *(u8*)(get() + 0xA) & 0xF; }
|
||||
bool get_isOrdered() const { return *(u8*)(get() + 0xA) & 0xF0; }
|
||||
@@ -81,8 +81,8 @@ struct data {
|
||||
static unsigned int getTagCode(u32 tag) { return tag & 0xFFFF; }
|
||||
static u8 getTagGroup(u32 tag) { return tag >> 0x10; }
|
||||
|
||||
static const u32 ga4cSignature;
|
||||
static const u32 ga4cSignature_color;
|
||||
static const BE(u32) ga4cSignature;
|
||||
static const BE(u32) ga4cSignature_color;
|
||||
|
||||
static const int gcTagBegin = '\x1A'; // All text Control Tags will begin with this character
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ inline const int TObject::NodeOffset = -(int)offsetof(TObject, ocObject_);
|
||||
|
||||
struct data {
|
||||
struct THeaderData {
|
||||
u32 signature;
|
||||
u16 byteOrder;
|
||||
u16 version;
|
||||
BE(u32) signature;
|
||||
BE(u16) byteOrder;
|
||||
BE(u16) version;
|
||||
u8 field_0x0[4];
|
||||
u32 blockNumber;
|
||||
BE(u32) blockNumber;
|
||||
u8 content[0];
|
||||
};
|
||||
|
||||
|
||||
@@ -34,18 +34,18 @@ struct CompositeOperation {
|
||||
};
|
||||
|
||||
struct TBlock {
|
||||
/* 0x0 */ u32 size;
|
||||
/* 0x4 */ u16 type;
|
||||
/* 0x6 */ u16 id_size;
|
||||
/* 0x0 */ BE(u32) size;
|
||||
/* 0x4 */ BE(u16) type;
|
||||
/* 0x6 */ BE(u16) id_size;
|
||||
/* 0x8 */ u8 id[0];
|
||||
};
|
||||
|
||||
struct THeader {
|
||||
/* 0x00 */ char signature[4];
|
||||
/* 0x04 */ u16 byte_order; // must be 0xFEFF
|
||||
/* 0x06 */ u16 version; // 0-1 = obselete, 2-7 = OK
|
||||
/* 0x08 */ u32 _8;
|
||||
/* 0x0C */ u32 block_number;
|
||||
/* 0x04 */ BE(u16) byte_order; // must be 0xFEFF
|
||||
/* 0x06 */ BE(u16) version; // 0-1 = obselete, 2-7 = OK
|
||||
/* 0x08 */ BE(u32) _8;
|
||||
/* 0x0C */ BE(u32) block_number;
|
||||
/* 0x10 */ u8 content[0];
|
||||
};
|
||||
// Parses a THeader
|
||||
|
||||
@@ -115,8 +115,8 @@ private:
|
||||
class TObject_list : public TObject {
|
||||
public:
|
||||
struct ListData {
|
||||
/* 0x0 */ f32 _0;
|
||||
/* 0x4 */ u32 _4;
|
||||
/* 0x0 */ BE(f32) _0;
|
||||
/* 0x4 */ BE(u32) _4;
|
||||
/* 0x8 */ f32 _8[0];
|
||||
};
|
||||
TObject_list(data::TParse_TBlock const&);
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
class TObject_list_parameter : public TObject {
|
||||
public:
|
||||
struct ListData {
|
||||
u32 _0;
|
||||
BE(u32) _0;
|
||||
f32 _4[0];
|
||||
};
|
||||
TObject_list_parameter(data::TParse_TBlock const&);
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
struct TObject_hermite : public TObject {
|
||||
public:
|
||||
struct ListData {
|
||||
u32 _0; // u : 28, uSize : 4
|
||||
BE(u32) _0; // u : 28, uSize : 4
|
||||
f32 _4[0];
|
||||
};
|
||||
TObject_hermite(data::TParse_TBlock const&);
|
||||
|
||||
@@ -16,7 +16,7 @@ struct TCreateObject {
|
||||
|
||||
template<class AdaptorT>
|
||||
static typename AdaptorT::ObjectType* createFromAdaptor(JStudio::stb::data::TParse_TBlock_object const& param_1, AdaptorT* param_2) {
|
||||
typename AdaptorT::ObjectType* rv = new typename AdaptorT::ObjectType(param_1, param_2);
|
||||
typename AdaptorT::ObjectType* rv = JKR_NEW typename AdaptorT::ObjectType(param_1, param_2);
|
||||
if (rv == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
|
||||
template<class T>
|
||||
T* createFromAdaptor(const stb::data::TParse_TBlock_object& param_0, T* param_1) {
|
||||
T* n = new T(param_0, param_1);
|
||||
T* n = JKR_NEW T(param_0, param_1);
|
||||
|
||||
if (n == NULL) {
|
||||
return NULL;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
void getData(TData*) const;
|
||||
|
||||
const void* get() const { return getRaw(); }
|
||||
u32 get_head() const { return *(u32*)get(); }
|
||||
u32 get_head() const { return BSWAP32(*(u32*)get()); }
|
||||
};
|
||||
|
||||
class TParse_TParagraph : public TParseData_aligned<4> {
|
||||
|
||||
@@ -21,7 +21,7 @@ const int BLOCK_NONE = -1;
|
||||
|
||||
// Used to expand a signed 24 int to a signed 32 int
|
||||
const u32 gu32Mask_TSequence_value_signExpansion = 0xFF000000;
|
||||
extern const u32 ga4cSignature; // 'STB/0'
|
||||
extern const BE(u32) ga4cSignature; // 'STB/0'
|
||||
extern const s32 gauDataSize_TEParagraph_data[8];
|
||||
|
||||
inline void toString_block(char* a5c, u32 arg1) {
|
||||
@@ -31,34 +31,34 @@ inline void toString_block(char* a5c, u32 arg1) {
|
||||
struct THeader {
|
||||
struct Target {
|
||||
/* 0x00 */ char name[8]; // "jstudio"
|
||||
/* 0x08 */ u16 _8[3];
|
||||
/* 0x0E */ u16 target_version;
|
||||
/* 0x08 */ BE(u16) _8[3];
|
||||
/* 0x0E */ BE(u16) target_version;
|
||||
};
|
||||
|
||||
/* 0x00 */ char signature[4];
|
||||
/* 0x04 */ u16 byte_order; // must be 0xFEFF
|
||||
/* 0x06 */ u16 version; // 0-1 = obselete, 2-7 = OK
|
||||
/* 0x08 */ u32 _8;
|
||||
/* 0x0C */ u32 block_number;
|
||||
/* 0x04 */ BE(u16) byte_order; // must be 0xFEFF
|
||||
/* 0x06 */ BE(u16) version; // 0-1 = obselete, 2-7 = OK
|
||||
/* 0x08 */ BE(u32) _8;
|
||||
/* 0x0C */ BE(u32) block_number;
|
||||
/* 0x10 */ Target target;
|
||||
/* 0x20 */ u8 content[0];
|
||||
};
|
||||
|
||||
struct TBlock {
|
||||
/* 0x0 */ u32 size;
|
||||
/* 0x4 */ u32 type; // char[4] JMSG, JSND, JACT, ...
|
||||
/* 0x0 */ BE(u32) size;
|
||||
/* 0x4 */ BE(u32) type; // char[4] JMSG, JSND, JACT, ...
|
||||
};
|
||||
|
||||
struct TBlock_object : TBlock {
|
||||
/* 0x8 */ u16 flag;
|
||||
/* 0xA */ u16 id_size;
|
||||
/* 0x8 */ BE(u16) flag;
|
||||
/* 0xA */ BE(u16) id_size;
|
||||
/* 0xC */ u8 id[0]; // unique identifier
|
||||
///* ??? */ u8 content[0];
|
||||
};
|
||||
|
||||
struct TParagraph {
|
||||
/* 0x0 */ u16 _0;
|
||||
/* 0x2 */ u16 id_size;
|
||||
/* 0x0 */ BE(u16) _0;
|
||||
/* 0x2 */ BE(u16) id_size;
|
||||
/* 0x4 */ u8 id[0]; // unique identifier
|
||||
};
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ template <class AdaptorT, class ObjectT>
|
||||
JStudio::TObject* createObject_JSG_(const JStudio::stb::data::TParse_TBlock_object& param_1,
|
||||
JStage::TObject* param_2, const JStage::TSystem* param_3) {
|
||||
ObjectT* objt = (ObjectT*)param_2;
|
||||
AdaptorT* pAdaptor = new AdaptorT(param_3, objt);
|
||||
AdaptorT* pAdaptor = JKR_NEW AdaptorT(param_3, objt);
|
||||
if (pAdaptor == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
|
||||
#include <gx.h>
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
*
|
||||
*/
|
||||
* @ingroup jsystem-jutility
|
||||
*
|
||||
*/
|
||||
class JUTGraphFifo {
|
||||
public:
|
||||
JUTGraphFifo(u32);
|
||||
@@ -40,6 +42,6 @@ private:
|
||||
/* 0x10 */ u8 field_0x10[0xC];
|
||||
};
|
||||
|
||||
inline JUTGraphFifo* JUTCreateFifo(u32 bufSize) { return new JUTGraphFifo(bufSize); }
|
||||
inline JUTGraphFifo* JUTCreateFifo(u32 bufSize) { return JKR_NEW JUTGraphFifo(bufSize); }
|
||||
|
||||
#endif /* JUTGRAPHFIFO_H */
|
||||
|
||||
@@ -26,7 +26,7 @@ struct ResTIMG {
|
||||
/* 0x08 */ u8 indexTexture;
|
||||
/* 0x09 */ u8 colorFormat;
|
||||
/* 0x0A */ BE(u16) numColors;
|
||||
/* 0x0C */ BE(u32) paletteOffset;
|
||||
/* 0x0C */ BE(s32) paletteOffset;
|
||||
/* 0x10 */ u8 mipmapEnabled;
|
||||
/* 0x11 */ u8 doEdgeLOD;
|
||||
/* 0x12 */ u8 biasClamp;
|
||||
@@ -38,7 +38,7 @@ struct ResTIMG {
|
||||
/* 0x18 */ u8 mipmapCount;
|
||||
/* 0x19 */ u8 unknown;
|
||||
/* 0x1A */ BE(s16) LODBias;
|
||||
/* 0x1C */ BE(u32) imageOffset;
|
||||
/* 0x1C */ BE(s32) imageOffset;
|
||||
}; // Size: 0x20
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <gx.h>
|
||||
#include <os.h>
|
||||
#include <vi.h>
|
||||
#if TARGET_PC
|
||||
#include <aurora/aurora.h>
|
||||
#endif
|
||||
|
||||
typedef u8 (*Pattern)[2];
|
||||
|
||||
@@ -30,8 +33,20 @@ public:
|
||||
static void postRetraceProc(u32);
|
||||
static void drawDoneCallback();
|
||||
|
||||
u16 getFbWidth() const { return mRenderObj->fbWidth; }
|
||||
u16 getEfbHeight() const { return mRenderObj->efbHeight; }
|
||||
u16 getFbWidth() const {
|
||||
#if TARGET_PC
|
||||
return m_WindowSize.fb_width;
|
||||
#else
|
||||
return mRenderObj->fbWidth;
|
||||
#endif
|
||||
}
|
||||
u16 getEfbHeight() const {
|
||||
#if TARGET_PC
|
||||
return m_WindowSize.fb_height;
|
||||
#else
|
||||
return mRenderObj->efbHeight;
|
||||
#endif
|
||||
}
|
||||
void getBounds(u16& width, u16& height) const {
|
||||
width = (u16)getFbWidth();
|
||||
height = (u16)getEfbHeight();
|
||||
@@ -47,6 +62,9 @@ public:
|
||||
static OSTick getVideoLastTick() { return sVideoLastTick; }
|
||||
|
||||
GXRenderModeObj* getRenderMode() const { return mRenderObj; }
|
||||
#if TARGET_PC
|
||||
void setWindowSize(AuroraWindowSize const& size);
|
||||
#endif
|
||||
|
||||
private:
|
||||
static JUTVideo* sManager;
|
||||
@@ -68,6 +86,11 @@ private:
|
||||
/* 0x30 */ s32 mSetBlackFrameCount;
|
||||
/* 0x34 */ OSMessage mMessage;
|
||||
/* 0x38 */ OSMessageQueue mMessageQueue;
|
||||
|
||||
#if TARGET_PC
|
||||
public:
|
||||
AuroraWindowSize m_WindowSize;
|
||||
#endif
|
||||
};
|
||||
|
||||
inline JUTVideo* JUTGetVideoManager() {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define TCOLOR_H
|
||||
|
||||
#include <gx.h>
|
||||
#include "dusk/endian.h"
|
||||
|
||||
namespace JUtility {
|
||||
|
||||
@@ -14,11 +15,15 @@ struct TColor : public GXColor {
|
||||
TColor() { set(0xffffffff); }
|
||||
TColor(u32 u32Color) { set(u32Color); }
|
||||
TColor(GXColor color) { set(color); }
|
||||
#if TARGET_PC
|
||||
TColor(BE(u32) u32Color) { set(u32Color); }
|
||||
#endif
|
||||
|
||||
|
||||
// TColor(const TColor& other) { set(other.toUInt32()); }
|
||||
|
||||
operator u32() const { return toUInt32(); }
|
||||
u32 toUInt32() const { return *(u32*)&r; }
|
||||
u32 toUInt32() const { return *(BE(u32)*)&r; }
|
||||
|
||||
void set(u8 cR, u8 cG, u8 cB, u8 cA) {
|
||||
r = cR;
|
||||
@@ -27,7 +32,7 @@ struct TColor : public GXColor {
|
||||
a = cA;
|
||||
}
|
||||
|
||||
void set(u32 u32Color) { *(u32*)&r = u32Color; }
|
||||
void set(u32 u32Color) { *(BE(u32)*)&r = u32Color; }
|
||||
void set(GXColor gxColor) {
|
||||
GXColor* temp = this;
|
||||
*temp = gxColor;
|
||||
|
||||
Reference in New Issue
Block a user