copy dolsdk2004 to tp / b_bh + e_mb done (#2299)

* move dolsdk2004 over

* cleanup some temp work

* finish and cleanup gf

* b_bh done

* d_a_e_mb done
This commit is contained in:
TakaRikka
2025-02-10 11:20:42 -08:00
committed by GitHub
parent a38e2bfeee
commit eda175afc8
540 changed files with 68042 additions and 22075 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JGeometry.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/gx/GXEnum.h"
#include <dolphin/gx.h>
#include "dolphin/mtx.h"
class J2DAnmBase;
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef J2DTEVS_H
#define J2DTEVS_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
#include "dolphin/mtx.h"
/**
@@ -3,6 +3,7 @@
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
#include "JSystem/JUtility/JUTNameTab.h"
#include "global.h"
struct JUTDataBlockHeader {
/* 0x0 */ u32 mType;
+2 -1
View File
@@ -1,6 +1,7 @@
#ifndef J3DGD_H
#define J3DGD_H
#include <dolphin/gx.h>
#include "dolphin/gd/GDBase.h"
inline void J3DGDWrite_u8(u8 param) {
@@ -116,7 +117,7 @@ inline void J3DGDSetNumTexGens(u8 numTexGens) {
J3DGDWriteXFCmd(0x103f, numTexGens);
}
inline void J3DGDSetTevKonstantSel_SwapModeTable(GXTevStageID stage, GXTevKColorSel colorSel1, GXTevKAlphaSel alphaSel1, GXTevKColorSel colorSel2, GXTevKAlphaSel alphaSel2, GXTevColor chan1, GXTevColor chan2) {
inline void J3DGDSetTevKonstantSel_SwapModeTable(GXTevStageID stage, GXTevKColorSel colorSel1, GXTevKAlphaSel alphaSel1, GXTevKColorSel colorSel2, GXTevKAlphaSel alphaSel2, GXTevColorChan chan1, GXTevColorChan chan2) {
J3DGDWriteBPCmd((stage / 2 + 0xf6) << 24 | (chan1 | chan2 << 2 | colorSel1 << 4 | alphaSel1 << 9 | colorSel2 << 14 | alphaSel2 << 19) & 0x00FFFFFF);
}
+2 -2
View File
@@ -16,13 +16,13 @@ public:
};
static inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) {
GXWGFifo.u8 = GX_CMD_LOAD_CP_REG;
GXWGFifo.u8 = GX_LOAD_CP_REG;
GXWGFifo.u8 = cmd;
GXWGFifo.u32 = param;
}
static inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) {
GXWGFifo.u8 = GX_CMD_LOAD_XF_REG;
GXWGFifo.u8 = GX_LOAD_XF_REG;
GXWGFifo.u16 = (len - 1);
GXWGFifo.u16 = cmd;
}
+2 -2
View File
@@ -1,9 +1,9 @@
#ifndef J3DSTRUCT_H
#define J3DSTRUCT_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
#include "dolphin/mtx.h"
#include "dolphin/mtx.h"
#include "dolphin/mtx/vec.h"
/**
* @ingroup jsystem-j3d
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef J3DSYS_H
#define J3DSYS_H
#include "dolphin/gx.h"
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
// Perhaps move to a new J3DEnum.h?
enum J3DError {
+1 -1
View File
@@ -2,7 +2,7 @@
#define J3DTEVS_H
#include "dolphin/types.h"
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
#include "JSystem/J3DGraphBase/J3DGD.h"
/**
+3 -3
View File
@@ -13,7 +13,7 @@ struct J3DTextureSRTInfo;
struct J3DTransformInfo {
/* 0x00 */ Vec mScale;
/* 0x0C */ SVec mRotation;
/* 0x0C */ S16Vec mRotation;
/* 0x14 */ Vec mTranslate;
/* inline J3DTransformInfo& operator=(const J3DTransformInfo& b) {
@@ -162,7 +162,7 @@ inline void J3DPSMulMtxVec(register MtxP mtx, register Vec* vec, register Vec* d
}
// regalloc issues
inline void J3DPSMulMtxVec(register MtxP mtx, register SVec* vec, register SVec* dst) {
inline void J3DPSMulMtxVec(register MtxP mtx, register S16Vec* vec, register S16Vec* dst) {
register f32 fr12;
register f32 fr11;
register f32 fr10;
@@ -252,7 +252,7 @@ inline void J3DPSMulMtxVec(register Mtx3P mtx, register Vec* vec, register Vec*
}
// regalloc issues
inline void J3DPSMulMtxVec(register Mtx3P mtx, register SVec* vec, register SVec* dst) {
inline void J3DPSMulMtxVec(register Mtx3P mtx, register S16Vec* vec, register S16Vec* dst) {
register f32* punit;
register f32 unit;
register f32 fr6;
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef J3DVERTEX_H
#define J3DVERTEX_H
#include "dolphin/gx/GXAttr.h"
#include "dolphin/mtx/vec.h"
#include <dolphin/gx.h>
#include "dolphin/mtx.h"
typedef struct _GXColor GXColor;
class J3DModel;
@@ -3,7 +3,7 @@
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
class J3DMaterial;
@@ -3,7 +3,7 @@
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
class J3DMaterial;
struct J3DTexCoord2Info;
@@ -2,7 +2,7 @@
#define J3DSHAPEFACTORY_H
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "dolphin/gx/GXAttr.h"
#include <dolphin/gx.h>
class J3DShape;
class J3DShapeMtx;
@@ -74,4 +74,4 @@ struct J3DShapeFactory {
};
#endif /* J3DSHAPEFACTORY_H */
#endif /* J3DSHAPEFACTORY_H */
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JAudio2/JASOscillator.h"
#include "JSystem/JAudio2/JASSoundParams.h"
#include "JSystem/JAudio2/JASWaveInfo.h"
#include "dolphin/os/OSMessage.h"
#include <dolphin/os.h>
class JASDSPChannel;
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JASCRITICALSECTION_H
#define JASCRITICALSECTION_H
#include "dolphin/os/OSInterrupt.h"
#include <dolphin/os.h>
/**
* @ingroup jsystem-jaudio
+2 -2
View File
@@ -3,8 +3,8 @@
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/os/OSInterrupt.h"
#include "dolphin/os/OSMutex.h"
#include <dolphin/os.h>
#include <dolphin/os.h>
class JASDisposer;
class JKRHeap;
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JASMUTEX_H
#define JASMUTEX_H
#include "dolphin/os/OSMutex.h"
#include <dolphin/os.h>
/**
* @ingroup jsystem-jaudio
+1 -1
View File
@@ -2,6 +2,7 @@
#define JASRESARCLOADER_H
#include "JSystem/JKernel/JKRArchive.h"
#include <dolphin/os.h>
namespace JASResArcLoader {
/* 80290BD0 */ size_t getResSize(JKRArchive const*, u16);
@@ -10,7 +11,6 @@ namespace JASResArcLoader {
/* 80290D18 */ int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, u32), u32);
};
typedef struct OSMessageQueue OSMessageQueue;
class JKRArchive;
// from pikmin2
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JAudio2/JASHeapCtrl.h"
#include "dol2asm.h"
#include "dolphin/os/OSMutex.h"
#include <dolphin/os.h>
class JKRHeap;
class JKRSolidHeap;
+1 -5
View File
@@ -1,11 +1,7 @@
#ifndef OSDSP_H
#define OSDSP_H
#include "dolphin/dsp.h"
struct STRUCT_DSP_TASK {
/* 0x00 */ DSPTaskInfo info;
};
#include <dolphin/dsp.h>
extern "C" DSPTaskInfo* DSPAddTask(DSPTaskInfo*);
void DSPAddPriorTask(STRUCT_DSP_TASK*);
+1 -3
View File
@@ -1,9 +1,7 @@
#ifndef OSDSP_TASK_H
#define OSDSP_TASK_H
#include "dolphin/dsp.h"
struct DSPTaskInfo;
#include <dolphin/dsp.h>
extern DSPTaskInfo* DSP_prior_task;
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "JSystem/JUtility/JUTFader.h"
#include "JSystem/JUtility/JUTXfb.h"
#include "dolphin/os/OSAlarm.h"
#include <dolphin/os.h>
typedef struct _GXColor GXColor;
typedef struct _GXRenderModeObj GXRenderModeObj;
+5 -5
View File
@@ -1,7 +1,7 @@
#ifndef JGEOMETRY_H
#define JGEOMETRY_H
#include "dolphin/mtx/vec.h"
#include "dolphin/mtx.h"
#include "math.h"
#include "JSystem/JMath/JMath.h"
@@ -175,7 +175,7 @@ struct TVec3<f32> : public Vec {
}
inline void add(const TVec3<f32>& b) {
C_VECAdd((Vec*)&x, (Vec*)&b.x, (Vec*)&x);
JMathInlineVEC::C_VECAdd((Vec*)&x, (Vec*)&b.x, (Vec*)&x);
}
void zero() { x = y = z = 0.0f; }
@@ -236,7 +236,7 @@ struct TVec3<f32> : public Vec {
// }
f32 squared() const {
return C_VECSquareMag((Vec*)&x);
return JMathInlineVEC::C_VECSquareMag((Vec*)&x);
}
void normalize() {
@@ -333,11 +333,11 @@ struct TVec3<f32> : public Vec {
}
void sub(const TVec3<f32>& b) {
C_VECSubtract((Vec*)&x, (Vec*)&b.x, (Vec*)&x);
JMathInlineVEC::C_VECSubtract((Vec*)&x, (Vec*)&b.x, (Vec*)&x);
}
void sub(const TVec3<f32>& a, const TVec3<f32>& b) {
C_VECSubtract((Vec*)&a.x, (Vec*)&b.x, (Vec*)&x);
JMathInlineVEC::C_VECSubtract((Vec*)&a.x, (Vec*)&b.x, (Vec*)&x);
}
bool isZero() const {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JKernel/JKRAramBlock.h"
#include "JSystem/JKernel/JKRDisposer.h"
#include "dolphin/os/OSMutex.h"
#include <dolphin/os.h>
/**
* @ingroup jsystem-jkernel
+3 -3
View File
@@ -2,9 +2,9 @@
#define JKRARAMPIECE_H
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/arq.h"
#include "dolphin/os/OSMessage.h"
#include "dolphin/os/OSMutex.h"
#include <dolphin/ar.h>
#include <dolphin/os.h>
#include <dolphin/os.h>
class JKRAramBlock;
class JKRDecompCommand;
+4 -4
View File
@@ -3,8 +3,8 @@
#include "JSystem/JKernel/JKRFile.h"
#include "dolphin/dvd.h"
#include "dolphin/os/OSMessage.h"
#include "dolphin/os/OSMutex.h"
#include <dolphin/os.h>
#include <dolphin/os.h>
struct OSThread;
@@ -26,9 +26,9 @@ public:
void initiate(void);
s32 sync(void);
u32 getFileID() const { return mFileInfo.start_address; }
u32 getFileID() const { return mFileInfo.startAddr; }
DVDFileInfo* getFileInfo() { return &mFileInfo; }
int getStatus() { return DVDGetCommandBlockStatus(&mFileInfo.block); }
int getStatus() { return DVDGetCommandBlockStatus(&mFileInfo.cb); }
public:
/* vt[03] */ virtual bool open(const char*); /* override */
+1 -1
View File
@@ -69,7 +69,7 @@ private:
/* 0x00 */ // JKRFileFinder_UnknownBase
/* 0x0C */ // vtable
/* 0x10 */ // JKRFileFinder
/* 0x14 */ DVDDirectory mDvdDirectory;
/* 0x14 */ DVDDir mDvdDirectory;
/* 0x20 */ bool mDvdIsOpen;
/* 0x21 */ u8 field_0x21[3];
};
+1 -1
View File
@@ -2,7 +2,7 @@
#define JKRHEAP_H
#include "JSystem/JKernel/JKRDisposer.h"
#include "dolphin/os/OSMutex.h"
#include <dolphin/os.h>
class JKRHeap;
typedef void (*JKRErrorHandler)(void*, u32, int);
+2 -2
View File
@@ -2,8 +2,8 @@
#define JKRTHREAD_H
#include "JSystem/JKernel/JKRHeap.h"
#include "dolphin/os/OSMessage.h"
#include "dolphin/os/OSTime.h"
#include <dolphin/os.h>
#include <dolphin/os.h>
/**
* @ingroup jsystem-jkernel
+59
View File
@@ -171,4 +171,63 @@ inline void gekko_ps_copy16(register void* dst, register const void* src) {
}; // namespace JMath
namespace JMathInlineVEC {
inline void C_VECAdd(register const Vec* a, register const Vec* b, register Vec* ab) {
register f32 axy;
register f32 bxy;
register f32 az;
register f32 sumz;
register f32 bz;
#ifdef __MWERKS__
asm {
psq_l axy, 0(a), 0, 0
psq_l bxy, 0(b), 0, 0
ps_add bxy, axy, bxy
psq_st bxy, 0(ab), 0, 0
psq_l az, 8(a), 1, 0
psq_l bz, 8(b), 1, 0
ps_add sumz, az, bz
psq_st sumz, 8(ab), 1, 0
}
#endif
}
inline void C_VECSubtract(register const Vec* a, register const Vec* b, register Vec* ab) {
register f32 axy;
register f32 bxy;
register f32 az;
register f32 subz;
register f32 bz;
#ifdef __MWERKS__
asm {
psq_l axy, 0(a), 0, 0
psq_l bxy, 0(b), 0, 0
ps_sub bxy, axy, bxy
psq_st bxy, 0(ab), 0, 0
psq_l az, 8(a), 1, 0
psq_l bz, 8(b), 1, 0
ps_sub subz, az, bz
psq_st subz, 8(ab), 1, 0
}
#endif
}
inline f32 C_VECSquareMag(const Vec* v) {
register f32 x_y;
register f32 z;
register f32 res;
register const f32* src = &v->x;
#ifdef __MWERKS__
asm {
psq_l x_y, 0(src), 0, 0
ps_mul x_y, x_y, x_y
lfs z, 8(src)
ps_madd res, z, z, x_y
ps_sum0 res, res, x_y, x_y
}
#endif
return res;
}
};
#endif /* JMATH_H */
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JPABASESHAPE_H
#define JPABASESHAPE_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
class JPAEmitterWorkData;
class JPABaseParticle;
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JPACHILDSHAPE_H
#define JPACHILDSHAPE_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
class JPAEmitterWorkData;
class JPABaseParticle;
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JPAEMITTER_H
#define JPAEMITTER_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
#include "JSystem/JParticle/JPAResource.h"
#include "JSystem/JParticle/JPAList.h"
#include "JSystem/JParticle/JPARandom.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JPAPARTICLE_H
#define JPAPARTICLE_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
#include "JSystem/JGeometry.h"
class JKRHeap;
+1 -1
View File
@@ -2,7 +2,7 @@
#define JSGAMBIENTLIGHT_H
#include "JSystem/JStage/JSGObject.h"
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
namespace JStage {
+1 -1
View File
@@ -2,7 +2,7 @@
#define JSGFOG_H
#include "JSystem/JStage/JSGObject.h"
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
namespace JStage {
+1 -1
View File
@@ -2,7 +2,7 @@
#define JSGLIGHT_H
#include "JSystem/JStage/JSGObject.h"
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
namespace JStage {
enum TELight {
@@ -4,7 +4,8 @@
#include "JSystem/JStudio/JStudio/fvb.h"
#include "JSystem/JStudio/JStudio/stb.h"
#include "JSystem/JStudio/JStudio/ctb.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
namespace JStudio {
struct TObject;
+1
View File
@@ -2,6 +2,7 @@
#define JUTCACHEFONT_H
#include "JSystem/JUtility/JUTResFont.h"
#include "global.h"
class JKRAramBlock;
+9 -6
View File
@@ -4,8 +4,8 @@
#include "JSystem/JKernel/JKRThread.h"
#include "JSystem/JUtility/JUTGamePad.h"
#include "__va_arg.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/os/OSError.h"
#include <dolphin/gx.h>
#include <dolphin/os.h>
#include "global.h"
typedef struct _GXRenderModeObj GXRenderModeObj;
@@ -42,6 +42,9 @@ STATIC_ASSERT(sizeof(JUTExternalFB) == 0x14);
* @ingroup jsystem-jutility
*
*/
typedef void (*JUTExceptionUserCallback)(u16, OSContext*, u32, u32);
class JUTException : public JKRThread {
public:
enum EInfoPage {
@@ -87,8 +90,8 @@ public:
/* 802E21FC */ static void panic_f(char const*, int, char const*, ...);
/* 802E227C */ static void setFPException(u32);
/* 802E2578 */ static bool searchPartialModule(u32, u32*, u32*, u32*, u32*);
/* 802E3AEC */ static OSErrorHandler setPreUserCallback(OSErrorHandler);
/* 802E3AFC */ static OSErrorHandler setPostUserCallback(OSErrorHandler);
/* 802E3AEC */ static JUTExceptionUserCallback setPreUserCallback(JUTExceptionUserCallback);
/* 802E3AFC */ static JUTExceptionUserCallback setPostUserCallback(JUTExceptionUserCallback);
/* 802E3B0C */ static void appendMapFile(char const*);
/* 802E3BA0 */ static bool queryMapAddress(char*, u32, s32, u32*, u32*, char*, u32, bool, bool);
/* 802E3C90 */ static bool queryMapAddress_single(char*, u32, s32, u32*, u32*, char*, u32, bool,
@@ -120,8 +123,8 @@ private:
static JSUList<JUTException::JUTExMapFile> sMapFileList;
static OSMessage sMessageBuffer[1];
static JUTException* sErrorManager;
static OSErrorHandler sPreUserCallback;
static OSErrorHandler sPostUserCallback;
static JUTExceptionUserCallback sPreUserCallback;
static JUTExceptionUserCallback sPostUserCallback;
static void* sConsoleBuffer;
static u32 sConsoleBufferSize;
static JUTConsole* sConsole;
+1 -1
View File
@@ -110,7 +110,7 @@ public:
void stopMotor() { mRumble.stopMotor(mPortNum, false); }
void stopMotorHard() { mRumble.stopMotorHard(mPortNum); }
static s8 getPortStatus(u32 port) { return mPadStatus[port].error; }
static s8 getPortStatus(u32 port) { return mPadStatus[port].err; }
struct CButton {
CButton() { clear(); }
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JUTPALETTE_H
#define JUTPALETTE_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
enum JUTTransparency { UNK0, UNK1 };
+1 -1
View File
@@ -2,7 +2,7 @@
#define JUTPROCBAR_H
#include "JSystem/JUtility/TColor.h"
#include "dolphin/os/OSTime.h"
#include <dolphin/os.h>
class JKRHeap;
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef JUTTEXTURE_H
#define JUTTEXTURE_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
class JUTPalette;
+7 -7
View File
@@ -1,9 +1,9 @@
#ifndef JUTVIDEO_H
#define JUTVIDEO_H
#include "dolphin/gx/GXStruct.h"
#include "dolphin/os/OSMessage.h"
#include "dolphin/os/OSTime.h"
#include <dolphin/gx.h>
#include <dolphin/os.h>
#include <dolphin/os.h>
typedef u8 (*Pattern)[2];
@@ -30,14 +30,14 @@ public:
/* 802E5144 */ static void postRetraceProc(u32);
/* 802E50BC */ static void drawDoneCallback();
u16 getFbWidth() const { return mRenderObj->fb_width; }
u16 getEfbHeight() const { return mRenderObj->efb_height; }
u16 getFbWidth() const { return mRenderObj->fbWidth; }
u16 getEfbHeight() const { return mRenderObj->efbHeight; }
void getBounds(u16& width, u16& height) const {
width = (u16)getFbWidth();
height = (u16)getEfbHeight();
}
u16 getXfbHeight() const { return mRenderObj->xfb_height; }
u32 isAntiAliasing() const { return mRenderObj->antialiasing; }
u16 getXfbHeight() const { return mRenderObj->xfbHeight; }
u32 isAntiAliasing() const { return mRenderObj->aa; }
Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
u8* getVFilter() const { return mRenderObj->vfilter; }
OSMessageQueue* getMessageQueue() { return &mMessageQueue; }
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef TCOLOR_H
#define TCOLOR_H
#include "dolphin/gx/GXStruct.h"
#include <dolphin/gx.h>
namespace JUtility {
@@ -32,4 +32,4 @@ struct TColor : public GXColor {
};
} // namespace JUtility
#endif
#endif