This commit is contained in:
TakaRikka
2026-01-05 13:46:27 -08:00
4117 changed files with 39584 additions and 27156 deletions
+31
View File
@@ -3,6 +3,37 @@
#include "JSystem/JFramework/JFWDisplay.h"
class CProjectionDivider {
public:
/* 0x00 */ f32 field_0x0;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ f32 field_0x8;
/* 0x0C */ f32 field_0xc;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14;
/* 0x18 */ s32 field_0x18;
/* 0x1C */ s32 field_0x1c;
CProjectionDivider(s32, s32);
virtual ~CProjectionDivider() {}
f32 calcDivRatioH(s32) const;
f32 calcDivRatioV(s32) const;
};
class CPerspDivider : public CProjectionDivider {
public:
CPerspDivider(const Mtx44&, s32, s32);
virtual ~CPerspDivider() {}
void divide(Mtx44&, s32, s32) const;
};
class COrthoDivider : public CProjectionDivider {
public:
COrthoDivider(const Mtx44&, s32, s32);
virtual ~COrthoDivider() {}
void divide(Mtx44&, s32, s32) const;
};
class CaptureScreen {
public:
CaptureScreen(const JFWDisplay*);
+2 -2
View File
@@ -19,8 +19,8 @@ public:
virtual s32 getGrafType() const { return 1; }
virtual void setLookat();
f32 getWidthPower() const { return mBounds.getWidth() / mOrtho.getWidth(); }
f32 getHeightPower() const { return mBounds.getHeight() / mOrtho.getHeight(); }
f32 getWidthPower() { return mBounds.getWidth() / mOrtho.getWidth(); }
f32 getHeightPower() { return mBounds.getHeight() / mOrtho.getHeight(); }
void setOrtho(f32 x, f32 y, f32 width, f32 height, f32 far, f32 near) {
JGeometry::TBox2<f32> ortho(x, y, x + width, y + height);
+3 -1
View File
@@ -86,7 +86,9 @@ public:
/* vt 0x18 */ virtual void resize(f32 x, f32 y);
/* vt 0x1C */ virtual void setCullBack(bool cull);
/* vt 0x20 */ virtual void setCullBack(_GXCullMode cmode);
/* vt 0x24 */ virtual void setAlpha(u8);
/* vt 0x24 */ virtual void setAlpha(u8 alpha) {
mAlpha = alpha;
};
/* vt 0x28 */ virtual bool setConnectParent(bool connected);
/* vt 0x2C */ virtual void calcMtx() {
if (mPaneTree.getParent() != NULL) {
+6 -1
View File
@@ -2,7 +2,7 @@
#define J2DPRINT_H
#include "JSystem/J2DGraph/J2DTextBox.h"
#include <cstdarg>
#include <stdarg>
class JUTFont;
class J2DPrint;
@@ -40,6 +40,11 @@ public:
virtual ~J2DPrint();
JUTFont* getFont() const { return mFont; }
f32 getCursorV() const { return mCursorV; }
void setCharColor(JUtility::TColor color) { mCharColor = color; }
void setGradColor(JUtility::TColor color) { mGradColor = color; }
f32 print_va(u8 alpha, const char* fmt, va_list args) {
return J2DPrint_print_alpha_va(this, alpha, fmt, args);
}
+9 -9
View File
@@ -256,15 +256,15 @@ public:
private:
/* 0x0 */ u32 mFlags;
GXIndTexStageID getIndStage() const { return (GXIndTexStageID)(mFlags & 0x03); }
GXIndTexFormat getIndFormat() const { return (GXIndTexFormat)((mFlags >> 2) & 0x03); }
GXIndTexBiasSel getBiasSel() const { return (GXIndTexBiasSel)((mFlags >> 4) & 0x07); }
GXIndTexWrap getWrapS() const { return (GXIndTexWrap)((mFlags >> 8) & 0x07); }
GXIndTexWrap getWrapT() const { return (GXIndTexWrap)((mFlags >> 11) & 0x07); }
GXIndTexMtxID getMtxSel() const { return (GXIndTexMtxID)((mFlags >> 16) & 0x0F); }
GXBool getPrev() const { return (GXBool)((mFlags >> 20) & 0x01); }
GXBool getLod() const { return (GXBool)((mFlags >> 21) & 0x01); }
GXIndTexAlphaSel getAlphaSel() const { return (GXIndTexAlphaSel)((mFlags >> 22) & 0x03); }
u8 getIndStage() const { return (mFlags & 0x03); }
u8 getIndFormat() const { return (mFlags >> 2) & 0x03; }
u8 getBiasSel() const { return (mFlags >> 4) & 0x07; }
u8 getWrapS() const { return (mFlags >> 8) & 0x07; }
u8 getWrapT() const { return (mFlags >> 11) & 0x07; }
u8 getMtxSel() const { return (mFlags >> 16) & 0x0F; }
u8 getPrev() const { return (mFlags >> 20) & 0x01; }
u8 getLod() const { return (mFlags >> 21) & 0x01; }
u8 getAlphaSel() const { return (mFlags >> 22) & 0x03; }
};
/**
+2
View File
@@ -171,7 +171,9 @@ public:
/* 0x0130 */ u8 mFlags;
/* 0x0131 */ bool mTextFontOwned;
/* 0x0132 */ u16 mStringLength;
#if PLATFORM_GCN
/* 0x0134 */ u8 field_0x134[4];
#endif
}; // Size: 0x138
#endif /* J2DTEXTBOX_H */
+18
View File
@@ -7,6 +7,20 @@
class JSURandomInputStream;
class JUTTexture;
enum J2DTextureBase {
TEXTUREBASE_0 = 0,
TEXTUREBASE_1 = 1,
TEXTUREBASE_2 = 2,
TEXTUREBASE_3 = 3,
};
enum J2DWindowMirror {
WINDOWMIRROR_39 = 39,
WINDOWMIRROR_114 = 114,
WINDOWMIRROR_141 = 141,
WINDOWMIRROR_216 = 216,
};
/**
* @ingroup jsystem-j2d
*
@@ -32,8 +46,12 @@ public:
J2DWindow(J2DPane*, JSURandomInputStream*, J2DMaterial*);
J2DWindow(J2DPane*, JSURandomInputStream*, JKRArchive*);
J2DWindow();
J2DWindow(u64, const JGeometry::TBox2<f32>&, const char*, J2DTextureBase, const ResTLUT*);
void initiate(const ResTIMG*, const ResTIMG*, const ResTIMG*, const ResTIMG*, const ResTLUT*, J2DWindowMirror, const JGeometry::TBox2<f32>&);
void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
void initinfo();
void initinfo2();
static J2DWindowMirror convertMirror(J2DTextureBase);
void draw_private(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
void setContentsColor(JUtility::TColor, JUtility::TColor, JUtility::TColor,
JUtility::TColor);
+72 -72
View File
@@ -214,7 +214,7 @@ public:
virtual u32 getType() { return 'CLOF'; }
virtual void setMatColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x121, idx >= 0 && idx < ARRAY_SIZEU(mMatColor));
J3D_ASSERT_NULLPTR(0x122, color != 0);
J3D_ASSERT_NULLPTR(0x122, color != NULL);
mMatColor[idx] = *color;
}
virtual void setMatColor(u32 idx, J3DGXColor color) {
@@ -227,7 +227,7 @@ public:
}
virtual void setColorChanNum(u8 num) { mColorChanNum = num; }
virtual void setColorChanNum(u8 const* num) {
J3D_ASSERT_NULLPTR(0x137, num != 0);
J3D_ASSERT_NULLPTR(0x137, num != NULL);
mColorChanNum = *num;
}
virtual u8 getColorChanNum() const { return mColorChanNum; }
@@ -237,7 +237,7 @@ public:
}
virtual void setColorChan(u32 idx, J3DColorChan const* chan) {
J3D_ASSERT_RANGE(0x148, idx >= 0 && idx < ARRAY_SIZEU(mColorChan));
J3D_ASSERT_NULLPTR(0x149, chan != 0);
J3D_ASSERT_NULLPTR(0x149, chan != NULL);
mColorChan[idx] = *chan;
}
virtual J3DColorChan* getColorChan(u32 idx) {
@@ -245,7 +245,7 @@ public:
return &mColorChan[idx];
}
virtual void setCullMode(u8 const* mode) {
J3D_ASSERT_NULLPTR(0x154, mode != 0);
J3D_ASSERT_NULLPTR(0x154, mode != NULL);
mCullMode = *mode;
}
virtual void setCullMode(u8 mode) { mCullMode = mode; }
@@ -281,7 +281,7 @@ public:
virtual u32 getType() { return 'CLAB'; }
virtual void setAmbColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x1a3, idx >= 0 && idx < ARRAY_SIZEU(mAmbColor));
J3D_ASSERT_NULLPTR(0x1a4, color != 0);
J3D_ASSERT_NULLPTR(0x1a4, color != NULL);
mAmbColor[idx] = *color;
}
virtual void setAmbColor(u32 idx, J3DGXColor color) {
@@ -322,7 +322,7 @@ public:
virtual u32 getType() { return 'CLON'; }
virtual void setMatColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x1e9, idx >= 0 && idx < ARRAY_SIZEU(mMatColor));
J3D_ASSERT_NULLPTR(0x1ea, color != 0);
J3D_ASSERT_NULLPTR(0x1ea, color != NULL);
mMatColor[idx] = *color;
}
virtual void setMatColor(u32 idx, J3DGXColor color) {
@@ -335,7 +335,7 @@ public:
}
virtual void setAmbColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x1fc, idx >= 0 && idx < ARRAY_SIZEU(mAmbColor));
J3D_ASSERT_NULLPTR(0x1fd, color != 0);
J3D_ASSERT_NULLPTR(0x1fd, color != NULL);
mAmbColor[idx] = *color;
}
virtual void setAmbColor(u32 idx, J3DGXColor color) {
@@ -348,7 +348,7 @@ public:
}
virtual void setColorChanNum(u8 num) { mColorChanNum = num; }
virtual void setColorChanNum(u8 const* num) {
J3D_ASSERT_NULLPTR(0x212, num != 0);
J3D_ASSERT_NULLPTR(0x212, num != NULL);
mColorChanNum = *num;
}
virtual u8 getColorChanNum() const { return mColorChanNum; }
@@ -358,7 +358,7 @@ public:
}
virtual void setColorChan(u32 idx, J3DColorChan const* chan) {
J3D_ASSERT_RANGE(0x223, idx >= 0 && idx < ARRAY_SIZEU(mColorChan));
J3D_ASSERT_NULLPTR(0x224, chan != 0);
J3D_ASSERT_NULLPTR(0x224, chan != NULL);
mColorChan[idx] = *chan;
}
virtual J3DColorChan* getColorChan(u32 idx) {
@@ -374,7 +374,7 @@ public:
return mLight[idx];
}
virtual void setCullMode(u8 const* mode) {
J3D_ASSERT_NULLPTR(0x23b, mode != 0);
J3D_ASSERT_NULLPTR(0x23b, mode != NULL);
mCullMode = *mode;
}
virtual void setCullMode(u8 mode) {
@@ -466,14 +466,14 @@ public:
virtual s32 countDLSize();
virtual u32 getType() { return 'TGPT'; }
virtual void setTexGenNum(u32 const* num) {
J3D_ASSERT_NULLPTR(0x335, num != 0);
J3D_ASSERT_NULLPTR(0x335, num != NULL);
mTexGenNum = *num;
}
virtual void setTexGenNum(u32 num) { mTexGenNum = num; }
virtual u32 getTexGenNum() const { return mTexGenNum; }
virtual void setTexCoord(u32 idx, J3DTexCoord const* coord) {
J3D_ASSERT_RANGE(0x344, idx >= 0 && idx < ARRAY_SIZEU(mTexCoord));
J3D_ASSERT_NULLPTR(0x345, coord != 0);
J3D_ASSERT_NULLPTR(0x345, coord != NULL);
mTexCoord[idx] = *coord;
}
virtual J3DTexCoord* getTexCoord(u32 idx) {
@@ -515,7 +515,7 @@ public:
virtual s32 countDLSize();
virtual u32 getType() { return 'TGB4'; }
virtual void setNBTScale(J3DNBTScale const* scale) {
J3D_ASSERT_NULLPTR(0x393, scale != 0);
J3D_ASSERT_NULLPTR(0x393, scale != NULL);
mNBTScale = *scale;
}
virtual void setNBTScale(J3DNBTScale scale) { mNBTScale = scale; }
@@ -542,7 +542,7 @@ public:
virtual s32 countDLSize();
virtual u32 getType() { return 'TGBC'; }
virtual void setNBTScale(J3DNBTScale const* scale) {
J3D_ASSERT_NULLPTR(0x3ca, scale != 0);
J3D_ASSERT_NULLPTR(0x3ca, scale != NULL);
mNBTScale = *scale;
}
virtual void setNBTScale(J3DNBTScale scale) { mNBTScale = scale; }
@@ -674,7 +674,7 @@ public:
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
virtual u32 getType() { return 'TVPT'; }
virtual void setTevStageNum(u8 const* num) {
J3D_ASSERT_NULLPTR(0x52c, num != 0);
J3D_ASSERT_NULLPTR(0x52c, num != NULL);
mTevStageNum = *num;
}
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
@@ -682,7 +682,7 @@ public:
virtual s32 countDLSize();
virtual void setTexNo(u32 idx, u16 const* texNo) {
J3D_ASSERT_RANGE(0x53b, idx >= 0 && idx < ARRAY_SIZEU(mTexNo));
J3D_ASSERT_NULLPTR(0x53c, texNo != 0);
J3D_ASSERT_NULLPTR(0x53c, texNo != NULL);
mTexNo[idx] = *texNo;
}
virtual void setTexNo(u32 idx, u16 texNo) {
@@ -695,7 +695,7 @@ public:
}
virtual void setTevOrder(u32 idx, J3DTevOrder const* order) {
J3D_ASSERT_RANGE(0x550, idx >= 0 && idx < ARRAY_SIZEU(mTevOrder));
J3D_ASSERT_NULLPTR(0x551, order != 0);
J3D_ASSERT_NULLPTR(0x551, order != NULL);
mTevOrder[idx] = *order;
}
virtual void setTevOrder(u32 idx, J3DTevOrder order) {
@@ -708,7 +708,7 @@ public:
}
virtual void setTevStage(u32 idx, J3DTevStage const* stage) {
J3D_ASSERT_RANGE(0x563, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x564, stage != 0);
J3D_ASSERT_NULLPTR(0x564, stage != NULL);
mTevStage[idx] = *stage;
}
virtual void setTevStage(u32 idx, J3DTevStage stage) {
@@ -721,7 +721,7 @@ public:
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage const* stage) {
J3D_ASSERT_RANGE(0x576, idx >= 0 && idx < ARRAY_SIZEU(mIndTevStage));
J3D_ASSERT_NULLPTR(0x577, stage != 0);
J3D_ASSERT_NULLPTR(0x577, stage != NULL);
mIndTevStage[idx] = *stage;
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage stage) {
@@ -734,7 +734,7 @@ public:
}
virtual void setTevColor(u32 idx, J3DGXColorS10 const* color) {
J3D_ASSERT_RANGE(0x589, idx >= 0 && idx < ARRAY_SIZEU(mTevColor));
J3D_ASSERT_NULLPTR(0x58a, color != 0);
J3D_ASSERT_NULLPTR(0x58a, color != NULL);
mTevColor[idx] = *color;
}
virtual void setTevColor(u32 idx, J3DGXColorS10 color) {
@@ -747,7 +747,7 @@ public:
}
virtual void setTevKColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x59c, idx >= 0 && idx < ARRAY_SIZEU(mTevKColor));
J3D_ASSERT_NULLPTR(0x59d, color != 0);
J3D_ASSERT_NULLPTR(0x59d, color != NULL);
mTevKColor[idx] = *color;
}
virtual void setTevKColor(u32 idx, J3DGXColor color) {
@@ -760,7 +760,7 @@ public:
}
virtual void setTevKColorSel(u32 idx, u8 const* sel) {
J3D_ASSERT_RANGE(0x5af, idx >= 0 && idx < ARRAY_SIZEU(mTevKColorSel));
J3D_ASSERT_NULLPTR(0x5b0, sel != 0);
J3D_ASSERT_NULLPTR(0x5b0, sel != NULL);
mTevKColorSel[idx] = *sel;
}
virtual void setTevKColorSel(u32 idx, u8 sel) {
@@ -818,7 +818,7 @@ public:
virtual s32 countDLSize();
virtual void setTexNo(u32 idx, u16 const* no) {
J3D_ASSERT_RANGE(0x618, idx >= 0 && idx < ARRAY_SIZEU(mTexNo));
J3D_ASSERT_NULLPTR(0x619, no != 0);
J3D_ASSERT_NULLPTR(0x619, no != NULL);
mTexNo[idx] = *no;
}
virtual void setTexNo(u32 idx, u16 no) {
@@ -831,7 +831,7 @@ public:
}
virtual void setTevOrder(u32 idx, J3DTevOrder const* order) {
J3D_ASSERT_RANGE(0x62d, idx >= 0 && idx < ARRAY_SIZEU(mTevOrder));
J3D_ASSERT_NULLPTR(0x62e, order != 0);
J3D_ASSERT_NULLPTR(0x62e, order != NULL);
mTevOrder[idx] = *order;
}
virtual void setTevOrder(u32 idx, J3DTevOrder order) {
@@ -847,7 +847,7 @@ public:
virtual u8 getTevStageNum() const { return 1; }
virtual void setTevStage(u32 idx, J3DTevStage const* stage) {
J3D_ASSERT_RANGE(0x64b, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x64c, stage != 0);
J3D_ASSERT_NULLPTR(0x64c, stage != NULL);
mTevStage[idx] = *stage;
}
virtual void setTevStage(u32 idx, J3DTevStage stage) {
@@ -860,7 +860,7 @@ public:
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage const* stage) {
J3D_ASSERT_RANGE(0x65e, idx >= 0 && idx < ARRAY_SIZEU(mIndTevStage));
J3D_ASSERT_NULLPTR(0x65f, stage != 0);
J3D_ASSERT_NULLPTR(0x65f, stage != NULL);
mIndTevStage[idx] = *stage;
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage stage) {
@@ -908,7 +908,7 @@ public:
virtual s32 countDLSize();
virtual void setTexNo(u32 idx, u16 const* texNo) {
J3D_ASSERT_RANGE(0x6b4, idx >= 0 && idx < ARRAY_SIZEU(mTexNo));
J3D_ASSERT_NULLPTR(0x6b5, texNo != 0);
J3D_ASSERT_NULLPTR(0x6b5, texNo != NULL);
mTexNo[idx] = *texNo;
}
virtual void setTexNo(u32 idx, u16 texNo) {
@@ -921,7 +921,7 @@ public:
}
virtual void setTevOrder(u32 idx, J3DTevOrder const* order) {
J3D_ASSERT_RANGE(0x6c9, idx >= 0 && idx < ARRAY_SIZEU(mTevOrder));
J3D_ASSERT_NULLPTR(0x6ca, order != 0);
J3D_ASSERT_NULLPTR(0x6ca, order != NULL);
mTevOrder[idx] = *order;
}
virtual void setTevOrder(u32 idx, J3DTevOrder order) {
@@ -934,7 +934,7 @@ public:
}
virtual void setTevColor(u32 idx, J3DGXColorS10 const* color) {
J3D_ASSERT_RANGE(0x6dc, idx >= 0 && idx < ARRAY_SIZEU(mTevColor));
J3D_ASSERT_NULLPTR(0x6dd, color != 0);
J3D_ASSERT_NULLPTR(0x6dd, color != NULL);
mTevColor[idx] = *color;
}
virtual void setTevColor(u32 idx, J3DGXColorS10 color) {
@@ -947,7 +947,7 @@ public:
}
virtual void setTevKColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x6ef, idx >= 0 && idx < ARRAY_SIZEU(mTevKColor));
J3D_ASSERT_NULLPTR(0x6f0, color != 0);
J3D_ASSERT_NULLPTR(0x6f0, color != NULL);
mTevKColor[idx] = *color;
}
virtual void setTevKColor(u32 idx, J3DGXColor color) {
@@ -960,7 +960,7 @@ public:
}
virtual void setTevKColorSel(u32 idx, u8 const* sel) {
J3D_ASSERT_RANGE(0x702, idx >= 0 && idx < ARRAY_SIZEU(mTevKColorSel));
J3D_ASSERT_NULLPTR(0x703, sel != 0);
J3D_ASSERT_NULLPTR(0x703, sel != NULL);
mTevKColorSel[idx] = *sel;
}
virtual void setTevKColorSel(u32 idx, u8 sel) {
@@ -973,7 +973,7 @@ public:
}
virtual void setTevKAlphaSel(u32 idx, u8 const* sel) {
J3D_ASSERT_RANGE(0x715, idx >= 0 && idx < ARRAY_SIZEU(mTevKAlphaSel));
J3D_ASSERT_NULLPTR(0x716, sel != 0);
J3D_ASSERT_NULLPTR(0x716, sel != NULL);
mTevKAlphaSel[idx] = *sel;
}
virtual void setTevKAlphaSel(u32 idx, u8 sel) {
@@ -985,14 +985,14 @@ public:
return mTevKAlphaSel[idx];
}
virtual void setTevStageNum(u8 const* num) {
J3D_ASSERT_NULLPTR(0x727, num != 0);
J3D_ASSERT_NULLPTR(0x727, num != NULL);
mTevStageNum = *num;
}
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
virtual u8 getTevStageNum() const { return mTevStageNum; }
virtual void setTevStage(u32 idx, J3DTevStage const* stage) {
J3D_ASSERT_RANGE(0x736, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x737, stage != 0);
J3D_ASSERT_NULLPTR(0x737, stage != NULL);
mTevStage[idx] = *stage;
}
virtual void setTevStage(u32 idx, J3DTevStage stage) {
@@ -1005,7 +1005,7 @@ public:
}
virtual void setTevSwapModeInfo(u32 idx, J3DTevSwapModeInfo const* info) {
J3D_ASSERT_RANGE(0x749, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x74a, info != 0);
J3D_ASSERT_NULLPTR(0x74a, info != NULL);
mTevStage[idx].setTevSwapModeInfo(*info);
}
virtual void setTevSwapModeInfo(u32 idx, J3DTevSwapModeInfo info) {
@@ -1014,7 +1014,7 @@ public:
}
virtual void setTevSwapModeTable(u32 idx, J3DTevSwapModeTable const* table) {
J3D_ASSERT_RANGE(0x757, idx >= 0 && idx < ARRAY_SIZEU(mTevSwapModeTable));
J3D_ASSERT_NULLPTR(0x758, table != 0);
J3D_ASSERT_NULLPTR(0x758, table != NULL);
mTevSwapModeTable[idx] = *table;
}
virtual void setTevSwapModeTable(u32 idx, J3DTevSwapModeTable table) {
@@ -1027,7 +1027,7 @@ public:
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage const* stage) {
J3D_ASSERT_RANGE(0x76a, idx >= 0 && idx < ARRAY_SIZEU(mIndTevStage));
J3D_ASSERT_NULLPTR(0x76b, stage != 0);
J3D_ASSERT_NULLPTR(0x76b, stage != NULL);
mIndTevStage[idx] = *stage;
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage stage) {
@@ -1084,7 +1084,7 @@ public:
virtual s32 countDLSize();
virtual void setTexNo(u32 idx, u16 const* texNo) {
J3D_ASSERT_RANGE(0x7d5, idx >= 0 && idx < ARRAY_SIZEU(mTexNo));
J3D_ASSERT_NULLPTR(0x7d6, texNo != 0);
J3D_ASSERT_NULLPTR(0x7d6, texNo != NULL);
mTexNo[idx] = *texNo;
}
virtual void setTexNo(u32 idx, u16 texNo) {
@@ -1097,7 +1097,7 @@ public:
}
virtual void setTevOrder(u32 idx, J3DTevOrder const* order) {
J3D_ASSERT_RANGE(0x7ea, idx >= 0 && idx < ARRAY_SIZEU(mTevOrder));
J3D_ASSERT_NULLPTR(0x7eb, order != 0);
J3D_ASSERT_NULLPTR(0x7eb, order != NULL);
mTevOrder[idx] = *order;
}
virtual void setTevOrder(u32 idx, J3DTevOrder order) {
@@ -1110,7 +1110,7 @@ public:
}
virtual void setTevColor(u32 idx, J3DGXColorS10 const* color) {
J3D_ASSERT_RANGE(0x7fd, idx >= 0 && idx < ARRAY_SIZEU(mTevColor));
J3D_ASSERT_NULLPTR(0x7fe, color != 0);
J3D_ASSERT_NULLPTR(0x7fe, color != NULL);
mTevColor[idx] = *color;
}
virtual void setTevColor(u32 idx, J3DGXColorS10 color) {
@@ -1123,7 +1123,7 @@ public:
}
virtual void setTevKColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x810, idx >= 0 && idx < ARRAY_SIZEU(mTevKColor));
J3D_ASSERT_NULLPTR(0x811, color != 0);
J3D_ASSERT_NULLPTR(0x811, color != NULL);
mTevKColor[idx] = *color;
}
virtual void setTevKColor(u32 idx, J3DGXColor color) {
@@ -1136,7 +1136,7 @@ public:
}
virtual void setTevKColorSel(u32 idx, u8 const* sel) {
J3D_ASSERT_RANGE(0x823, idx >= 0 && idx < ARRAY_SIZEU(mTevKColorSel));
J3D_ASSERT_NULLPTR(0x824, sel != 0);
J3D_ASSERT_NULLPTR(0x824, sel != NULL);
mTevKColorSel[idx] = *sel;
}
virtual void setTevKColorSel(u32 idx, u8 sel) {
@@ -1149,7 +1149,7 @@ public:
}
virtual void setTevKAlphaSel(u32 idx, u8 const* sel) {
J3D_ASSERT_RANGE(0x836, idx >= 0 && idx < ARRAY_SIZEU(mTevKAlphaSel));
J3D_ASSERT_NULLPTR(0x837, sel != 0);
J3D_ASSERT_NULLPTR(0x837, sel != NULL);
mTevKAlphaSel[idx] = *sel;
}
virtual void setTevKAlphaSel(u32 idx, u8 sel) {
@@ -1161,14 +1161,14 @@ public:
return mTevKAlphaSel[idx];
}
virtual void setTevStageNum(u8 const* num) {
J3D_ASSERT_NULLPTR(0x848, num != 0);
J3D_ASSERT_NULLPTR(0x848, num != NULL);
mTevStageNum = *num;
}
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
virtual u8 getTevStageNum() const { return mTevStageNum; }
virtual void setTevStage(u32 idx, J3DTevStage const* stage) {
J3D_ASSERT_RANGE(0x857, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x858, stage != 0);
J3D_ASSERT_NULLPTR(0x858, stage != NULL);
mTevStage[idx] = *stage;
}
virtual void setTevStage(u32 idx, J3DTevStage stage) {
@@ -1181,7 +1181,7 @@ public:
}
virtual void setTevSwapModeInfo(u32 idx, J3DTevSwapModeInfo const* info) {
J3D_ASSERT_RANGE(0x86a, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x86b, info != 0);
J3D_ASSERT_NULLPTR(0x86b, info != NULL);
mTevStage[idx].setTevSwapModeInfo(*info);
}
virtual void setTevSwapModeInfo(u32 idx, J3DTevSwapModeInfo info) {
@@ -1190,7 +1190,7 @@ public:
}
virtual void setTevSwapModeTable(u32 idx, J3DTevSwapModeTable const* table) {
J3D_ASSERT_RANGE(0x878, idx >= 0 && idx < ARRAY_SIZEU(mTevSwapModeTable));
J3D_ASSERT_NULLPTR(0x879, table != 0);
J3D_ASSERT_NULLPTR(0x879, table != NULL);
mTevSwapModeTable[idx] = *table;
}
virtual void setTevSwapModeTable(u32 idx, J3DTevSwapModeTable table) {
@@ -1203,7 +1203,7 @@ public:
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage const* stage) {
J3D_ASSERT_RANGE(0x88b, idx >= 0 && idx < ARRAY_SIZEU(mIndTevStage));
J3D_ASSERT_NULLPTR(0x88c, stage != 0);
J3D_ASSERT_NULLPTR(0x88c, stage != NULL);
mIndTevStage[idx] = *stage;
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage stage) {
@@ -1260,7 +1260,7 @@ public:
virtual s32 countDLSize();
virtual void setTexNo(u32 idx, u16 const* texNo) {
J3D_ASSERT_RANGE(0x8f6, idx >= 0 && idx < ARRAY_SIZEU(mTexNo));
J3D_ASSERT_NULLPTR(0x8f7, texNo != 0);
J3D_ASSERT_NULLPTR(0x8f7, texNo != NULL);
mTexNo[idx] = *texNo;
}
virtual void setTexNo(u32 idx, u16 texNo) {
@@ -1273,7 +1273,7 @@ public:
}
virtual void setTevOrder(u32 idx, J3DTevOrder const* order) {
J3D_ASSERT_RANGE(0x90b, idx >= 0 && idx < ARRAY_SIZEU(mTevOrder));
J3D_ASSERT_NULLPTR(0x90c, order != 0);
J3D_ASSERT_NULLPTR(0x90c, order != NULL);
mTevOrder[idx] = *order;
}
virtual void setTevOrder(u32 idx, J3DTevOrder order) {
@@ -1286,7 +1286,7 @@ public:
}
virtual void setTevColor(u32 idx, J3DGXColorS10 const* color) {
J3D_ASSERT_RANGE(0x91e, idx >= 0 && idx < ARRAY_SIZEU(mTevColor));
J3D_ASSERT_NULLPTR(0x91f, color != 0);
J3D_ASSERT_NULLPTR(0x91f, color != NULL);
mTevColor[idx] = *color;
}
virtual void setTevColor(u32 idx, J3DGXColorS10 color) {
@@ -1299,7 +1299,7 @@ public:
}
virtual void setTevKColor(u32 idx, J3DGXColor const* color) {
J3D_ASSERT_RANGE(0x931, idx >= 0 && idx < ARRAY_SIZEU(mTevKColor));
J3D_ASSERT_NULLPTR(0x932, color != 0);
J3D_ASSERT_NULLPTR(0x932, color != NULL);
mTevKColor[idx] = *color;
}
virtual void setTevKColor(u32 idx, J3DGXColor color) {
@@ -1312,7 +1312,7 @@ public:
}
virtual void setTevKColorSel(u32 idx, u8 const* sel) {
J3D_ASSERT_RANGE(0x944, idx >= 0 && idx < ARRAY_SIZEU(mTevKColorSel));
J3D_ASSERT_NULLPTR(0x945, sel != 0);
J3D_ASSERT_NULLPTR(0x945, sel != NULL);
mTevKColorSel[idx] = *sel;
}
virtual void setTevKColorSel(u32 idx, u8 sel) {
@@ -1325,7 +1325,7 @@ public:
}
virtual void setTevKAlphaSel(u32 idx, u8 const* sel) {
J3D_ASSERT_RANGE(0x957, idx >= 0 && idx < ARRAY_SIZEU(mTevKAlphaSel));
J3D_ASSERT_NULLPTR(0x958, sel != 0);
J3D_ASSERT_NULLPTR(0x958, sel != NULL);
mTevKAlphaSel[idx] = *sel;
}
virtual void setTevKAlphaSel(u32 idx, u8 sel) {
@@ -1337,14 +1337,14 @@ public:
return mTevKAlphaSel[idx];
}
virtual void setTevStageNum(u8 const* num) {
J3D_ASSERT_NULLPTR(0x969, num != 0);
J3D_ASSERT_NULLPTR(0x969, num != NULL);
mTevStageNum = *num;
}
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
virtual u8 getTevStageNum() const { return mTevStageNum; }
virtual void setTevStage(u32 idx, J3DTevStage const* stage) {
J3D_ASSERT_RANGE(0x978, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x979, stage != 0);
J3D_ASSERT_NULLPTR(0x979, stage != NULL);
mTevStage[idx] = *stage;
}
virtual void setTevStage(u32 idx, J3DTevStage stage) {
@@ -1357,7 +1357,7 @@ public:
}
virtual void setTevSwapModeInfo(u32 idx, J3DTevSwapModeInfo const* info) {
J3D_ASSERT_RANGE(0x98b, idx >= 0 && idx < ARRAY_SIZEU(mTevStage));
J3D_ASSERT_NULLPTR(0x98c, info != 0);
J3D_ASSERT_NULLPTR(0x98c, info != NULL);
mTevStage[idx].setTevSwapModeInfo(*info);
}
virtual void setTevSwapModeInfo(u32 idx, J3DTevSwapModeInfo info) {
@@ -1366,7 +1366,7 @@ public:
}
virtual void setTevSwapModeTable(u32 idx, J3DTevSwapModeTable const* table) {
J3D_ASSERT_RANGE(0x999, idx >= 0 && idx < ARRAY_SIZEU(mTevSwapModeTable));
J3D_ASSERT_NULLPTR(0x99a, table != 0);
J3D_ASSERT_NULLPTR(0x99a, table != NULL);
mTevSwapModeTable[idx] = *table;
}
virtual void setTevSwapModeTable(u32 idx, J3DTevSwapModeTable table) {
@@ -1379,7 +1379,7 @@ public:
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage const* stage) {
J3D_ASSERT_RANGE(0x9ac, idx >= 0 && idx < ARRAY_SIZEU(mIndTevStage));
J3D_ASSERT_NULLPTR(0x9ad, stage != 0);
J3D_ASSERT_NULLPTR(0x9ad, stage != NULL);
mIndTevStage[idx] = *stage;
}
virtual void setIndTevStage(u32 idx, J3DIndTevStage stage) {
@@ -1671,7 +1671,7 @@ public:
virtual void setIndTexStageNum(u8 num) { mIndTexStageNum = num; }
virtual u8 getIndTexStageNum() const { return mIndTexStageNum; }
virtual void setIndTexOrder(u32 idx, J3DIndTexOrder const* order) {
J3D_ASSERT_NULLPTR(0xa94, order != 0);
J3D_ASSERT_NULLPTR(0xa94, order != NULL);
J3D_ASSERT_RANGE(0xa95, idx >= 0 && idx < ARRAY_SIZEU(mIndTexOrder));
mIndTexOrder[idx] = *order;
}
@@ -1684,7 +1684,7 @@ public:
return &mIndTexOrder[idx];
}
virtual void setIndTexMtx(u32 idx, J3DIndTexMtx const* mtx) {
J3D_ASSERT_NULLPTR(0xaa7, mtx != 0);
J3D_ASSERT_NULLPTR(0xaa7, mtx != NULL);
J3D_ASSERT_RANGE(0xaa8, idx >= 0 && idx < ARRAY_SIZEU(mIndTexMtx));
mIndTexMtx[idx] = *mtx;
}
@@ -1697,7 +1697,7 @@ public:
return &mIndTexMtx[idx];
}
virtual void setIndTexCoordScale(u32 idx, J3DIndTexCoordScale const* scale) {
J3D_ASSERT_NULLPTR(0xaba, scale != 0);
J3D_ASSERT_NULLPTR(0xaba, scale != NULL);
J3D_ASSERT_RANGE(0xabb, idx >= 0 && idx < ARRAY_SIZEU(mIndTexCoordScale));
mIndTexCoordScale[idx] = *scale;
}
@@ -1831,31 +1831,31 @@ public:
virtual s32 countDLSize();
virtual u32 getType() { return 'PEFG'; }
virtual void setAlphaComp(J3DAlphaComp const* alphaComp) {
J3D_ASSERT_NULLPTR(0xbf9, alphaComp != 0);
J3D_ASSERT_NULLPTR(0xbf9, alphaComp != NULL);
mAlphaComp = *alphaComp;
}
virtual void setAlphaComp(J3DAlphaComp const& alphaComp) { mAlphaComp = alphaComp; }
virtual J3DAlphaComp* getAlphaComp() { return &mAlphaComp; }
virtual void setBlend(J3DBlend const* blend) {
J3D_ASSERT_NULLPTR(0xc07, blend != 0);
J3D_ASSERT_NULLPTR(0xc07, blend != NULL);
mBlend = *blend;
}
virtual void setBlend(J3DBlend const& blend) { mBlend = blend; }
virtual J3DBlend* getBlend() { return &mBlend; }
virtual void setZMode(J3DZMode const* zMode) {
J3D_ASSERT_NULLPTR(0xc15, zMode != 0);
J3D_ASSERT_NULLPTR(0xc15, zMode != NULL);
mZMode = *zMode;
}
virtual void setZMode(J3DZMode zMode) { mZMode = zMode; }
virtual J3DZMode* getZMode() { return &mZMode; }
virtual void setZCompLoc(u8 const* zCompLoc) {
J3D_ASSERT_NULLPTR(0xc23, zCompLoc != 0);
J3D_ASSERT_NULLPTR(0xc23, zCompLoc != NULL);
mZCompLoc = *zCompLoc;
}
virtual void setZCompLoc(u8 zCompLoc) { mZCompLoc = zCompLoc; }
virtual u8 getZCompLoc() const { return mZCompLoc; }
virtual void setDither(u8 const* dither) {
J3D_ASSERT_NULLPTR(0xc31, dither != 0);
J3D_ASSERT_NULLPTR(0xc31, dither != NULL);
mDither = *dither;
}
virtual void setDither(u8 dither) { mDither = dither; }
@@ -1892,31 +1892,31 @@ public:
virtual void setFog(J3DFog* pFog) { mFog.setFogInfo(pFog->getFogInfo()); }
virtual J3DFog* getFog() { return &mFog; }
virtual void setAlphaComp(J3DAlphaComp const* alphaComp) {
J3D_ASSERT_NULLPTR(0xc7d, alphaComp != 0);
J3D_ASSERT_NULLPTR(0xc7d, alphaComp != NULL);
mAlphaComp = *alphaComp;
}
virtual void setAlphaComp(J3DAlphaComp const& alphaComp) { mAlphaComp = alphaComp; }
virtual J3DAlphaComp* getAlphaComp() { return &mAlphaComp; }
virtual void setBlend(J3DBlend const* blend) {
J3D_ASSERT_NULLPTR(0xc8b, blend != 0);
J3D_ASSERT_NULLPTR(0xc8b, blend != NULL);
mBlend = *blend;
}
virtual void setBlend(J3DBlend const& blend) { mBlend = blend; }
virtual J3DBlend* getBlend() { return &mBlend; }
virtual void setZMode(J3DZMode const* zMode) {
J3D_ASSERT_NULLPTR(0xc99, zMode != 0);
J3D_ASSERT_NULLPTR(0xc99, zMode != NULL);
mZMode = *zMode;
}
virtual void setZMode(J3DZMode zMode) { mZMode = zMode; }
virtual J3DZMode* getZMode() { return &mZMode; }
virtual void setZCompLoc(u8 const* zCompLoc) {
J3D_ASSERT_NULLPTR(0xca7, zCompLoc != 0);
J3D_ASSERT_NULLPTR(0xca7, zCompLoc != NULL);
mZCompLoc = *zCompLoc;
}
virtual void setZCompLoc(u8 zCompLoc) { mZCompLoc = zCompLoc; }
virtual u8 getZCompLoc() const { return mZCompLoc; }
virtual void setDither(u8 const* dither) {
J3D_ASSERT_NULLPTR(0xcb5, dither != 0);
J3D_ASSERT_NULLPTR(0xcb5, dither != NULL);
mDither = *dither;
}
virtual void setDither(u8 dither) { mDither = dither; }
+3 -6
View File
@@ -4,7 +4,7 @@
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include "JSystem/J3DGraphBase/J3DShape.h"
#include <stdint.h>
#include <stdint>
class J3DJoint;
class J3DMaterialAnm;
@@ -56,12 +56,9 @@ public:
J3DIndBlock* getIndBlock() { return mIndBlock; }
J3DJoint* getJoint() { return mJoint; }
J3DMaterialAnm* getMaterialAnm() {
if ((uintptr_t)mMaterialAnm < 0xC0000000) {
return mMaterialAnm;
} else {
return NULL;
}
return (uintptr_t)mMaterialAnm < 0xC0000000 ? mMaterialAnm : NULL;
}
u32 getMaterialMode() { return mMaterialMode; }
J3DNBTScale* getNBTScale() { return mTexGenBlock->getNBTScale(); }
u16 getTexNo(u32 idx) { return mTevBlock->getTexNo(idx); }
J3DGXColor* getTevKColor(u32 param_0) { return mTevBlock->getTevKColor(param_0); }
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "dolphin/gd/GDBase.h"
#include <stdint.h>
#include <stdint>
class J3DMatPacket;
+4 -1
View File
@@ -139,7 +139,10 @@ struct J3DSys {
J3DMtxCalc * getCurrentMtxCalc() const { return mCurrentMtxCalc; }
void setTexture(J3DTexture* pTex) { mTexture = pTex; }
void setTexture(J3DTexture* pTex) {
JUT_ASSERT_MSG(220, pTex != NULL, "Error : null pointer.");
mTexture = pTex;
}
J3DTexture* getTexture() { return mTexture; }
void setNBTScale(Vec* scale) { mNBTScale = scale; }
+2 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/J3DAssert.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "global.h"
#include <stdint.h>
#include <stdint>
/**
* @ingroup jsystem-j3d
@@ -33,6 +33,7 @@ public:
}
void setResTIMG(u16 index, const ResTIMG& timg) {
JUT_ASSERT_MSG(81, (bool)(index < mNum), "Error : range over.");
mpRes[index] = timg;
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)));
@@ -0,0 +1,11 @@
#ifndef JAHSOUNDPLAYERNODE_H
#define JAHSOUNDPLAYERNODE_H
#include "JSystem/JAHostIO/JAHFrameNode.h"
class JAHSoundPlayerNode : public JAHFrameNode {
public:
JAHSoundPlayerNode();
};
#endif /* JAHSOUNDPLAYERNODE_H */
+29
View File
@@ -0,0 +1,29 @@
#ifndef JAHFRAMENODE_H
#define JAHFRAMENODE_H
#include "dolphin/types.h"
#include "JSystem/JAHostIO/JAHioNode.h"
class JAHVirtualNode;
class JAHFrameNode : public JAHioNode {
public:
JAHFrameNode(const char*);
/* vt[07] */ virtual ~JAHFrameNode();
/* vt[02] */ virtual void listenPropertyEvent(const JORPropertyEvent*);
/* vt[05] */ virtual void genMessage(JORMContext*);
/* vt[06] */ virtual void listenNodeEvent(const JORNodeEvent*);
/* vt[0C] */ virtual s32 getNodeType();
/* vt[11] */ virtual void onCurrentNodeFrame();
/* vt[12] */ virtual void onFrame();
void framework();
void currentFramework();
JSULink<JAHFrameNode>* getFrameNodeLink() { return &mFrameNodeLink; }
/* 0x44 */ JSUTree<JAHVirtualNode> mTree;
/* 0x60 */ JSULink<JAHFrameNode> mFrameNodeLink;
};
#endif /* JAHFRAMENODE_H */
+29
View File
@@ -0,0 +1,29 @@
#ifndef JAHPUBDEFINE_H
#define JAHPUBDEFINE_H
#include "JSystem/JUtility/JUTAssert.h"
template<class T>
class JAHSingletonBase {
public:
JAHSingletonBase() { sInstance = (T*)this; }
virtual ~JAHSingletonBase() { sInstance = NULL; }
static T* newInstance() {
JUT_ASSERT(82, sInstance==NULL);
if (!sInstance) {
sInstance = new T();
}
JUT_ASSERT(85, sInstance!=NULL);
return sInstance;
}
static T* getIns() {
JUT_ASSERT(110, sInstance);
return sInstance;
}
static T* sInstance;
};
#endif /* JAHPUBDEFINE_H */
+11
View File
@@ -0,0 +1,11 @@
#ifndef JAHUTABLEDIT_H
#define JAHUTABLEDIT_H
#include "JSystem/JAHostIO/JAHVirtualNode.h"
class JAHUSeBox : public JAHVirtualNode {
public:
JAHUSeBox();
};
#endif /* JAHUTABLEDIT_H */
+23
View File
@@ -0,0 +1,23 @@
#ifndef JAHVIRTUALNODE_H
#define JAHVIRTUALNODE_H
#include "JSystem/JAHostIO/JAHioNode.h"
#include "JSystem/JSupport/JSUList.h"
class JAHControl;
class JAHVirtualNode {
public:
JAHVirtualNode();
virtual void updateNode();
virtual void message(JAHControl&);
virtual void onFrame();
virtual void onCurrentNodeFrame();
virtual void propertyEvent(JAH_P_Event, u32);
virtual void nodeEvent(JAH_N_Event);
/* 0x04 */ JSUTree<JAHVirtualNode> mTree;
/* 0x20 */ char mName[32];
};
#endif /* JAHVIRTUALNODE_H */
+52
View File
@@ -0,0 +1,52 @@
#ifndef JAHIOMESSAGE_H
#define JAHIOMESSAGE_H
#include "dolphin/types.h"
class JAHioNode;
class JORMContext;
class JAHControl {
public:
JAHControl(JORMContext*, JAHioNode*);
void returnY(u16);
void indent(s8);
void makeComment(const char*, u32, u8, u32);
static u16 getLineHeight() { return smLineHeight; }
static u16 getContWidth() { return smContWidth; }
static u16 getIntervalX() { return smIntX; }
static u16 getNameWidth() { return smNameWidth; }
static u16 smButtonWidth[];
static u16 smCommentWidth[];
static u16 smComboWidth[];
static u16 smYTop;
static u16 smXLeft;
static u16 smIndentSize;
static u16 smLineHeight;
static u16 smContWidth;
static u16 smIntX;
static u16 smIntY;
static u16 smNameWidth;
u16 getX() { return mX; }
u16 getY() { return mY; }
JORMContext* getContext() { return mContext; }
void tabX(u16 param_1) {
mX += param_1 + smIntX;
}
void returnYDirectSize(u16 param_1) {
mY += param_1;
mX = smXLeft + field_0x4 * smIndentSize;
}
/* 0x00 */ u16 mX;
/* 0x02 */ u16 mY;
/* 0x04 */ u16 field_0x4;
/* 0x08 */ JORMContext* mContext;
/* 0x0C */ JAHioNode* mNode;
};
#endif /* JAHIOMESSAGE_H */
+28
View File
@@ -0,0 +1,28 @@
#ifndef JAHIOMGR_H
#define JAHIOMGR_H
#include "JSystem/JAHostIO/JAHPubDefine.h"
#include "JSystem/JSupport/JSUList.h"
class JAHFrameNode;
class JAHioNode;
class JORReflexible;
class JAHioMgr : public JAHSingletonBase<JAHioMgr> {
public:
JAHioMgr();
void init_OnGame();
bool isGameMode();
void appendRootNode(JORReflexible*, JAHioNode*);
void appendFrameNode(JAHioNode*);
void removeFrameNode(JAHioNode*);
u32 framework();
u32 getNodeSysType() { return field_0x8; }
/* 0x04 */ s32 field_0x4;
/* 0x08 */ u32 field_0x8;
JSUList<JAHFrameNode> field_0xc;
};
#endif /* JAHIOMGR_H */
+55
View File
@@ -0,0 +1,55 @@
#ifndef JAHIONODE_H
#define JAHIONODE_H
#include "JSystem/JHostIO/JORReflexible.h"
#include "JSystem/JSupport/JSUList.h"
enum JAH_N_Event {
JAH_N_EVENT0 = 0,
JAH_N_EVENT1 = 1,
JAH_N_EVENT2 = 2,
};
enum JAH_P_Event {
JAH_P_EVENT0 = 0,
JAH_P_EVENT1 = 1,
};
class JAHControl;
class JAHioNode : public JORReflexible {
public:
JAHioNode(const char*);
/* vt[07] */ virtual ~JAHioNode();
/* vt[02] */ virtual void listenPropertyEvent(const JORPropertyEvent*);
/* vt[05] */ virtual void genMessage(JORMContext*);
/* vt[06] */ virtual void listenNodeEvent(const JORNodeEvent*);
/* vt[08] */ virtual void message(JAHControl&) {}
/* vt[09] */ virtual void appendNode(JAHioNode*, const char*);
/* vt[0A] */ virtual void prependNode(JAHioNode*, const char*);
/* vt[0B] */ virtual void removeNode(JAHioNode*);
/* vt[0C] */ virtual s32 getNodeType() { return 0; }
/* vt[0D] */ virtual u32 getNodeKind() const;
/* vt[0E] */ virtual u32 getNodeIcon() const { return 0; }
/* vt[0F] */ virtual void propertyEvent(JAH_P_Event, u32) {}
/* vt[10] */ virtual void nodeEvent(JAH_N_Event) {}
void updateNode();
void setNodeName(const char*);
void generateRealChildren(JORMContext*);
void generateTempChildren(JORMContext*);
JAHioNode* getParent();
static JAHioNode* getCurrentNode() { return smCurrentNode; }
static JAHioNode* smCurrentNode;
JSUTree<JAHioNode>* getTree() { return &mTree; }
char* getNodeName() { return mName; }
void setLastChild(JAHioNode* node) { mLastChild = node; }
/* 0x04 */ JSUTree<JAHioNode> mTree;
/* 0x20 */ char mName[32];
/* 0x40 */ JAHioNode* mLastChild;
};
#endif /* JAHIONODE_H */
+10
View File
@@ -0,0 +1,10 @@
#ifndef JAHIOUTIL_H
#define JAHIOUTIL_H
namespace JAHioUtil {
char* getString(const char* msg, ...);
extern char mStringBuffer[];
}
#endif /* JAHIOUTIL_H */
@@ -0,0 +1,49 @@
#ifndef JAWEXTSYSTEM_H
#define JAWEXTSYSTEM_H
#include "JSystem/JAWExtSystem/JAWSystem.h"
#include "JSystem/JGadget/std-list.h"
class JAWWindow;
class JUTGamePad;
namespace JAWExtSystem {
BOOL registWindow(u32, JAWWindow*, int, int);
BOOL destroyWindow(u32, JAWWindow*);
void nextPage();
void prevPage();
void nextWindow();
void prevWindow();
void draw();
void padProc(const JUTGamePad&);
class TSystemInterface : public JAWSystemInterface {
public:
TSystemInterface() {}
virtual BOOL registWindow(u32 param_1, JAWWindow* param_2, int param_3, int param_4) {
return JAWExtSystem::registWindow(param_1, param_2, param_3, param_4);
}
virtual BOOL destroyWindow(u32 param_1, JAWWindow* param_2) {
return JAWExtSystem::destroyWindow(param_1, param_2);
}
virtual void setForegroundWindow(JAWWindow*) {}
};
class TCurrentHeap {
public:
TCurrentHeap(const TSystemInterface& interface) {
heap = JKRGetCurrentHeap();
JKRSetCurrentHeap(interface.getCurrentHeap());
}
~TCurrentHeap() { JKRSetCurrentHeap(heap); }
/* 0x00 */ JKRHeap* heap;
};
extern JGadget::TList<JAWWindow*> sPage[128];
extern TSystemInterface sInterface;
extern s32 sCurrentPage;
extern u8 lbl_80748E44;
}
#endif /* JAWEXTSYSTEM_H */
@@ -0,0 +1,43 @@
#ifndef JAWGRAPHCONTEXT_H
#define JAWGRAPHCONTEXT_H
#include "JSystem/JUtility/TColor.h"
#include "JSystem/JGeometry.h"
class J2DPrint;
class JUTResFont;
class JAWGraphContext {
public:
JAWGraphContext();
~JAWGraphContext();
void reset();
void color(u8, u8, u8, u8);
void color(const JUtility::TColor&);
void locate(int, int);
void print(char const*, ...);
void print(int, int, const char*, ...);
void color(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
void fillBox(const JGeometry::TBox2<f32>&);
void drawFrame(const JGeometry::TBox2<f32>&);
void line(const JGeometry::TVec2<f32>&, const JGeometry::TVec2<f32>&);
void setGXforPrint();
void setGXforDraw();
/* 0x00 */ J2DPrint* field_0x0;
/* 0x04 */ JUtility::TColor field_0x4;
/* 0x08 */ JUtility::TColor field_0x8;
/* 0x0C */ JUtility::TColor field_0xc;
/* 0x10 */ JUtility::TColor field_0x10;
/* 0x14 */ u8 mParentAlpha;
/* 0x15 */ u8 field_0x15;
/* 0x16 */ u8 field_0x16;
/* 0x18 */ int field_0x18;
void setParentAlpha(u8 alpha) { mParentAlpha = alpha; }
static JUTResFont* sFont;
static bool lbl_8074CD30;
};
#endif /* JAWGRAPHCONTEXT_H */
+22
View File
@@ -0,0 +1,22 @@
#ifndef JAWSYSTEM_H
#define JAWSYSTEM_H
#include "JSystem/JKernel/JKRHeap.h"
class JAWWindow;
class JAWSystemInterface {
public:
JAWSystemInterface();
virtual BOOL registWindow(u32, JAWWindow*, int, int) = 0;
virtual BOOL destroyWindow(u32, JAWWindow*) = 0;
virtual void setForegroundWindow(JAWWindow*) = 0;
/* 0x04 */ JKRHeap* mHeap;
JKRHeap* getCurrentHeap() const;
static JAWSystemInterface* sInstance;
};
#endif /* JAWSYSTEM_H */
+112
View File
@@ -0,0 +1,112 @@
#ifndef JAWWINDOW_H
#define JAWWINDOW_H
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "JSystem/J2DGraph/J2DWindow.h"
#include "JSystem/JGeometry.h"
class JAWGraphContext;
class JUTGamePad;
class JUTPoint {
public:
JUTPoint(int i_x, int i_y) {
x = i_x;
y = i_y;
}
/* 0x00*/ int x;
/* 0x04*/ int y;
};
class JAWWindow {
public:
class TJ2DWindowDraw : public J2DWindow {
public:
TJ2DWindowDraw(u32, const JGeometry::TBox2<f32>&, const char*);
void drawPane(int x, int y, const J2DGrafContext* p_grafCtx) {
J2DPane::draw(x, y, p_grafCtx, true, true);
calcMtx();
}
};
class TWindowText : public J2DPane {
public:
TWindowText(JAWWindow*);
virtual void drawSelf(f32, f32);
virtual void drawSelf(f32, f32, Mtx*);
/* 0x0FC */ JAWGraphContext field_0xfc;
/* 0x118 */ JAWWindow* m_pParent;
/* 0x11C */ JUTPoint field_0x11c;
};
JAWWindow(const char*, int, int);
virtual ~JAWWindow();
virtual void onDraw(JAWGraphContext*);
virtual BOOL onInit();
virtual void frameWork() {}
virtual void onPadProc(const JUTGamePad&) {}
virtual void onTrigA(const JUTGamePad&) {}
virtual void onTrigB(const JUTGamePad&) {}
virtual void onTrigX(const JUTGamePad&) {}
virtual void onTrigY(const JUTGamePad&) {}
virtual void onTrigMenu(const JUTGamePad&) {}
virtual void onTrigL(const JUTGamePad&) {}
virtual void onTrigZ(const JUTGamePad&) {}
virtual void onTrigUp(const JUTGamePad&) {}
virtual void onTrigDown(const JUTGamePad&) {}
virtual void onTrigLeft(const JUTGamePad&) {}
virtual void onTrigRight(const JUTGamePad&) {}
virtual void onReleaseA(const JUTGamePad&) {}
virtual void onReleaseB(const JUTGamePad&) {}
virtual void onReleaseX(const JUTGamePad&) {}
virtual void onReleaseY(const JUTGamePad&) {}
virtual void onReleaseMenu(const JUTGamePad&) {}
virtual void onReleaseL(const JUTGamePad&) {}
virtual void onReleaseZ(const JUTGamePad&) {}
virtual void onReleaseUp(const JUTGamePad&) {}
virtual void onReleaseDown(const JUTGamePad&) {}
virtual void onReleaseLeft(const JUTGamePad&) {}
virtual void onReleaseRight(const JUTGamePad&) {}
virtual void onKeyA(const JUTGamePad&) {}
virtual void onKeyB(const JUTGamePad&) {}
virtual void onKeyX(const JUTGamePad&) {}
virtual void onKeyY(const JUTGamePad&) {}
virtual void onKeyMenu(const JUTGamePad&) {}
virtual void onKeyL(const JUTGamePad&) {}
virtual void onKeyZ(const JUTGamePad&) {}
virtual void onKeyUp(const JUTGamePad&) {}
virtual void onKeyDown(const JUTGamePad&) {}
virtual void onKeyLeft(const JUTGamePad&) {}
virtual void onKeyRight(const JUTGamePad&) {}
BOOL initIf();
void setTitleColor(const JUtility::TColor&, const JUtility::TColor&);
void setWindowColor(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
void move(f32, f32);
void addPosition(f32, f32);
void addSize(f32, f32);
static JUtility::TColor convJudaColor(u16);
void padProc(const JUTGamePad&);
/* 0x004 */ Mtx mMatrix;
/* 0x034 */ u8 field_0x34[0x38 - 0x34];
/* 0x038 */ TJ2DWindowDraw field_0x38;
/* 0x180 */ J2DTextBox field_0x180;
/* 0x2B0 */ TWindowText field_0x2b0;
/* 0x3D8 */ JUtility::TColor field_0x3d8;
/* 0x3DC */ JUtility::TColor field_0x3dc;
/* 0x3E0 */ JUtility::TColor field_0x3e0;
/* 0x3E4 */ JUtility::TColor field_0x3e4;
/* 0x3E8 */ int field_0x3e8;
/* 0x3EC */ u8 field_0x3ec;
void setMatrix(Mtx mtx) { MTXCopy(mtx, mMatrix); }
void setAlpha(u8 alpha) { field_0x38.setAlpha(alpha); }
void draw(int x, int y, const J2DGrafContext* p_grafCtx) { field_0x38.drawPane(x, y, p_grafCtx); }
};
#endif /* JAWWINDOW_H */
@@ -0,0 +1,10 @@
#ifndef JAWWINDOW3D_H
#define JAWWINDOW3D_H
#include "JSystem/JGeometry.h"
namespace JAWWindow3D {
extern JGeometry::TVec2<f32> sPtOrigin;
}
#endif /* JAWWINDOW3D_H */
+20
View File
@@ -0,0 +1,20 @@
#ifndef JAWBANKVIEW_H
#define JAWBANKVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWBankView : public JAWWindow {
public:
JAWBankView();
/* 0x3F0 */ int field_0x3f0;
/* 0x3F4 */ int field_0x3f4;
/* 0x3F8 */ int field_0x3f8;
/* 0x3FC */ int field_0x3fc;
/* 0x400 */ u8 field_0x400;
/* 0x404 */ int field_0x404;
/* 0x408 */ f32 field_0x408;
/* 0x40C */ u8 field_0x40c[4];
};
#endif /* JAWBANKVIEW_H */
+14
View File
@@ -0,0 +1,14 @@
#ifndef JAWCHVIEW_H
#define JAWCHVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWChView : public JAWWindow {
public:
JAWChView();
/* 0x3F0 */ int field_0x3f0;
/* 0x3F4 */ u8 field_0x3f4[4];
};
#endif /* JAWCHVIEW_H */
@@ -0,0 +1,11 @@
#ifndef JAWENTRYSEVIEW_H
#define JAWENTRYSEVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWEntrySeViewBasic : public JAWWindow {
public:
JAWEntrySeViewBasic();
};
#endif /* JAWENTRYSEVIEW_H */
@@ -0,0 +1,11 @@
#ifndef JAWHIOBANKEDIT_H
#define JAWHIOBANKEDIT_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWHioBankEdit : public JAWWindow {
public:
JAWHioBankEdit();
};
#endif /* JAWHIOBANKEDIT_H */
@@ -0,0 +1,55 @@
#ifndef JAWHIORECEIVER_H
#define JAWHIORECEIVER_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
#include "JSystem/JHostIO/JHIComm.h"
#include "JSystem/JHostIO/JHICommonMem.h"
#include "JSystem/JAudio2/JAISound.h"
class JAISeqData;
class JADHioReceiver : JHITag<JHICmnMem> {
public:
JADHioReceiver();
virtual ~JADHioReceiver();
virtual void receive(const char*, s32);
virtual u32 parse(u32,char*, u32) = 0;
};
class JAWHioReceiver : public JAWWindow {
public:
class TSeqList {
public:
class TSeqData {
public:
};
bool getSeqData(JAISoundID, JAISeqData*) const;
/* 0x00 */ JSUList<TSeqData> mList;
};
class THioReceiver : public JADHioReceiver {
public:
THioReceiver();
virtual ~THioReceiver();
virtual u32 parse(u32,char*, u32);
/* 0x0C */ int field_0xc;
/* 0x10 */ u8 field_0x10;
/* 0x14 */ TSeqList field_0x14;
/* 0x20 */ int field_0x20;
/* 0x24 */ int field_0x24;
/* 0x28 */ int field_0x28;
/* 0x2C */ int field_0x2c;
};
JAWHioReceiver();
const TSeqList* getSeqList() const { return &field_0x3f0.field_0x14; }
/* 0x3F0 */ THioReceiver field_0x3f0;
};
#endif /* JAWHIORECEIVER_H */
+11
View File
@@ -0,0 +1,11 @@
#ifndef JAWPLAYSEVIEW_H
#define JAWPLAYSEVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWPlaySeViewBasic : public JAWWindow {
public:
JAWPlaySeViewBasic();
};
#endif /* JAWPLAYSEVIEW_H */
@@ -0,0 +1,11 @@
#ifndef JAWPLAYERCHVIEW_H
#define JAWPLAYERCHVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWPlayerChView : public JAWWindow {
public:
JAWPlayerChView();
};
#endif /* JAWPLAYERCHVIEW_H */
+11
View File
@@ -0,0 +1,11 @@
#ifndef JAWREPORTVIEW_H
#define JAWREPORTVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWReportView : public JAWWindow {
public:
JAWReportView();
};
#endif /* JAWREPORTVIEW_H */
+11
View File
@@ -0,0 +1,11 @@
#ifndef JAWSYSMEMVIEW_H
#define JAWSYSMEMVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWSysMemView : public JAWWindow {
public:
JAWSysMemView();
};
#endif /* JAWSYSMEMVIEW_H */
+11
View File
@@ -0,0 +1,11 @@
#ifndef JAWVOLUME_H
#define JAWVOLUME_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWVolume : public JAWWindow {
public:
JAWVolume(int, int);
};
#endif /* JAWVOLUME_H */
+1 -1
View File
@@ -10,7 +10,7 @@ class JAISeMgr;
* @ingroup jsystem-jaudio
*
*/
class JAISe : public JSULink<JAISe>, public JASPoolAllocObject<JAISe>, public JAISound {
class JAISe : public JSULink<JAISe>, public JAISound, public JASPoolAllocObject<JAISe> {
public:
class TInner {
public:
+11 -3
View File
@@ -13,6 +13,7 @@ struct JASSoundParams;
*/
struct JASNonCopyable {
JASNonCopyable() {}
~JASNonCopyable() {}
/* 0x0 */ int field_0x0;
}; // Size: 0x4
@@ -69,6 +70,7 @@ public:
return mMaxActiveSe + mMaxInactiveSe;
}
int getMaxInactiveSe() const { return mMaxInactiveSe; }
int getMaxActiveSe() const { return mMaxActiveSe; }
void setMaxActiveSe(int num) { mMaxActiveSe = num; }
void setMaxInactiveSe(int num) { mMaxInactiveSe = num; }
@@ -88,11 +90,11 @@ public:
*
*/
class JAISeMgr : public JASGlobalInstance<JAISeMgr>,
public JAISeqDataUser,
public JAISoundActivity {
public JAISeqDataUser {
public:
JAISeMgr(bool setInstance);
void setCategoryArrangement(const JAISeCategoryArrangement& arrangement);
void getCategoryArrangement(JAISeCategoryArrangement*);
void stop();
void stopSoundID(JAISoundID id);
void initParams();
@@ -105,10 +107,16 @@ public:
bool startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr);
int getNumActiveSe() const;
/* 0x004 */ JAISoundActivity mSoundActivity;
virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
JAISeCategoryMgr* getCategory(int index) { return &mCategoryMgrs[index]; }
JAISeCategoryMgr* getCategory(int categoryIndex) {
JUT_ASSERT(222, categoryIndex >= 0);
JUT_ASSERT(223, categoryIndex < NUM_CATEGORIES);
return &mCategoryMgrs[categoryIndex];
}
JAIAudience* getAudience() { return mAudience; }
JAIAudience* getAudience(int index) {
if (index >= 0 && index < NUM_CATEGORIES) {
+3 -2
View File
@@ -12,7 +12,7 @@ class JAISoundChild;
* @ingroup jsystem-jaudio
*
*/
class JAISeq : public JASPoolAllocObject<JAISeq>, public JAISound, public JSULink<JAISeq> {
class JAISeq : public JAISound, public JSULink<JAISeq>, public JASPoolAllocObject<JAISeq> {
public:
static const int NUM_CHILDREN = 32;
@@ -52,7 +52,8 @@ public:
void mixOut_(const JASSoundParams& params, JAISoundActivity activity);
void JAISeqMgr_mixOut_(const JASSoundParams& params, JAISoundActivity activity);
JAISeqData& getSeqData() { return inner_.mSeqData; }
const JAISeqData& getSeqData() const { return inner_.mSeqData; }
s32 getCategory() const { return inner_.field_0x39c; }
/* 0x0A8 */ TInner inner_;
/* 0x3A8 */ JAISoundStrategyMgr__unknown<JAISeq>* field_0x3a8;
+3 -3
View File
@@ -2,7 +2,7 @@
#define JAISEQDATAMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include <stdint.h>
#include <stdint>
/**
* @ingroup jsystem-jaudio
@@ -14,8 +14,8 @@ struct JAISeqData {
field_0x4 = param_1;
}
void set(void* param_0, u32 param_1) {
field_0x0 = param_0;
void set(const void* param_0, u32 param_1) {
field_0x0 = (void*)param_0;
field_0x4 = param_1;
}
+2 -1
View File
@@ -29,6 +29,8 @@ public:
JAISeq* beginStartSeq_();
bool endStartSeq_(JAISeq* seq, JAISoundHandle* handle);
/* 0x04 */ JAISoundActivity mActivity;
virtual ~JAISeqMgr() {}
virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
@@ -59,7 +61,6 @@ public:
void pause(bool paused) { mActivity.field_0x0.flags.flag2 = paused; }
private:
/* 0x04 */ JAISoundActivity mActivity;
/* 0x08 */ JAIAudience* mAudience;
/* 0x0C */ JAISeqDataMgr* seqDataMgr_;
/* 0x10 */ JAISoundStrategyMgr<JAISeq>* field_0x10;
+32 -2
View File
@@ -6,6 +6,36 @@
#include "JSystem/JUtility/JUTAssert.h"
#include "global.h"
class JAISound;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundHandle {
public:
JAISoundHandle() {sound_ = NULL;};
~JAISoundHandle() { releaseSound(); }
bool isSoundAttached() const { return sound_ != NULL; }
JAISound* getSound() {
JUT_ASSERT(41, sound_ != NULL);
return sound_;
}
JAISound* operator->() const {
JUT_ASSERT(58, sound_ != NULL);
return sound_;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
JAISound* sound_;
};
/**
* @ingroup jsystem-jaudio
*
@@ -63,7 +93,7 @@ struct JAISoundStatus_ {
bool isMute() const { return field_0x0.flags.mute; }
bool isPaused() const { return field_0x0.flags.paused; }
void pauseWhenOut() {
field_0x1.flags.flag6 = 1;
field_0x1.flags.flag3 = 1;
}
/* 0x0 */ union {
@@ -319,7 +349,7 @@ public:
return audible_ != NULL;
}
JAISoundFader& getFader() { return fader_; }
JAISoundFader* getFader() const { return (JAISoundFader*)&fader_; }
void fadeIn(u32 maxSteps) { fader_.fadeInFromOut(maxSteps); }
void fadeOut(u32 maxSteps) { fader_.fadeOut(maxSteps); }
-28
View File
@@ -7,34 +7,6 @@
class JAISound;
class JAISoundID;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundHandle {
public:
JAISoundHandle() {sound_ = NULL;};
~JAISoundHandle() { releaseSound(); }
bool isSoundAttached() const { return sound_ != NULL; }
JAISound* getSound() {
JUT_ASSERT(41, sound_ != NULL);
return sound_;
}
JAISound* operator->() const {
JUT_ASSERT(58, sound_ != NULL);
return sound_;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
JAISound* sound_;
};
/**
* @ingroup jsystem-jaudio
*
+1 -1
View File
@@ -11,7 +11,7 @@ class JAIStreamMgr;
* @ingroup jsystem-jaudio
*
*/
class JAIStream : public JASPoolAllocObject<JAIStream>, public JAISound, public JSULink<JAIStream> {
class JAIStream : public JAISound, public JSULink<JAIStream>, public JASPoolAllocObject<JAIStream> {
public:
struct TInner {
JASAramStream aramStream_;
+3 -1
View File
@@ -17,6 +17,7 @@ enum JASMixMode {
namespace JASDriver {
typedef s16* (*MixCallback)(s32);
typedef void (*MixFunc)(s16*, u32, MixCallback);
typedef void (*DSPBufCallback)(s16*, u32);
void initAI(void (*)(void));
void startDMA();
@@ -27,6 +28,7 @@ namespace JASDriver {
void readDspBuffer(s16*, u32);
void finishDSPFrame();
void registerMixCallback(MixCallback, JASMixMode);
void registDSPBufCallback(DSPBufCallback);
f32 getDacRate();
u32 getSubFrames();
u32 getDacSize();
@@ -48,7 +50,7 @@ namespace JASDriver {
extern s32 sDspDacWriteBuffer;
extern s32 sDspDacReadBuffer;
extern s32 sDspStatus;
extern void (*sDspDacCallback)(s16*, u32);
extern DSPBufCallback sDspDacCallback;
extern s16* lastRspMadep;
extern void (*dacCallbackFunc)(s16*, u32);
extern MixCallback extMixCallback;
+2 -2
View File
@@ -18,8 +18,8 @@ struct JASAudioReseter {
/* 0x0 */ u32 field_0x0;
/* 0x4 */ f32 mDSPLevel;
/* 0x8 */ s32 mIsDone;
/* 0xC */ bool field_0xc;
/* 0x8 */ s32 mDoneFlag;
/* 0xC */ bool mThreadStopFlag;
}; // Size: 0x10
#endif /* JASAUDIORESETER_H */
+6 -3
View File
@@ -18,7 +18,7 @@ namespace JASBNKParser {
namespace Ver1 {
struct TOsc {
/* 0x00 */ u8 _00[4];
/* 0x00 */ u32 id;
/* 0x04 */ u8 mTarget;
/* 0x08 */ f32 _08;
/* 0x0C */ u32 mTableOffset;
@@ -50,7 +50,7 @@ namespace JASBNKParser {
};
struct TListChunk : TChunk {
/* 0x8 */ u32 mCount;
/* 0x8 */ u32 count;
/* 0xC */ u32 mOffsets[0];
};
@@ -132,7 +132,10 @@ namespace JASBNKParser {
JASBank* createBank(void const*, JKRHeap*);
JASBasicBank* createBasicBank(void const*, JKRHeap*);
inline u32 getBankNumber(const void* param_0) { return ((u32*)param_0)[2]; }
inline u32 getBankNumber(const void* param_0) {
u32* ptr = (u32*)param_0;
return ptr[2];
}
extern u32 sUsedHeapSize;
};
+2
View File
@@ -17,6 +17,8 @@ namespace JASDsp {
*/
class JASBank {
public:
static const int PRG_OSC = 240;
JASBank() { mWaveBank = NULL; }
virtual ~JASBank() {};
virtual bool getInstParam(int, int, int, JASInstParam*) const = 0;
+6 -1
View File
@@ -6,6 +6,8 @@
struct JKRHeap;
const int OSC_MAX = 2;
/**
* @ingroup jsystem-jaudio
*
@@ -46,6 +48,7 @@ struct JASBasicInst : public JASInst {
struct TKeymap {
~TKeymap();
TKeymap() { mHighKey = -1; }
s32 getHighKey() const { return mHighKey; }
void setHighKey(int key) { mHighKey = key; }
/* 0x0 */ s32 mHighKey;
@@ -59,6 +62,7 @@ struct JASBasicInst : public JASInst {
void setKeyRegionCount(u32, JKRHeap*);
void setOsc(int, JASOscillator::Data const*);
TKeymap* getKeyRegion(int);
TKeymap* getKeyRegion(int) const;
virtual ~JASBasicInst();
virtual bool getParam(int, int, JASInstParam*) const;
@@ -66,10 +70,11 @@ struct JASBasicInst : public JASInst {
void setVolume(f32 volume) { mVolume = volume; }
void setPitch(f32 pitch) { mPitch = pitch; }
u32 getKeyRegionCount() const { return mKeymapCount; }
/* 0x04 */ f32 mVolume;
/* 0x08 */ f32 mPitch;
/* 0x0C */ JASOscillator::Data const* field_0xc[2];
/* 0x0C */ JASOscillator::Data const* field_0xc[OSC_MAX];
/* 0x10 */ u32 mKeymapCount;
/* 0x14 */ TKeymap* mKeymap;
};
+5 -5
View File
@@ -10,9 +10,9 @@
*/
struct JASBasicWaveBank : public JASWaveBank {
struct TWaveHandle : public JASWaveHandle {
int getWavePtr() const;
TWaveHandle() { mHeap = NULL; }
const JASWaveInfo* getWaveInfo() const { return &field_0x4; }
virtual int getWavePtr() const;
virtual const JASWaveInfo* getWaveInfo() const { return &field_0x4; }
bool compareHeap(JASHeap* heap) const { return mHeap == heap;}
/* 0x04 */ JASWaveInfo field_0x4;
@@ -31,10 +31,10 @@ struct JASBasicWaveBank : public JASWaveBank {
struct TWaveGroup : JASWaveArc {
TWaveGroup();
~TWaveGroup();
virtual ~TWaveGroup();
void setWaveCount(u32, JKRHeap*);
void onLoadDone();
void onEraseDone();
virtual void onLoadDone();
virtual void onEraseDone();
u32 getWaveID(int) const;
/* 0x74 */ JASBasicWaveBank* mBank;
+6 -4
View File
@@ -52,6 +52,8 @@ public:
class JASChannel : public JASPoolAllocObject_MultiThreaded<JASChannel> {
public:
typedef void (*Callback)(u32, JASChannel*, JASDsp::TChannel*, void*);
static const int BUSOUT_CPUCH = 6;
static const int OSC_NUM = 2;
enum CallbackType {
/* 0 */ CB_PLAY,
@@ -61,8 +63,8 @@ public:
};
enum Status {
/* 0 */ STATUS_INACTIVE,
/* 1 */ STATUS_ACTIVE,
/* 0 */ STATUS_STOP,
/* 1 */ STATUS_PLAY,
/* 2 */ STATUS_RELEASE,
};
@@ -128,7 +130,7 @@ public:
void setKey(s32 param_0) { mKey = param_0; }
void setVelocity(u32 param_0) { mVelocity = param_0; }
void setSkipSamples(u32 param_0) { mSkipSamples = param_0; }
bool isDolbyMode() { return mMixConfig[0].whole == 0xffff; }
bool isDolbyMode() const { return mMixConfig[0].whole == 0xffff; }
/* 0x00 */ int mStatus;
/* 0x04 */ bool mPauseFlag;
@@ -140,7 +142,7 @@ public:
/* 0x1C */ JASOscillator mOscillators[2];
/* 0x5C */ JASLfo mVibrate;
/* 0x74 */ JASLfo mTremolo;
/* 0x8C */ MixConfig mMixConfig[6];
/* 0x8C */ MixConfig mMixConfig[BUSOUT_CPUCH];
/* 0x98 */ u16 mPriority;
/* 0x9C */ JASChannelParams mParams;
/* 0xB4 */ JASSoundParams mSoundParams;
+7 -2
View File
@@ -42,10 +42,15 @@ struct JASPortCmd : JSULink<JASPortCmd> {
void execCommandStay();
};
bool addPortCmdOnce();
bool setPortCmd(Command func, JASPortArgs*);
static void execAllCommand();
Command _10;
JASPortArgs* _14;
Command getFunc() { return mFunc; }
JASPortArgs* getArgs() { return mArgs; }
Command mFunc;
JASPortArgs* mArgs;
static TPortHead sCommandListOnce;
static TPortHead sCommandListStay;
+3
View File
@@ -38,6 +38,9 @@ struct JASDSPChannel {
static void updateAll();
static int killActiveChannel();
static JASDSPChannel* getHandle(u32);
static u32 getNumUse();
static u32 getNumFree();
static u32 getNumBreak();
static JASDSPChannel* sDspChannels;
+8 -6
View File
@@ -19,14 +19,14 @@ namespace JASDsp {
};
typedef struct {
s16 field_0x0;
s16 field_0x2;
u16 field_0x0;
u16 field_0x2;
s16* field_0x4;
s16 field_0x8;
u16 field_0x8;
s16 field_0xa;
s16 field_0xc;
u16 field_0xc;
s16 field_0xe;
s16 field_0x10[8];
u16 field_0x10[8];
} FxBuf;
struct TChannel {
@@ -63,7 +63,7 @@ namespace JASDsp {
/* 0x00E */ short field_0x00E;
/* 0x010 */ u16 field_0x010[1][4]; // array size unknown
/* 0x018 */ u8 field_0x018[0x050 - 0x018];
/* 0x050 */ short field_0x050;
/* 0x050 */ u16 field_0x050;
/* 0x052 */ u16 field_0x052;
/* 0x054 */ u16 field_0x054;
/* 0x056 */ u16 field_0x056;
@@ -106,11 +106,13 @@ namespace JASDsp {
void setDSPMixerLevel(f32);
f32 getDSPMixerLevel();
TChannel* getDSPHandle(int);
TChannel* getDSPHandleNc(int);
void setFilterTable(s16*, s16*, u32);
void flushBuffer();
void invalChannelAll();
void initBuffer();
int setFXLine(u8, s16*, JASDsp::FxlineConfig_*);
BOOL changeFXLineParam(u8, u8, u32);
extern u8 const DSPADPCM_FILTER[64];
extern u32 const DSPRES_FILTER[320];
+1
View File
@@ -8,6 +8,7 @@ typedef s32 (*DriverCallback)(void*);
namespace JASDriver {
void setDSPLevel(f32);
u16 getChannelLevel_dsp();
f32 getChannelLevel();
f32 getDSPLevel();
void setOutputMode(u32);
u32 getOutputMode();
+4 -2
View File
@@ -32,10 +32,12 @@ struct JASDrumSet : public JASInst {
void newPercArray(u8, JKRHeap*);
virtual bool getParam(int, int, JASInstParam*) const;
void setPerc(int, JASDrumSet::TPerc*);
JASDrumSet::TPerc* getPerc(int);
JASDrumSet::TPerc* getPerc(int) const;
virtual u32 getType() const;
/* 0x4 */ TPerc** field_0x4;
/* 0x8 */ u8 field_0x8;
/* 0x4 */ TPerc** mPercArray;
/* 0x8 */ u8 mPercNumMax;
};
#endif /* JASDRUMSET_H */
+1 -1
View File
@@ -2,7 +2,7 @@
#define JASGADGET_H
#include "JSystem/JUtility/JUTAssert.h"
#include "string.h"
#include <string>
/**
* @ingroup jsystem-jaudio
+51 -23
View File
@@ -22,13 +22,15 @@ public:
bool alloc(JASHeap*, u32);
bool allocTail(JASHeap*, u32);
bool free();
u32 getTotalFreeSize() const;
u32 getFreeSize() const;
void insertChild(JASHeap*, JASHeap*, void*, u32, bool);
JASHeap* getTailHeap();
u32 getTailOffset();
u32 getCurOffset();
void* getBase() { return mBase; }
bool isAllocated() { return mBase; }
bool isAllocated() const { return mBase; }
u32 getSize() const { return mSize; }
/* 0x00 */ JSUTree<JASHeap> mTree;
@@ -180,7 +182,7 @@ class JASMemChunkPool : public T<JASMemChunkPool<ChunkSize, T> >::ObjectLevelLoc
mNextChunk = chunk;
}
u32 getFreeSize() {
u32 getFreeSize() const {
return ChunkSize - mUsedSize;
}
@@ -201,27 +203,23 @@ public:
}
bool createNewChunk() {
bool uVar2;
bool r27 = 0;
if (field_0x18 != NULL && field_0x18->isEmpty()) {
field_0x18->revive();
uVar2 = 1;
} else {
MemoryChunk* pMVar4 = field_0x18;
field_0x18 = new (JASKernel::getSystemHeap(), 0) MemoryChunk(pMVar4);
if (field_0x18 != NULL) {
uVar2 = 1;
} else {
JUT_WARN(428, "%s", "Not enough JASSystemHeap");
field_0x18 = new (JKRHeap::getSystemHeap(), 0) MemoryChunk(pMVar4);
if (field_0x18 != NULL) {
uVar2 = 1;
} else {
field_0x18 = pMVar4;
uVar2 = 0;
}
}
return true;
}
return uVar2;
MemoryChunk* pMVar4 = field_0x18;
field_0x18 = new (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);
if (field_0x18 != NULL) {
return true;
}
field_0x18 = pMVar4;
return false;
}
void* alloc(u32 size) {
@@ -245,7 +243,7 @@ public:
while (chunk != NULL) {
if (chunk->checkArea(ptr)) {
chunk->free(ptr);
bool r26 = false;
if (chunk != field_0x18 && chunk->isEmpty()) {
MemoryChunk* nextChunk = chunk->getNextChunk();
delete chunk;
@@ -269,6 +267,8 @@ namespace JASKernel {
JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* getCommandHeap();
void setupAramHeap(u32, u32);
JASHeap* getAramHeap();
u32 getAramFreeSize();
u32 getAramSize();
extern JASHeap audioAramHeap;
extern u32 sAramBase;
@@ -284,38 +284,54 @@ template <typename T>
class JASPoolAllocObject {
public:
static void* operator new(size_t n) {
#if PLATFORM_GCN
JASMemPool<T>& memPool_ = getMemPool_();
#endif
return memPool_.alloc(n);
}
static void* operator new(size_t n, void* ptr) {
return ptr;
}
static void operator delete(void* ptr, size_t n) {
#if PLATFORM_GCN
JASMemPool<T>& memPool_ = getMemPool_();
#endif
memPool_.free(ptr, n);
}
static void newMemPool(int param_0) {
#if PLATFORM_GCN
JASMemPool<T>& memPool_ = getMemPool_();
#endif
memPool_.newMemPool(param_0);
}
static u32 getFreeMemCount() {
#if PLATFORM_GCN
JASMemPool<T>& memPool_ = getMemPool_();
#endif
return memPool_.getFreeMemCount();
}
static u32 getTotalMemCount() {
#if PLATFORM_GCN
JASMemPool<T>& memPool_ = getMemPool_();
#endif
return memPool_.getTotalMemCount();
}
private:
// Fakematch? Is memPool_ both an in-function static and an out-of-function static?
static JASMemPool<T> memPool_;
#if PLATFORM_GCN
static JASMemPool<T>& getMemPool_() {
static JASMemPool<T> memPool_;
return memPool_;
}
#endif
};
#if !PLATFORM_GCN
template <typename T> JASMemPool<T> JASPoolAllocObject<T>::memPool_;
#endif
/**
* @ingroup jsystem-jaudio
*
@@ -347,31 +363,43 @@ template <typename T>
class JASPoolAllocObject_MultiThreaded {
public:
static void* operator new(size_t n) {
#if PLATFORM_GCN
JASMemPool_MultiThreaded<T>& memPool_ = getMemPool();
return memPool_.alloc(sizeof(T));
#endif
return memPool_.alloc(n);
}
static void* operator new(size_t n, void* ptr) {
return ptr;
}
static void operator delete(void* ptr, size_t n) {
#if PLATFORM_GCN
JASMemPool_MultiThreaded<T>& memPool_ = getMemPool();
memPool_.free(ptr, sizeof(T));
#endif
memPool_.free(ptr, n);
}
static void newMemPool(int n) {
#if PLATFORM_GCN
JASMemPool_MultiThreaded<T>& memPool_ = getMemPool();
#endif
memPool_.newMemPool(n);
}
private:
// Fakematch? Is memPool_ both an in-function static and an out-of-function static?
static JASMemPool_MultiThreaded<T> memPool_;
#if PLATFORM_GCN
static JASMemPool_MultiThreaded<T>& getMemPool() {
static JASMemPool_MultiThreaded<T> memPool_;
return memPool_;
}
#endif
};
#if !PLATFORM_GCN
template <typename T> JASMemPool_MultiThreaded<T> JASPoolAllocObject_MultiThreaded<T>::memPool_;
#endif
extern JKRSolidHeap* JASDram;
#endif /* JASHEAPCTRL_H */
+5 -5
View File
@@ -38,7 +38,7 @@ struct JASOscillator {
/* 0x00 */ u32 mTarget;
/* 0x04 */ f32 _04;
/* 0x08 */ const Point* mTable;
/* 0x0C */ const Point* _0C;
/* 0x0C */ const Point* rel_table;
/* 0x10 */ f32 mScale;
/* 0x14 */ f32 _14;
};
@@ -64,10 +64,10 @@ struct JASOscillator {
void setDirectRelease(u16 param_0) { mDirectRelease = param_0; }
void stop() { _1C = 0; }
bool isValid() { return mData != NULL; }
bool isStop() { return _1C == 0; }
bool isRelease() { return _1C == 3 || _1C == 4; }
u32 getTarget() { return mData->mTarget; }
bool isValid() const { return mData != NULL; }
bool isStop() const { return _1C == 0; }
bool isRelease() const { return _1C == 3 || _1C == 4; }
u32 getTarget() const { return mData->mTarget; }
/* 0x00 */ const Data* mData;
/* 0x04 */ f32 _04;
+5
View File
@@ -1,6 +1,11 @@
#ifndef JASREPORT_H
#define JASREPORT_H
class JKRHeap;
void JASReportInit(JKRHeap*, int);
int JASReportGetLineMax();
int JASReportCopyBuffer(char *, int);
void JASReport(const char* message, ...);
#endif /* JASREPORT_H */
+24 -22
View File
@@ -9,37 +9,39 @@ namespace JASResArcLoader {
size_t getResMaxSize(JKRArchive const*);
static void loadResourceCallback(void*);
int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, u32), u32);
// from pikmin2
typedef void (*LoadCallback)(u32, u32);
struct TLoadResInfo {
inline TLoadResInfo(JKRArchive* archive, u16 id, void* buf, u32 size)
: mArchive(archive)
, mID(id)
, mBuffer(buf)
, mBufferSize(size)
, mCallback(0)
, mCallbackArg(0)
, mQueue(0)
{
}
JKRArchive* mArchive; // _00
u16 mID; // _04
void* mBuffer; // _08
u32 mBufferSize; // _0C
LoadCallback mCallback; // _10
u32 mCallbackArg; // _14, arg to pass to mCallback along with readResource result
OSMessageQueue* mQueue; // _18
};
};
class JKRArchive;
// from pikmin2
typedef void (*LoadCallback)(u32, u32);
enum ResArcMessage {
RESARCMSG_Error = -1,
RESARCMSG_Success = 0,
};
struct CallbackArgs {
inline CallbackArgs(u16 id, u8* buf, u32 size, JKRArchive* archive)
: mArchive(archive)
, mID(id)
, mBuffer(buf)
, mBufferSize(size)
, mCallback(0)
, mCallbackArg(0)
, mQueue(0)
{
}
JKRArchive* mArchive; // _00
u16 mID; // _04
u8* mBuffer; // _08
u32 mBufferSize; // _0C
LoadCallback mCallback; // _10
u32 mCallbackArg; // _14, arg to pass to mCallback along with readResource result
OSMessageQueue* mQueue; // _18
};
#endif /* JASRESARCLOADER_H */
+2 -1
View File
@@ -9,6 +9,7 @@
*/
class JASSeqReader {
public:
JASSeqReader() { init(); }
void init();
void init(void*);
bool call(u32);
@@ -25,7 +26,7 @@ public:
field_0x04 = (u8*)param_1;
}
u32 get24(int param_0) const {
u32 get24(u32 param_0) const {
return (*(u32*)(field_0x00 + param_0 - 1)) & 0xffffff;
}
+30 -5
View File
@@ -22,10 +22,14 @@ namespace JASDsp {
*
*/
struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
static const int CHANNEL_MGR_MAX = 4;
static const int TIMED_PARAMS = 6;
static const int OSC_NUM = 2;
enum Status {
STATUS_FREE,
STATUS_RUN,
STATUS_STOP,
STATUS_STOPPED,
};
struct TChannelMgr : public JASPoolAllocObject_MultiThreaded<TChannelMgr> {
@@ -82,6 +86,11 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
void closeChild(u32);
JASTrack* openChild(u32);
void connectBus(int, int);
f32 getVolume() const;
f32 getPitch() const;
f32 getPan() const;
f32 getFxmix() const;
f32 getDolby() const;
void setLatestKey(u8);
JASChannel* channelStart(JASTrack::TChannelMgr*, u32, u32, u32);
int noteOn(u32, u32, u32);
@@ -115,6 +124,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
void setTimebase(u16);
void updateChannel(JASChannel*, JASDsp::TChannel*);
JASTrack* getRootTrack();
int getChannelCount() const;
int tickProc();
int seqMain();
@@ -181,6 +191,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
/* 0x000 */ JASSeqCtrl mSeqCtrl;
/* 0x05C */ JASTrackPort mTrackPort;
/* 0x080 */ JASRegisterParam mRegisterParam;
#ifdef __MWERKS__
/* 0x09C */ union {
struct {
MoveParam_ volume;
@@ -190,15 +201,29 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
MoveParam_ dolby;
MoveParam_ distFilter;
} params;
MoveParam_ array[6];
MoveParam_ array[TIMED_PARAMS];
} mMoveParam;
/* 0x0e4 */ JASOscillator::Data mOscParam[2];
#else
/* 0x09C */ union MoveParam_u {
struct {
MoveParam_ volume;
MoveParam_ pitch;
MoveParam_ fxmix;
MoveParam_ pan;
MoveParam_ dolby;
MoveParam_ distFilter;
} params;
MoveParam_ array[TIMED_PARAMS];
MoveParam_u() {}
} mMoveParam;
#endif
/* 0x0e4 */ JASOscillator::Data mOscParam[OSC_NUM];
/* 0x114 */ JASOscillator::Point mOscPoint[4];
/* 0x12C */ JASTrack* mParent;
/* 0x130 */ JASTrack* mChildren[MAX_CHILDREN];
/* 0x170 */ TChannelMgr* mChannelMgrs[4];
/* 0x170 */ TChannelMgr* mChannelMgrs[CHANNEL_MGR_MAX];
/* 0x180 */ TChannelMgr mDefaultChannelMgr;
/* 0x1D0 */ int mChannelMgrCount;
/* 0x1D0 */ u32 mChannelMgrCount;
/* 0x1D4 */ const JASDefaultBankTable* mBankTable;
/* 0x1D8 */ f32 field_0x1d8;
/* 0x1DC */ f32 field_0x1dc;
+3 -1
View File
@@ -9,6 +9,8 @@
*/
class JASTrackPort {
public:
static const int MAX_PORTS = 16;
void init();
u16 readImport(u32);
u16 readExport(u32);
@@ -22,7 +24,7 @@ public:
u16 field_0x0;
u16 field_0x2;
u16 field_0x4[16];
u16 field_0x4[MAX_PORTS];
};
#endif /* JASTRACKPORT_H */
+1 -1
View File
@@ -17,7 +17,7 @@ public:
template<class T>
class TOffset {
public:
T* ptr(void const* param_0) {
T* ptr(void const* param_0) const {
return JSUConvertOffsetToPtr<T>(param_0, mOffset);
}
@@ -31,4 +31,23 @@ public:
/* 0x0C */ JAUSection* mSection;
};
class JAUAudioArcLoader_withoutCopy : public JAUAudioArcInterpreter {
virtual void readWS(u32, void const*, u32);
virtual void readBNK(u32, void const*);
virtual void readBSC(void const*, u32);
virtual void readBST(void const*, u32);
virtual void readBSTN(void const*, u32);
virtual void readBMS(u32, void const*, u32);
virtual void readBMS_fromArchive(u32);
virtual void newVoiceBank(u32, u32);
virtual void newDynamicSeqBlock(u32);
virtual void readBSFT(void const*);
virtual void beginBNKList(u32, u32);
virtual void endBNKList();
virtual void readMaxSeCategory(int, int, int);
virtual ~JAUAudioArcLoader_withoutCopy() {}
/* 0x0C */ JAUSection* mSection;
};
#endif /* JAUAUDIOARCLOADER_H */
+9 -3
View File
@@ -4,7 +4,7 @@
#include "JSystem/JAudio2/JAUBankTable.h"
#include "JSystem/JAudio2/JAUSeqDataBlockMgr.h"
#include "JSystem/JKernel/JKRDisposer.h"
#include "bitset.h"
#include <bitset>
class JAISeqData;
class JAISeqDataMgr;
@@ -64,7 +64,12 @@ public:
bool isBuilding() const { return field_0x2c; }
bool isOpen() const;
JAUSectionHeap* asSectionHeap() { return (JAUSection*)sectionHeap_ == this ? sectionHeap_ : NULL; }
JAUSectionHeap* asSectionHeap() {
if ((JAUSection*)sectionHeap_ == this) {
return sectionHeap_;
}
return NULL;
}
const TSectionData& getSectionData() const { return data_; }
JKRHeap* getHeap_();
@@ -99,6 +104,7 @@ public:
u32 releaseIdleDynamicSeqDataBlock();
JAUSectionHeap(JKRSolidHeap*, bool, s32);
JAUSection* getOpenSection();
JAUSection* getSection(int);
bool setSeqDataUser(JAISeqDataUser*);
bool newDynamicSeqBlock(u32);
SeqDataReturnValue getSeqData(JAISoundID, JAISeqData*);
@@ -123,7 +129,7 @@ public:
};
inline JKRHeap* JAUSection::getHeap_() { return sectionHeap_->mHeap; }
inline bool JAUSection::isOpen() const { return this == sectionHeap_->getOpenSection(); }
inline bool JAUSection::isOpen() const { return sectionHeap_->getOpenSection() == this; }
JAUSectionHeap* JAUNewSectionHeap(bool);
+2 -1
View File
@@ -29,7 +29,7 @@ public:
bool getSeqData(int, int, JAISeqData*);
bool getSeqDataRegion(JAISeqDataRegion*);
bool isValid() { return field_0x8; }
bool isValid() const { return field_0x8; }
/* 0x00 */ u16 field_0x0;
/* 0x04 */ const u32* field_0x4;
@@ -50,6 +50,7 @@ public:
~JAUSeqDataMgr_SeqCollection();
const void* getResource() const { return field_0x4; }
void init(const void* param_1) { JAUSeqCollection::init(param_1); }
/* 0x14 */ JAISeqDataUser* user_;
};
+1 -1
View File
@@ -17,7 +17,7 @@ struct JAUSeqDataBlock {
/* 0x00 */ JSULink<JAUSeqDataBlock> field_0x0;
/* 0x10 */ JAISoundID field_0x10;
/* 0x14 */ JAISeqDataRegion field_0x14;
/* 0x14 */ JAISeqDataRegion region;
/* 0x1C */ int field_0x1c;
};
+2 -2
View File
@@ -5,8 +5,8 @@
#include "JSystem/JAudio2/JASAramStream.h"
#include "JSystem/JAudio2/JASHeapCtrl.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "bitset.h"
#include <stdint.h>
#include <bitset>
#include <stdint>
/**
* @ingroup jsystem-jaudio
+3 -3
View File
@@ -4,8 +4,8 @@
#include "JSystem/JAudio2/JAIStreamDataMgr.h"
struct BinaryStreamFileTable {
/* 0x0 */ char mIdentifier[4];
/* 0x4 */ int mNumFiles;
/* 0x0 */ u8 mIdentifier[4];
/* 0x4 */ u32 mNumFiles;
/* 0x8 */ int mFilePathOffsets[];
};
@@ -16,7 +16,7 @@ struct BinaryStreamFileTable {
struct JAUStreamFileTable {
JAUStreamFileTable();
void init(void const*);
int getNumFiles() const;
u32 getNumFiles() const;
const char* getFilePath(int) const;
bool isValid() { return mData; }
+5 -15
View File
@@ -1,8 +1,7 @@
#ifndef BINARY_H
#define BINARY_H
#ifndef JGADGET_BINARY_H
#define JGADGET_BINARY_H
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/types.h"
#include "JSystem/JGadget/search.h"
namespace JGadget {
@@ -12,8 +11,7 @@ struct TEBit {
u32 value;
};
const void* parseVariableUInt_16_32_following(const void* pu16, u32* pu32First, u32* pu32Second,
TEBit* tebit);
const void* parseVariableUInt_16_32_following(const void* pu16, u32* pu32First, u32* pu32Second, TEBit* tebit);
inline bool isPower2(unsigned int arg0) {
return arg0 != 0 && (arg0 & arg0 - 1) == 0;
@@ -57,14 +55,6 @@ struct TParse_header_block {
bool parse(const void* ppData_inout, u32 a2) {
return parse_next(&ppData_inout, a2);
}
bool checkNext(const void** ptrLocation, u32* headerEnd, u32 idx) {
bool checkNext = false;
if (parseHeader_next(ptrLocation, headerEnd, idx)) {
checkNext = true;
}
return checkNext;
}
};
template <typename T>
@@ -92,7 +82,7 @@ struct TParseValue : public Parser {
}
static const void* advance(const void* data, s32 advanceNum) {
return (char*)data + (advanceNum * sizeof(Parser::ParseType));
return (char*)data + (advanceNum * sizeof(typename Parser::ParseType));
}
};
@@ -194,4 +184,4 @@ struct TValueIterator_misaligned : public TValueIterator<TParseValue_misaligned<
} // namespace binary
} // namespace JGadget
#endif /* BINARY_H */
#endif /* JGADGET_BINARY_H */
+7 -5
View File
@@ -1,7 +1,7 @@
#ifndef DEFINE_H
#define DEFINE_H
#ifndef JGADGET_DEFINE_H
#define JGADGET_DEFINE_H
#include "dolphin/types.h"
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
@@ -25,11 +25,13 @@ public:
JGadget_outMessage& operator<<(u32);
JGadget_outMessage& operator<<(const void*);
static const int BUFFER_SIZE = 256;
private:
MessageFunc mMsgFunc;
char mBuffer[256];
char mBuffer[BUFFER_SIZE];
char* mWrite_p;
char* mFile;
const char* mFile;
int mLine;
};
+10 -3
View File
@@ -4,7 +4,7 @@
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JGadget/define.h"
#include "JSystem/JGadget/search.h"
#include <iterator.h>
#include <iterator>
namespace JGadget {
@@ -234,7 +234,10 @@ struct TLinkList : TNodeLinkList {
const_iterator begin() const { return const_iterator(const_cast<TLinkList*>(this)->begin()); }
iterator end() { return iterator(TNodeLinkList::end()); }
const_iterator end() const { return const_iterator(const_cast<TLinkList*>(this)->end()); }
T& front() { return *begin(); }
T& front() {
JUT_ASSERT(642, !empty());
return *begin();
}
T& back() { JUT_ASSERT(652, !empty()); return *--end(); }
void pop_front() { erase(TNodeLinkList::begin()); }
void Push_front(T* element) { Insert(begin(), element); }
@@ -262,7 +265,7 @@ struct TLinkList_factory : public TLinkList<T, I> {
}
typename TLinkList<T, I>::iterator Erase_destroy(T* param_0) {
typename TLinkList<T, I>::iterator spC(Erase(param_0));
typename TLinkList<T, I>::iterator spC(this->Erase(param_0));
Do_destroy(param_0);
return spC;
}
@@ -270,7 +273,11 @@ struct TLinkList_factory : public TLinkList<T, I> {
template <typename T, int I>
TLinkList_factory<T, I>::~TLinkList_factory() {
#ifdef __MWERKS__
JGADGET_ASSERTWARN(934, empty());
#else
JGADGET_ASSERTWARN(934, this->empty());
#endif
}
template <typename T>
+49 -12
View File
@@ -1,15 +1,13 @@
#ifndef SEARCH_H
#define SEARCH_H
#ifndef JGADGET_SEARCH_H
#define JGADGET_SEARCH_H
#include "dolphin/os.h"
#include <iterator.h>
#include <functional.h>
#include <algorithm.h>
#include <dolphin/types.h>
#include <iterator>
#include <functional>
#include <algorithm>
namespace JGadget {
namespace search {
template <typename T>
struct TExpandStride_ {};
@@ -18,11 +16,29 @@ struct TExpandStride_<s32> {
static s32 get(s32 n) { return n << 3; }
};
struct TPR1IsEqual_string_ {
TPR1IsEqual_string_(const char* sz) {
string_ = sz;
}
bool operator()(const char* sz) const {
bool ret;
if (string_ == NULL) {
ret = sz == NULL;
} else {
ret = sz != NULL && strcmp(string_, sz) == 0;
}
return ret;
}
const char* string_;
};
} // namespace search
//! @todo: mangled name isn't correct, fix this
//! Current: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d
//! Target: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d_RCPFdd_d
const char* toStringFromIndex(int index, const char* const* pValue, u32 count, const char* fallback);
int toIndexFromString_linear(const char*, const char* const*, u32, int);
template <typename T>
inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& fallback) {
JUT_ASSERT(200, pValue!=NULL);
@@ -34,10 +50,31 @@ inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& f
}
}
template <typename T, typename Predicate>
inline int toIndexFromValue_linear_if(Predicate p, const T* pValue, u32 count, int fallback) {
JUT_ASSERT(212, pValue!=NULL);
const T* first = pValue;
const T* last = pValue + count;
const T* found = std::find_if(first, last, p);
if (found == last) {
return fallback;
}
return std::distance(first, found);
}
template <typename Category, typename T, typename Distance, typename Pointer, typename Reference>
struct TIterator : public std::iterator<Category, T, Distance, Pointer, Reference> {
};
template <typename Iterator>
struct TIterator_reverse : public std::reverse_iterator<Iterator> {
TIterator_reverse() {}
TIterator_reverse(Iterator it) : std::reverse_iterator<Iterator>(it) {}
};
template <typename Iterator, typename T, typename Predicate>
inline Iterator findUpperBound_binary_all(Iterator first, Iterator last, const T& val, Predicate p) {
return std::upper_bound(first, last, val, p);
@@ -124,4 +161,4 @@ inline Iterator findUpperBound_binary_current(Iterator first, Iterator last, Ite
} // namespace JGadget
#endif /* SEARCH_H */
#endif /* JGADGET_SEARCH_H */
+180
View File
@@ -0,0 +1,180 @@
#ifndef STD_LIST_H
#define STD_LIST_H
#include "JSystem/JGadget/define.h"
#include "JSystem/JGadget/search.h"
#include "JSystem/JGadget/std-memory.h"
namespace JGadget {
template <typename T, typename Allocator = JGadget::TAllocator<T> >
struct TList {
struct TNode_ {
/* 0x00 */ TNode_* pNext_;
/* 0x04 */ TNode_* pPrev_;
};
struct iterator : public TIterator<std::bidirectional_iterator_tag, T, s32, T*, T&> {
iterator() {p_ = NULL; }
iterator(TNode_* pNode) { p_ = pNode; }
iterator& operator++() { p_ = p_->pNext_; return *this; }
iterator& operator--() { p_ = p_->pPrev_; return *this; }
iterator operator++(int) { const iterator old(*this); (void)++*this; return old; }
iterator operator--(int) { const iterator old(*this); (void)--*this; return old; }
friend bool operator==(iterator a, iterator b) { return a.p_ == b.p_; }
friend bool operator!=(iterator a, iterator b) { return !(a == b); }
T& operator*() const {
JUT_ASSERT(125, p_!=NULL);
return *(T*)&p_[1];
}
/* 0x00 */ TNode_* p_;
};
struct const_iterator {
const_iterator(TNode_* pNode) { p_ = pNode; }
const_iterator& operator++() { p_ = p_->pNext_; return *this; }
const_iterator& operator--() { p_ = p_->pPrev_; return *this; }
friend bool operator==(const_iterator a, const_iterator b) { return a.p_ == b.p_; }
friend bool operator!=(const_iterator a, const_iterator b) { return !(a == b); }
/* 0x00 */ TNode_* p_;
};
TList(const Allocator& allocator = Allocator()) {
field_0x4 = 0;
Initialize_();
}
~TList() {
int r30;
int r29;
JGadget_outMessage* r28;
int r27;
Confirm();
clear();
r30 = 0;
r29 = 1;
if (empty()) {
return;
}
JGadget_outMessage out(JGadget_outMessage::warning, __FILE__, 229);
r30 = 1;
r28 = &out;
*r28 << "empty()";
r27 = 0;
if (!r27) {
r29 = 0;
}
}
iterator push_front(const T& element) { return insert(begin(), element); }
iterator push_back(const T& element) { return insert(end(), element); }
iterator insert(iterator it, const T& element) {
TNode_* p = it.p_;
JUT_ASSERT(286, p!=NULL);
TNode_* prev = p->pPrev_;
TNode_* node = CreateNode_(p, prev, element);
if (!node) {
return end();
}
p->pPrev_ = node;
prev->pNext_ = node;
field_0x4++;
return iterator(node);
}
iterator erase(iterator start, iterator end) {
while (start != end) {
start = erase(start);
}
return start;
}
iterator erase(iterator it) {
JUT_ASSERT(314, !empty());
TNode_* p = it.p_;
JUT_ASSERT(316, p!=NULL);
TNode_* next = p->pNext_;
p->pPrev_->pNext_ = next;
next->pPrev_ = p->pPrev_;
DestroyNode_(p);
field_0x4--;
return iterator(next);
}
void clear() { erase(begin(), end()); }
BOOL empty() const { return size() == 0; }
int size() const { return field_0x4; }
iterator begin() { return iterator(oEnd_.pNext_); }
iterator end() { return iterator(&oEnd_); }
const_iterator begin() const { return const_iterator(oEnd_.pNext_); }
const_iterator end() const { return const_iterator((TNode_*)&oEnd_); }
TIterator_reverse<iterator> rbegin() { return TIterator_reverse<iterator>(begin()); }
TIterator_reverse<iterator> rend() { return TIterator_reverse<iterator>(end()); }
void Initialize_() {
oEnd_.pNext_ = &oEnd_;
oEnd_.pPrev_ = &oEnd_;
}
BOOL Confirm() const {
u32 r28 = 0;
const_iterator local_24 = end();
if (local_24.p_ != &oEnd_) {
return FALSE;
}
const_iterator local_28 = begin();
if (local_28.p_ != oEnd_.pNext_) {
return FALSE;
}
for (; local_28 != local_24; ++local_28) {
TNode_* node = local_28.p_;
if (node->pNext_->pPrev_ != node) {
return FALSE;
}
if (node->pPrev_->pNext_ != node) {
return FALSE;
}
r28++;
}
if (local_28.p_ != &oEnd_) {
return FALSE;
}
if (r28 != size()) {
return FALSE;
}
return TRUE;
}
TNode_* CreateNode_(TNode_ *pNext, TNode_ *pPrev, const T& pObject) {
JUT_ASSERT(483, pNext!=NULL);
JUT_ASSERT(484, pPrev!=NULL);
TNode_* node = (TNode_*)mAllocator.AllocateRaw(sizeof(TNode_) + sizeof(T));
if (!node) {
JGADGET_WARNMSG(489, "can\'t allocate memory");
return NULL;
}
node->pNext_ = pNext;
node->pPrev_ = pPrev;
mAllocator.construct((T*)&node[1], pObject);
return node;
}
void DestroyNode_(TNode_* p) {
JUT_ASSERT(501, p!=NULL);
JUT_ASSERT(502, p!=&oEnd_);
JUT_ASSERT(503, p->pNext_->pPrev_!=p);
JUT_ASSERT(504, p->pPrev_->pNext_!=p);
mAllocator.destroy((T*)&p[1]);
mAllocator.DeallocateRaw((T*)p);
}
/* 0x00 */ Allocator mAllocator;
/* 0x04 */ int field_0x4;
/* 0x08 */ TNode_ oEnd_;
};
}
#endif /* STD_LIST_H */
+6
View File
@@ -22,7 +22,13 @@ struct TAllocator {
delete mem;
}
void construct(T* p, const T& other) {
JUT_ASSERT(67, p!=NULL);
new(p) T(other);
}
void destroy(T* p) {
(void)p;
JUT_ASSERT(68, p!=NULL);
}
+194
View File
@@ -0,0 +1,194 @@
#ifndef JGADGET_STD_STREAM_H
#define JGADGET_STD_STREAM_H
#include "JSystem/JGadget/std-streambuf.h"
#include "global.h"
namespace JGadget {
class TStream_base {
public:
TStream_base() {}
virtual ~TStream_base() = 0;
void setf(u32);
void setf(u32, u32);
void width(s32);
s32 precision() const {
return precision_;
}
s32 width() const {
return width_;
}
u32 flags() const {
return flags_;
}
void Init_() {
flags_ = skipws|dec;
width_ = 0;
precision_ = 6;
}
static const u32 skipws = 0x400000;
static const u32 dec = 0x1;
private:
/* 0x4 */ u32 flags_;
/* 0x8 */ s32 width_;
/* 0xC */ s32 precision_;
};
class TStream : public TStream_base {
public:
TStream();
virtual ~TStream() = 0;
void init(TStreamBuffer* psb);
bool fail() const;
bool good() const;
void setstate(u8 state);
void clear(u8 state);
TStreamBuffer* rdbuf() const;
void fill(char);
static char widen(char);
static char narrow(char, char);
char fill() const {
return fill_;
}
private:
/* 0x10 */ u8 state_;
/* 0x14 */ TStreamBuffer* rdbuf_;
/* 0x18 */ char fill_;
};
class TInputStream {
public:
struct sentry {
sentry(TInputStream& stream, bool);
operator bool() const { return _0x0; }
/* 0x0 */ bool _0x0;
};
int get();
TStream* _0x0;
virtual ~TInputStream();
private:
/* 0x08 */ int field_0x8;
};
class TOutputStream {
public:
struct sentry {
sentry(TOutputStream& stream) {
_0x0 = &stream;
_0x4 = stream._0x0->good();
if (!_0x4) {
stream._0x0->setstate(2);
}
}
~sentry() {
if (!_0x0->_0x0->fail() && (_0x0->_0x0->flags() & 2)) {
_0x0->flush();
}
}
operator bool() const { return _0x4; }
/* 0x0 */ TOutputStream* _0x0;
/* 0x4 */ bool _0x4;
};
struct TBufferIterator {
TBufferIterator(TStreamBuffer* psb) {
buffer_ = psb;
}
void operator=(char param_0) {
if (buffer_ != NULL && TTrait_char<char>::eq_int_type(buffer_->sputc(param_0), TTrait_char<char>::eof())) {
buffer_ = NULL;
}
}
TBufferIterator& operator*() {
return *this;
}
void operator++() {}
bool failed() const { return buffer_ == NULL; }
TStreamBuffer* buffer_;
};
TOutputStream& operator<<(const char*);
TOutputStream& operator<<(char);
TOutputStream& operator<<(s32);
TOutputStream& operator<<(u32);
TOutputStream& operator<<(bool);
TOutputStream& operator<<(double);
void flush();
TBufferIterator& Put_CString_prefixed_(const char*, u32, const char*, u32);
TBufferIterator& Put_longInt_(u32, bool);
TBufferIterator& Put(double);
TBufferIterator& Put(const char* param_0, u32 param_1) {
return Put_CString_prefixed_(param_0, param_1, NULL, 0);
}
TBufferIterator& Put(s32 param_0) {
return Put_longInt_(param_0, true);
}
TBufferIterator& Put(u32 param_0) {
return Put_longInt_(param_0, false);
}
TBufferIterator& Put(bool param_0) {
u32 flags = _0x0->flags();
const TCString_* s = &saaosz_bool_[!(flags & 8) ? 0 : 1][param_0 ? 1 : 0];
return Put_CString_prefixed_(s->sz, s->len, NULL, 0);
}
TStream* _0x0;
virtual ~TOutputStream();
struct TCString_ {
const char* sz;
u32 len;
};
struct saoCaseNumeral_struct {
const char _0[16];
TCString_ _1; // 0x10
TCString_ _2; // 0x18
TCString_ _3; // 0x20
};
static const saoCaseNumeral_struct saoCaseNumeral_[2];
static const TCString_ saoszPrefix_sign_[3];
static const TCString_ saaosz_bool_[2][2];
static const TCString_ soszPrefix_oct_;
static const saoCaseNumeral_struct& getCaseNumeral_(u32 flags) {
return saoCaseNumeral_[!(flags & 4) ? 0 : 1];
}
private:
/* 0x08 */ int field_0x8;
};
}
#endif /* JGADGET_STD_STREAM_H */
+76
View File
@@ -0,0 +1,76 @@
#ifndef JGADGET_STD_STREAMBUF_H
#define JGADGET_STD_STREAMBUF_H
#include <dolphin/types.h>
#include <string>
namespace JGadget {
template <typename T>
struct TTrait_char {};
template <>
struct TTrait_char<char> {
static int eof() { return -1; }
static int to_int_type(char value) { return (int)value; }
static char to_char_type(int value) { return (char)value; }
static bool eq_int_type(int a, int b) { return a == b; }
static size_t length(const char* sz) { return strlen(sz); }
};
class TStreamBuffer {
public:
TStreamBuffer() {
pBase_get_ = NULL;
pEnd_get_ = NULL;
pCurrent_get_ = NULL;
pBase_put_ = NULL;
pEnd_put_ = NULL;
pCurrent_put_ = NULL;
}
virtual ~TStreamBuffer() = 0;
int sputc(char param_0) {
if (pCurrent_put_ < pEnd_put_) {
*pCurrent_put_ = param_0;
pCurrent_put_++;
return TTrait_char<char>::to_int_type(param_0);
} else {
return overflow(TTrait_char<char>::to_int_type(param_0));
}
}
int sgetc();
int sbumpc() {
if (pCurrent_get_ < pEnd_get_) {
int var_r29 = TTrait_char<char>::to_int_type(*pCurrent_get_);
pCurrent_get_++;
return var_r29;
}
return uflow();
}
int snextc() {
int var_r31 = TTrait_char<char>::eof();
return TTrait_char<char>::eq_int_type(sbumpc(), var_r31) ? var_r31 : sgetc();
}
virtual void setbuf(char*, s32);
virtual s32 sync();
virtual int underflow();
virtual int uflow();
virtual s32 xsputn(const char*, s32);
virtual int overflow(int);
/* 0x04 */ char* pBase_get_;
/* 0x08 */ char* pEnd_get_;
/* 0x0C */ char* pCurrent_get_;
/* 0x10 */ char* pBase_put_;
/* 0x14 */ char* pEnd_put_;
/* 0x18 */ char* pCurrent_put_;
};
}
#endif /* JGADGET_STD_STREAMBUF_H */
+3 -3
View File
@@ -2,9 +2,9 @@
#define STD_VECTOR_H
#include "JSystem/JGadget/std-memory.h"
#include <algorithm.h>
#include <msl_memory.h>
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <stdint>
namespace JGadget {
namespace vector {
+20 -15
View File
@@ -2,9 +2,14 @@
#define JGEOMETRY_H
#include "dolphin/mtx.h"
#include "math.h"
#include <cmath>
#include "JSystem/JMath/JMath.h"
#ifndef __MWERKS__
#include <limits>
#define FLT_EPSILON std::numeric_limits<float>::epsilon()
#endif
namespace JGeometry {
template<typename T>
@@ -119,9 +124,9 @@ struct TVec3<s16> {
}
void set(s16 x_, s16 y_, s16 z_) {
x = x_;
y = y_;
z = z_;
x = (s16)x_;
y = (s16)y_;
z = (s16)z_;
}
};
@@ -175,17 +180,17 @@ inline void mulInternal(__REGISTER const f32* a, __REGISTER const f32* b, __REGI
template <>
struct TVec3<f32> : public Vec {
inline TVec3(const Vec& i_vec) {
TVec3(const Vec& i_vec) {
setTVec3f(&i_vec.x, &x);
}
inline TVec3(const TVec3<f32>& i_vec) {
TVec3(const TVec3<f32>& i_vec) {
setTVec3f(&i_vec.x, &x);
}
template<class U>
TVec3(U x, U y, U z) {
set(x, y, z);
set((U)x, (U)y, (U)z);
}
TVec3() {}
@@ -195,9 +200,9 @@ struct TVec3<f32> : public Vec {
template<class U>
void set(const TVec3<U>& other) {
x = other.x;
y = other.y;
z = other.z;
x = (U)other.x;
y = (U)other.y;
z = (U)other.z;
}
void set(const Vec& other) {
@@ -208,9 +213,9 @@ struct TVec3<f32> : public Vec {
template<class U>
void set(U x_, U y_, U z_) {
x = x_;
y = y_;
z = z_;
x = (U)x_;
y = (U)y_;
z = (U)z_;
}
inline void add(const TVec3<f32>& b) {
@@ -359,9 +364,9 @@ struct TVec3<f32> : public Vec {
}
void cross(const TVec3<f32>& a, const TVec3<f32>& b) {
VECCrossProduct(a, b, *this);
PSVECCrossProduct(&a, &b, this);
}
f32 setLength(f32 len) {
f32 sq = squared();
if (sq <= TUtil<f32>::epsilon()) {
+1
View File
@@ -2,6 +2,7 @@
#define JORENTRY_H
#include "JSystem/JHostIO/JHIComm.h"
#include "dolphin/os.h"
template<typename T, int I>
class JHIpvector {
+1 -1
View File
@@ -2,7 +2,7 @@
#define JORMCONTEXT_H
#include <dolphin/dolphin.h>
#include <stdint.h>
#include <stdint>
#include "JSystem/JHostIO/JORReflexible.h"
#include "JSystem/JSupport/JSUMemoryStream.h"
+6 -2
View File
@@ -28,7 +28,10 @@ struct JORPropertyEvent : JOREvent {
};
struct JORGenEvent : JOREvent {};
struct JORNodeEvent : JOREvent {};
struct JORNodeEvent : JOREvent {
/* 0x00 */ u32 field_0x0;
};
struct JORMContext;
struct JORServer;
@@ -36,6 +39,7 @@ struct JORServer;
class JOREventListener {
public:
#if DEBUG
JOREventListener() {}
virtual void listenPropertyEvent(const JORPropertyEvent*) = 0;
#endif
};
@@ -43,7 +47,7 @@ public:
class JORReflexible : public JOREventListener {
public:
#if DEBUG
JORReflexible();
JORReflexible() {}
static JORServer* getJORServer();
virtual void listenPropertyEvent(const JORPropertyEvent*);
+11 -2
View File
@@ -131,7 +131,7 @@ public:
/* 0x1107C */ CallbackLinkList m_eventCallbackList;
};
inline void JOR_MESSAGELOOP() {
inline u32 JOR_MESSAGELOOP() {
JORServer* server = JORServer::getInstance();
JHIComPortManager<JHICmnMem>::getInstance()->dispatchMessage();
if (server->getEvent()) {
@@ -160,7 +160,7 @@ inline void JOR_MESSAGELOOP() {
}
server->doneEvent();
}
JHIEventLoop();
return JHIEventLoop();
}
inline void JOR_INIT() {
@@ -174,8 +174,17 @@ inline void JOR_SETROOTNODE(const char* name, JORReflexible* node, u32 param_3,
inline JORMContext* attachJORMContext(u32 msgID) {
return JORServer::getInstance()->attachMCTX(msgID);
}
inline JORMContext* JORAttachMContext(u32 msgID) {
return JORServer::getInstance()->attachMCTX(msgID);
}
inline void releaseJORMContext(JORMContext* mctx) {
JORServer::getInstance()->releaseMCTX(mctx);
}
inline void JORReleaseMContext(JORMContext* mctx) {
JORServer::getInstance()->releaseMCTX(mctx);
}
#endif /* JORSERVER_H */
+4 -5
View File
@@ -50,14 +50,13 @@ public:
static JSUList<JKRAMCommand>& getCommandList() { return sAramCommandList; }
static u8 decideAramGroupId(int groupId) {
JKRAramHeap* heap;
u8 finalGroupId;
if (groupId < 0) {
return getAramHeap()->getCurrentGroupID();
finalGroupId = getAramHeap()->getCurrentGroupID();
} else {
finalGroupId = groupId;
}
return (u8)groupId;
return finalGroupId;
}
static u32 getSZSBufferSize() { return sSZSBufferSize; }
+3
View File
@@ -12,9 +12,12 @@ class JKRFile;
*/
class JKRAramArchive : public JKRArchive {
public:
JKRAramArchive();
JKRAramArchive(s32, JKRArchive::EMountDirection);
virtual ~JKRAramArchive();
void fixedInit(s32, JKRArchive::EMountDirection);
BOOL mountFixed(s32, JKRArchive::EMountDirection);
bool open(s32);
u32 getAramAddress_Entry(SDIFileEntry*);
u32 getAramAddress(char const*);
+1 -1
View File
@@ -34,7 +34,7 @@ public:
/* 0x18 */ u32 mSize;
/* 0x1C */ u32 mFreeSize;
/* 0x20 */ u8 mGroupId;
/* 0x21 */ u8 mIsTempMemory;
/* 0x21 */ bool mIsTempMemory;
/* 0x22 */ u8 padding[2];
};
-1
View File
@@ -17,7 +17,6 @@ public:
};
public:
// TODO: fix type
static JSUList<JKRAramBlock> sAramList;
JKRAramHeap(u32, u32);
+14 -6
View File
@@ -42,6 +42,16 @@ public:
/* 0x94 */ void* field_0x94;
};
struct JKRAramCommand {
s32 field_0x00;
void* command;
void setting(int param_1, void* param_2) {
field_0x00 = param_1;
command = param_2;
}
};
/**
* @ingroup jsystem-jkernel
*
@@ -52,12 +62,6 @@ public:
// TODO: fix type
static JSUList<JKRAMCommand> sAramPieceCommandList;
public:
struct Message {
s32 field_0x00;
JKRAMCommand* command;
};
public:
static JKRAMCommand* prepareCommand(int, u32, u32, u32, JKRAramBlock*,
JKRAMCommand::AsyncCallback);
@@ -74,6 +78,10 @@ private:
static void unlock() { OSUnlockMutex(&mMutex); }
};
inline void JKRAramPcs_SendCommand(JKRAMCommand* command) {
JKRAramPiece::sendCommand(command);
}
inline BOOL JKRAramPcs(int direction, u32 source, u32 destination, u32 length,
JKRAramBlock* block) {
return JKRAramPiece::orderSync(direction, source, destination, length, block);
+8
View File
@@ -77,8 +77,16 @@ inline JKRAramStreamCommand* JKRStreamToAram_Async(JSUFileInputStream *stream, u
return JKRAramStream::write_StreamToAram_Async(stream, addr, size, offset, returnSize);
}
inline JKRAramStreamCommand* JKRStreamToAram_Sync(JKRAramStreamCommand* command, BOOL isNonBlocking) {
return JKRAramStream::sync(command, isNonBlocking);
}
inline void JKRSetAramTransferBuffer(u8* buffer, u32 bufferSize, JKRHeap* heap) {
JKRAramStream::setTransBuffer(buffer, bufferSize, heap);
}
inline void JKRResetAramTransferBuffer() {
JKRAramStream::setTransBuffer(NULL, 0, NULL);
}
#endif /* JKRARAMSTREAM_H */
+8 -10
View File
@@ -131,7 +131,6 @@ protected:
JKRArchive(s32, EMountMode);
public:
virtual ~JKRArchive();
bool getDirEntry(SDirEntry*, u32) const;
void* getIdxResource(u32);
void* getResource(u16);
@@ -167,6 +166,7 @@ public:
/* vt[17] */ virtual void* fetchResource(void*, u32, SDIFileEntry*, u32*) = 0;
/* vt[18] */ virtual void setExpandSize(SDIFileEntry*, u32);
/* vt[19] */ virtual u32 getExpandSize(SDIFileEntry*) const;
virtual ~JKRArchive();
u32 countFile() const { return mArcInfoBlock->num_file_entries; }
s32 countDirectory() const { return mArcInfoBlock->num_nodes; }
@@ -186,7 +186,7 @@ public:
/* 0x48 */ SDIDirEntry* mNodes;
/* 0x4C */ SDIFileEntry* mFiles;
/* 0x50 */ s32* mExpandedSize;
/* 0x54 */ char* mStringTable;
/* 0x54 */ const char* mStringTable;
protected:
/* 0x58 */ u32 field_0x58;
@@ -200,29 +200,27 @@ public:
static JKRArchive* mount(s32, EMountMode, JKRHeap*, EMountDirection);
static void* getGlbResource(u32, const char*, JKRArchive*);
static JKRCompression convertAttrToCompressionType(u32 attr) {
static JKRCompression convertAttrToCompressionType(int attr) {
#define JKRARCHIVE_ATTR_COMPRESSION 0x04
#define JKRARCHIVE_ATTR_YAZ0 0x80
JKRCompression compression;
if (!(attr & JKRARCHIVE_ATTR_COMPRESSION)) {
compression = COMPRESSION_NONE;
return COMPRESSION_NONE;
} else if (attr & JKRARCHIVE_ATTR_YAZ0) {
compression = COMPRESSION_YAZ0;
return COMPRESSION_YAZ0;
} else {
compression = COMPRESSION_YAY0;
return COMPRESSION_YAY0;
}
return compression;
}
static u32 getCurrentDirID() { return sCurrentDirID; }
static void setCurrentDirID(u32 dirID) { sCurrentDirID = dirID; }
private:
protected:
static u32 sCurrentDirID;
};
inline JKRCompression JKRConvertAttrToCompressionType(u32 attr) {
inline JKRCompression JKRConvertAttrToCompressionType(int attr) {
return JKRArchive::convertAttrToCompressionType(attr);
}
+14 -12
View File
@@ -2,6 +2,7 @@
#define JKRASSERTHEAP_H
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
/**
* @ingroup jsystem-jkernel
@@ -18,18 +19,19 @@ public:
/* vt[06] */ virtual bool dump_sort(void); /* override */
/* vt[07] */ virtual bool dump(void); /* override */
/* vt[08] */ virtual void do_destroy(void); /* override */
/* vt[09] */ virtual void* do_alloc(u32, int); /* override */
/* vt[10] */ virtual void do_free(void*); /* override */
/* vt[11] */ virtual void do_freeAll(void); /* override */
/* vt[12] */ virtual void do_freeTail(void); /* override */
/* vt[13] */ virtual void do_fillFreeArea(void); /* override */
/* vt[14] */ virtual s32 do_resize(void*, u32); /* override */
/* vt[15] */ virtual s32 do_getSize(void*); /* override */
/* vt[16] */ virtual s32 do_getFreeSize(void); /* override */
/* vt[17] */ virtual void* do_getMaxFreeBlock(void); /* override */
/* vt[18] */ virtual s32 do_getTotalFreeSize(void); /* override */
/* vt[19] */ virtual s32 do_changeGroupID(u8 param_1); /* override */
/* vt[20] */ virtual u8 do_getCurrentGroupId(void); /* override */
/* vt[19] */ virtual s32 do_changeGroupID(u8) { JUT_ASSERT(41, 0&& "illegal changeGroupID()"); return 0; }
/* vt[20] */ virtual u8 do_getCurrentGroupId(void) { return 0; }
/* vt[09] */ virtual void* do_alloc(u32, int alignment) { UNUSED(alignment); JUT_ASSERT(47, 0&& "illegal alloc"); return NULL; }
/* vt[10] */ virtual void do_free(void*) { JUT_ASSERT(51, 0&& "illegal free"); }
/* vt[11] */ virtual void do_freeAll(void) { JUT_ASSERT(53, 0&& "illegal freeAll()"); }
/* vt[12] */ virtual void do_freeTail(void) { JUT_ASSERT(55, 0&& "illegal freeTail()"); }
/* vt[13] */ virtual void do_fillFreeArea(void) {}
/* vt[14] */ virtual s32 do_resize(void*, u32) { JUT_ASSERT(61, 0&& "illegal resize"); return 0; }
/* vt[15] */ virtual s32 do_getSize(void*) { return 0; }
/* vt[16] */ virtual s32 do_getFreeSize(void) { return 0; }
/* vt[17] */ virtual void* do_getMaxFreeBlock(void) { return 0; }
/* vt[18] */ virtual s32 do_getTotalFreeSize(void) { return 0; }
public:
static JKRAssertHeap* create(JKRHeap*);
+4
View File
@@ -82,4 +82,8 @@ inline u32 JKRDecompExpandSize(u8* pBuf) {
return (pBuf[4] << 0x18) | (pBuf[5] << 0x10) | (pBuf[6] << 8) | pBuf[7];
}
inline void JKRDecompress_SendCommand(JKRDecompCommand* command) {
JKRDecomp::sendCommand(command);
}
#endif /* JKRDECOMP_H */
@@ -50,6 +50,7 @@ public:
static JKRADCommand* callCommand_Async(JKRADCommand*);
static bool syncAram(JKRADCommand*, int);
static u32 getSZSBufferSize() { return sSZSBufferSize; }
static void setSZSBufferSize(u32 size) { sSZSBufferSize = size; }
static bool isErrorRetry() { return errorRetry; }
+1 -1
View File
@@ -28,7 +28,7 @@ public:
u32 getFileID() const { return mFileInfo.startAddr; }
DVDFileInfo* getFileInfo() { return &mFileInfo; }
int getStatus() { return DVDGetCommandBlockStatus(&mFileInfo.cb); }
int getStatus() const { return DVDGetCommandBlockStatus(&mFileInfo.cb); }
public:
/* vt[03] */ virtual bool open(const char*); /* override */
+10 -1
View File
@@ -35,6 +35,7 @@ class JKRDvdRipper {
public:
static JSUList<JKRDMCommand> sDvdAsyncList;
static u32 sSZSBufferSize;
static bool errorRetry;
enum EAllocDirection {
UNKNOWN_EALLOC_DIRECTION = 0,
@@ -51,12 +52,20 @@ public:
static void* loadToMainRAM(JKRDvdFile*, u8*, JKRExpandSwitch, u32, JKRHeap*, EAllocDirection,
u32, JKRCompression*, u32*);
static u8 isErrorRetry(void);
static bool isErrorRetry(void) { return errorRetry; }
inline static u32 getSZSBufferSize() { return sSZSBufferSize; }
};
// void JKRDecompressFromDVD(JKRDvdFile*, void*, u32, u32, u32, u32, u32*);
inline void* JKRDvdToMainRam(JKRDvdFile* file, u8* dst, JKRExpandSwitch expandSwitch, u32 dstLength,
JKRHeap* heap, JKRDvdRipper::EAllocDirection allocDirection,
u32 offset, JKRCompression* compression, u32* returnSize) {
return JKRDvdRipper::loadToMainRAM(file, dst, expandSwitch, dstLength, heap, allocDirection,
offset, compression, returnSize);
}
inline void* JKRDvdToMainRam(s32 entryNum, u8* dst, JKRExpandSwitch expandSwitch, u32 dstLength,
JKRHeap* heap, JKRDvdRipper::EAllocDirection allocDirection,
u32 offset, JKRCompression* compression, u32* returnSize) {
+9 -1
View File
@@ -2,7 +2,7 @@
#define JKREXPHEAP_H
#include "JSystem/JKernel/JKRHeap.h"
#include <stdint.h>
#include <stdint>
/**
* @ingroup jsystem-jkernel
@@ -63,6 +63,7 @@ protected:
void joinTwoBlocks(CMemBlock* block);
public:
BOOL isEmpty();
s32 getUsedSize(u8 groupId) const;
s32 getTotalUsedSize(void) const;
@@ -109,10 +110,17 @@ public:
static JKRExpHeap* createRoot(int maxHeaps, bool errorFlag);
static JKRExpHeap* create(u32 size, JKRHeap* parent, bool errorFlag);
static JKRExpHeap* create(void* ptr, u32 size, JKRHeap* parent, bool errorFlag);
static s32 getUsedSize_(JKRExpHeap* heap) { return heap->mSize - heap->getTotalFreeSize(); }
static void* getState_(TState* state) { return getState_buf_(state); }
};
inline JKRExpHeap* JKRCreateExpHeap(u32 size, JKRHeap* parent, bool errorFlag) {
return JKRExpHeap::create(size, parent, errorFlag);
}
inline void JKRDestroyExpHeap(JKRExpHeap* heap) {
heap->destroy();
}
#endif /* JKREXPHEAP_H */
+1 -1
View File
@@ -12,7 +12,7 @@ public:
JKRFile() : mIsAvailable(false) {}
virtual ~JKRFile() {}
s32 read(void*, s32, s32);
void read(void*, s32, s32);
bool isAvailable() const { return mIsAvailable; }
+2 -2
View File
@@ -14,8 +14,8 @@ public:
JKRFileLoader(void);
virtual ~JKRFileLoader();
bool isMounted() const { return this->mIsMounted; }
u32 getVolumeType() const { return this->mVolumeType; }
bool isMounted() { return this->mIsMounted; }
u32 getVolumeType() { return this->mVolumeType; }
public:
/* vt[03] */ virtual void unmount(void);

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