mirror of
https://github.com/zeldaret/tp
synced 2026-08-11 03:26:25 -04:00
d_a_npc work
daBaseNpc_c::setBckAnm and J3DAnmTransform* daBaseNpc_c daBaseNpc_c::setBtpAnm daBaseNpc_c::attnSttsOn daBaseNpc_c::orderEvent daBaseNpc_c::setEnvTevColor daBaseNpc_c::setRoomNo daBaseNpc_c::checkEndAnm attempt CheckCreateHeap daNpcF_addIdx daNpcF_subIdx daNpcF_incIdx daNpcF_decIdx daNpcF_ActorMngr_c::initialize() daNpcF_ActorMngr_c::entry cleanup daNpcF_ActorMngr_c::entry daNpcF_ActorMngr_c::remove daNpcF_ActorMngr_c::getActorP daNpcF_MatAnm_c::calc attempt daNpcF_SPCurve_c::initialize minor fixes daNpcF_Path_c::initialize daNpcF_Path_c::setPathInfo daNpcF_Path_c::chkPassed daNpcF_Path_c::reverse daNpcF_Path_c::setNextIdx daNpcF_Path_c::getNextIdx daNpcF_Path_c::getBeforeIdx daNpcF_Path_c::getBeforePos daNpcF_Path_c::getNextPos daNpcT_MatAnm_c::initialize daNpcT_MatAnm_c::calc daNpcT_addIdx daNpcT_subIdx daNpcT_decIdx daNpcT_Path_c::hermite daNpcT_Path_c::initialize daNpcT_Path_c::setPathInfo attempt daNpcT_Path_c::setNextPathInfo daNpcT_Path_c::reverse daNpcT_Path_c::setNextIdx daNpcT_Path_c::getDstPos attempt daNpcT_DmgStagger_c::setParam Add FLOAT_LABEL where possible fopEn_enemy / fix e_wb move jasper's jsystem work over d_attention / d_demo / d_lib work remove asm clean up dolphin files / work on some rels (#212) * d_a_alldie / d_a_tboxSw / d_a_tag_gstart / d_a_tag_hstop * dolphin OS work / cleanup * dolphin GX work / cleanup * finish changing dolphin files to C * more files into C * match rest of MSL_C math functions * more dolphin files converted to C * remove asm * d_bg_w work * remove asm * d_a_alink work / kytag14 initial changes to d_a_e_yc checkpoint until virtual destructor issue is solved daNpcF_Lookat_c::adjustMoveDisAngle daBaseNpc_c::setMtx daBaseNpc_moveBgActor_c::daBaseNpc_moveBgActor_c() daNpcT_c::ctrlFaceMotion daNpcT_c::ctrlMsgAnm attempt daNpcT_c::initTalk daNpcF_clearMessageTmpBit daNpcF_getDistTableIdx daNpcF_offTmpBit daNpcF_onTmpBit daNpcF_chkTmpBit daNpcF_onEvtBit daNpcF_chkEvtBit daNpcF_c::getDistTableIdx daNpcF_chkPointInArea daNpcF_chkDoBtnEqSpeak daNpcF_getPlayerInfoFromPlayerList attempt daNpcF_pntVsLineSegmentLengthSquare2D daNpcF_c::chkPointInArea daNpcF_c::chkPointInArea daNpcF_c::getAttentionPos daNpcT_chkTmpBit daNpcT_offTmpBit daNpcT_onTmpBit daNpcT_chkEvtBit daNpcT_offEvtBit daNpcT_onEvtBit daNpcT_chkDoBtnIsSpeak daNpcT_getDistTableIdx daBaseNpc_acMngr_c::entry daNpcF_c::initTalk undo override
This commit is contained in:
@@ -3,10 +3,16 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
u32 ARInit(u32*, u32);
|
||||
u32 ARAlloc(u32);
|
||||
u32 ARGetSize(void);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* AR_H */
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*ARQCallback)(u32 request_address);
|
||||
|
||||
struct ARQRequest {
|
||||
ARQRequest* next;
|
||||
typedef struct ARQRequest {
|
||||
struct ARQRequest* next;
|
||||
u32 owner;
|
||||
u32 type;
|
||||
u32 priority;
|
||||
@@ -14,12 +18,14 @@ struct ARQRequest {
|
||||
u32 destination;
|
||||
u32 length;
|
||||
ARQCallback callback;
|
||||
};
|
||||
} ARQRequest;
|
||||
|
||||
extern "C" {
|
||||
void ARQInit(void);
|
||||
void ARQPostRequest(ARQRequest* task, u32 owner, u32 type, u32 priority, u32 source,
|
||||
u32 destination, u32 length, ARQCallback callback);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* ARQ_H */
|
||||
|
||||
@@ -3,4 +3,12 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
union FpscrUnion {
|
||||
f64 f;
|
||||
struct {
|
||||
u32 fpscr_pad;
|
||||
u32 fpscr;
|
||||
} u;
|
||||
};
|
||||
|
||||
#endif /* PPCARCH_H */
|
||||
|
||||
+52
-36
@@ -3,7 +3,9 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum DVDState {
|
||||
DVD_STATE_END = 0x0,
|
||||
@@ -19,38 +21,37 @@ typedef enum DVDState {
|
||||
DVD_STATE_RETRY = 0xb,
|
||||
DVD_STATE_FATAL_ERROR = -1,
|
||||
} DVDState;
|
||||
}
|
||||
|
||||
struct DVDDirectory {
|
||||
typedef struct DVDDirectory {
|
||||
u32 entry_number;
|
||||
u32 location;
|
||||
u32 next;
|
||||
};
|
||||
} DVDDirectory;
|
||||
|
||||
struct DVDDirectoryEntry {
|
||||
typedef struct DVDDirectoryEntry {
|
||||
u32 entry_number;
|
||||
BOOL is_directory;
|
||||
char* name;
|
||||
};
|
||||
} DVDDirectoryEntry;
|
||||
|
||||
struct DVDDiskID {
|
||||
char game_name[4];
|
||||
char company[2];
|
||||
u8 disk_number;
|
||||
u8 game_version;
|
||||
u8 is_streaming;
|
||||
u8 streaming_buffer_size;
|
||||
u8 padding[22];
|
||||
};
|
||||
typedef struct DVDDiskID {
|
||||
/* 0x00 */ char game_name[4];
|
||||
/* 0x04 */ char company[2];
|
||||
/* 0x06 */ u8 disk_number;
|
||||
/* 0x07 */ u8 game_version;
|
||||
/* 0x08 */ u8 is_streaming;
|
||||
/* 0x09 */ u8 streaming_buffer_size;
|
||||
/* 0x0A */ u8 padding[22];
|
||||
} DVDDiskID;
|
||||
|
||||
struct DVDFileInfo;
|
||||
struct DVDCommandBlock;
|
||||
typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block);
|
||||
typedef void (*DVDCallback)(s32 result, DVDFileInfo* info);
|
||||
typedef void (*DVDCBCallback)(s32 result, struct DVDCommandBlock* block);
|
||||
typedef void (*DVDCallback)(s32 result, struct DVDFileInfo* info);
|
||||
|
||||
struct DVDCommandBlock {
|
||||
DVDCommandBlock* next;
|
||||
DVDCommandBlock* prev;
|
||||
typedef struct DVDCommandBlock {
|
||||
struct DVDCommandBlock* next;
|
||||
struct DVDCommandBlock* prev;
|
||||
u32 command;
|
||||
s32 state;
|
||||
u32 offset;
|
||||
@@ -61,31 +62,46 @@ struct DVDCommandBlock {
|
||||
DVDDiskID* disk_id;
|
||||
DVDCBCallback callback;
|
||||
void* user_data;
|
||||
};
|
||||
} DVDCommandBlock;
|
||||
|
||||
struct DVDFileInfo {
|
||||
typedef struct DVDFileInfo {
|
||||
DVDCommandBlock block;
|
||||
u32 start_address;
|
||||
u32 length;
|
||||
DVDCallback callback;
|
||||
};
|
||||
} DVDFileInfo;
|
||||
|
||||
extern "C" {
|
||||
s32 DVDOpen(const char*, DVDFileInfo*);
|
||||
s32 DVDClose(DVDFileInfo*);
|
||||
s32 DVDReadPrio(DVDFileInfo*, void*, s32, s32, s32);
|
||||
typedef struct DVDDriveInfo {
|
||||
/* 0x00 */ u16 field_0x0;
|
||||
/* 0x02 */ u16 device_code;
|
||||
/* 0x04 */ u32 field_0x4;
|
||||
/* 0x08 */ u32 field_0x8;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
/* 0x10 */ u32 field_0x10;
|
||||
/* 0x14 */ u32 field_0x14;
|
||||
/* 0x18 */ u32 field_0x18;
|
||||
/* 0x1C */ u32 field_0x1c;
|
||||
} DVDDriveInfo;
|
||||
|
||||
void DVDInit(void);
|
||||
BOOL DVDOpen(const char* filename, DVDFileInfo* fileinfo);
|
||||
BOOL DVDClose(DVDFileInfo* fileinfo);
|
||||
BOOL DVDReadPrio(DVDFileInfo* fileinfo, void*, s32, s32, s32);
|
||||
DVDDiskID* DVDGetCurrentDiskID(void);
|
||||
s32 DVDFastOpen(long, DVDFileInfo*);
|
||||
int DVDGetCommandBlockStatus(DVDCommandBlock*);
|
||||
s32 DVDReadAsyncPrio(DVDFileInfo*, void*, long, long, DVDCallback, long);
|
||||
s32 DVDConvertPathToEntrynum(const char*);
|
||||
BOOL DVDFastOpen(long, DVDFileInfo* fileinfo);
|
||||
BOOL DVDGetCommandBlockStatus(DVDCommandBlock*);
|
||||
BOOL DVDReadAsyncPrio(DVDFileInfo* fileinfo, void*, long, long, DVDCallback, long);
|
||||
BOOL DVDConvertPathToEntrynum(const char*);
|
||||
DVDState DVDGetDriveStatus(void);
|
||||
s32 DVDCheckDisk(void);
|
||||
BOOL DVDCheckDisk(void);
|
||||
|
||||
BOOL DVDChangeDir(const char*);
|
||||
BOOL DVDCloseDir(DVDDirectory*);
|
||||
BOOL DVDOpenDir(const char*, DVDDirectory*);
|
||||
BOOL DVDReadDir(DVDDirectory*, DVDDirectoryEntry*);
|
||||
}
|
||||
BOOL DVDChangeDir(const char* dirname);
|
||||
BOOL DVDCloseDir(DVDDirectory* dir);
|
||||
BOOL DVDOpenDir(const char*, DVDDirectory* dir);
|
||||
BOOL DVDReadDir(DVDDirectory* dir, DVDDirectoryEntry* entry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* DVD_H */
|
||||
|
||||
@@ -3,12 +3,16 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct GDLObj {
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct GDLObj {
|
||||
/* 0x0 */ u8* start;
|
||||
/* 0x4 */ u32 length;
|
||||
/* 0x8 */ u8* ptr;
|
||||
/* 0xC */ u8* end;
|
||||
}; // Size: 0x10
|
||||
} GDLObj; // Size: 0x10
|
||||
|
||||
extern GDLObj* __GDCurrentDL;
|
||||
|
||||
@@ -20,11 +24,14 @@ inline u32 GDGetGDLObjOffset(GDLObj* obj) {
|
||||
return (u32)(obj->ptr - obj->start);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
void GDInitGDLObj(GDLObj*, u8*, u32);
|
||||
void GDFlushCurrToMem();
|
||||
void GDPadCurr32();
|
||||
}
|
||||
|
||||
typedef void (*GDOverflowCallback)(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GDBASE_H */
|
||||
|
||||
@@ -4,11 +4,16 @@
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDSetVtxDescv(GXVtxDescList*);
|
||||
void GDSetArray(GXAttr attr, const void* data, u8 stride);
|
||||
void GDSetArrayRaw(GXAttr attr, u32 data, u8 stride);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GDGEOMETRY_H */
|
||||
|
||||
+29
-218
@@ -1,235 +1,46 @@
|
||||
#ifndef GX_H_
|
||||
#define GX_H_
|
||||
|
||||
#include "dolphin/gx/GXInit.h"
|
||||
#include "dolphin/gx/GXAttr.h"
|
||||
#include "dolphin/gx/GXBump.h"
|
||||
#include "dolphin/gx/GXDisplayList.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
#include "dolphin/mtx/mtx44.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "global.h"
|
||||
#include "dolphin/gx/GXFifo.h"
|
||||
#include "dolphin/gx/GXFrameBuf.h"
|
||||
#include "dolphin/gx/GXGeometry.h"
|
||||
#include "dolphin/gx/GXLight.h"
|
||||
#include "dolphin/gx/GXMisc.h"
|
||||
#include "dolphin/gx/GXPerf.h"
|
||||
#include "dolphin/gx/GXPixel.h"
|
||||
#include "dolphin/gx/GXTev.h"
|
||||
#include "dolphin/gx/GXTexture.h"
|
||||
#include "dolphin/gx/GXTransform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GXVtxDescList {
|
||||
/* 0x0 */ GXAttr attr;
|
||||
/* 0x4 */ GXAttrType type;
|
||||
} GXVtxDescList; // Size: 0x08
|
||||
|
||||
typedef struct _GXVtxAttrFmtList {
|
||||
/* 0x00 */ GXAttr mAttrib;
|
||||
/* 0x04 */ GXCompCnt mCompCnt;
|
||||
/* 0x08 */ GXCompType mCompType;
|
||||
/* 0x0C */ u8 mCompShift;
|
||||
} GXVtxAttrFmtList; // Size: 0x10
|
||||
|
||||
typedef GXTexRegion (*GXTexRegionCallback)(void);
|
||||
typedef u32 (*GXTlutRegionCallback)(u32);
|
||||
|
||||
typedef struct _GXData {
|
||||
/* 0x000 */ u16 field_0x0;
|
||||
/* 0x002 */ u16 field_0x2;
|
||||
/* 0x004 */ u16 field_0x4;
|
||||
/* 0x006 */ u16 field_0x6;
|
||||
/* 0x008 */ u32 field_0x8;
|
||||
/* 0x00C */ u32 field_0xc;
|
||||
/* 0x010 */ u32 field_0x10;
|
||||
/* 0x014 */ GXAttrType field_0x14;
|
||||
/* 0x018 */ GXAttrType field_0x18;
|
||||
/* 0x01C */ GXCompCnt field_0x1c[8];
|
||||
/* 0x03C */ GXCompCnt field_0x3c[8];
|
||||
/* 0x05C */ u32 field_0x5c[8];
|
||||
/* 0x07C */ u32 field_0x7c;
|
||||
/* 0x080 */ u32 field_0x80;
|
||||
/* 0x084 */ u32 field_0x84;
|
||||
/* 0x088 */ u8 field_0x88[0xA8 - 0x88];
|
||||
/* 0x0A8 */ u32 field_0xa8[2];
|
||||
/* 0x0B0 */ u32 field_0xb0[2];
|
||||
/* 0x0B8 */ u32 field_0xb8[8]; // GX_MAX_TEXCOORD
|
||||
/* 0x0D8 */ u32 field_0xd8[8]; // GX_MAX_TEXCOORD
|
||||
/* 0x0F8 */ u32 field_0xf8;
|
||||
/* 0x0FC */ u32 field_0xfc;
|
||||
/* 0x100 */ u32 field_0x100[GX_MAX_TEVSTAGE / 2];
|
||||
/* 0x120 */ u32 field_0x120;
|
||||
/* 0x124 */ u32 field_0x124;
|
||||
/* 0x128 */ u8 field_0x128[0x130 - 0x128];
|
||||
/* 0x130 */ u32 field_0x130[GX_MAX_TEVSTAGE];
|
||||
/* 0x170 */ u32 field_0x170[GX_MAX_TEVSTAGE];
|
||||
/* 0x1B0 */ u32 field_0x1b0[GX_MAX_TEVSTAGE / 2];
|
||||
/* 0x1D0 */ u32 field_0x1d0;
|
||||
/* 0x1D4 */ u32 field_0x1d4;
|
||||
/* 0x1D8 */ u32 field_0x1d8;
|
||||
/* 0x1DC */ u32 field_0x1dc;
|
||||
/* 0x1E0 */ u32 field_0x1e0;
|
||||
/* 0x1E4 */ u32 field_0x1e4;
|
||||
/* 0x1E8 */ u32 field_0x1e8;
|
||||
/* 0x1EC */ u32 field_0x1ec;
|
||||
/* 0x1F0 */ u32 field_0x1f0;
|
||||
/* 0x1F4 */ u32 field_0x1f4;
|
||||
/* 0x1F8 */ u32 field_0x1f8;
|
||||
/* 0x1FC */ u32 field_0x1fc;
|
||||
/* 0x200 */ u8 field_0x200;
|
||||
/* 0x204 */ u32 field_0x204;
|
||||
/* 0x208 */ GXTexRegion field_0x208[8];
|
||||
/* 0x288 */ GXTexRegion field_0x288[8];
|
||||
/* 0x308 */ GXTexRegion field_0x308[8];
|
||||
/* 0x388 */ GXTlutRegion field_0x388[16];
|
||||
/* 0x488 */ GXTlutRegion field_0x488[4];
|
||||
/* 0x4C8 */ GXTexRegionCallback field_0x4c8;
|
||||
/* 0x4CC */ GXTlutRegionCallback field_0x4cc;
|
||||
/* 0x4D0 */ GXAttrType field_0x4d0;
|
||||
/* 0x4D4 */ u8 field_0x4d4;
|
||||
/* 0x4D5 */ u8 field_0x4d5;
|
||||
/* 0x4D8 */ GXProjectionType field_0x4d8;
|
||||
/* 0x4DC */ Mtx field_0x4dc;
|
||||
/* 0x50C */ f32 field_0x50c;
|
||||
/* 0x510 */ f32 field_0x510;
|
||||
/* 0x514 */ u32 field_0x514[8];
|
||||
/* 0x534 */ u32 field_0x534[8];
|
||||
/* 0x554 */ u32 field_0x554;
|
||||
/* 0x558 */ u32 field_0x558[8];
|
||||
/* 0x578 */ u8 field_0x578[0x594 - 0x578];
|
||||
/* 0x594 */ u32 field_0x594;
|
||||
/* 0x598 */ u32 field_0x598;
|
||||
/* 0x59C */ u32 field_0x59c;
|
||||
/* 0x5A0 */ u8 field_0x5a0[4];
|
||||
/* 0x5A4 */ u32 field_0x5a4;
|
||||
/* 0x5A8 */ u8 field_0x5a8;
|
||||
/* 0x5A9 */ u8 field_0x5a9;
|
||||
/* 0x5AA */ u8 field_0x5aa;
|
||||
/* 0x5AB */ u8 field_0x5ab;
|
||||
/* 0x5AC */ u32 field_0x5ac;
|
||||
} GXData; // Size: 0x5B0
|
||||
|
||||
STATIC_ASSERT(sizeof(GXData) == 0x5B0);
|
||||
|
||||
extern GXData* __GXData;
|
||||
|
||||
extern u32* __piReg;
|
||||
extern u16* __cpReg;
|
||||
// Pack value into bitfield
|
||||
// Pack value into bitfield
|
||||
#define GX_BITFIELD_SET(field, pos, size, value) (field) = __rlwimi((field), (value), 31 - (pos) - (size) + 1, (pos), (pos) + (size)-1)
|
||||
|
||||
#define GX_LOAD_BP_REG 0x61
|
||||
#define GX_NOP 0
|
||||
|
||||
f32 GXGetYScaleFactor(u16 efb_height, u16 xfb_height);
|
||||
u16 GXGetNumXfbLines(u32 efb_height, f32 y_scale);
|
||||
typedef union {
|
||||
u8 u8;
|
||||
u16 u16;
|
||||
u32 u32;
|
||||
u64 u64;
|
||||
s8 s8;
|
||||
s16 s16;
|
||||
s32 s32;
|
||||
s64 s64;
|
||||
f32 f32;
|
||||
f64 f64;
|
||||
} PPCWGPipe;
|
||||
|
||||
void GXBegin(GXPrimitive, GXVtxFmt, u16);
|
||||
void GXLoadTexObj(GXTexObj*, GXTexMapID);
|
||||
void GXInitTexObjLOD(GXTexObj*, GXTexFilter, GXTexFilter, f32, f32, f32, GXBool, GXBool,
|
||||
GXAnisotropy);
|
||||
void GXInitTexObj(GXTexObj*, void*, u16, u16, GXTexFmt, GXTexWrapMode, GXTexWrapMode, GXBool);
|
||||
void GXInitTlutObj(GXTlutObj*, void*, GXTlutFmt, u16);
|
||||
void GXLoadTlut(GXTlutObj*, u32);
|
||||
void GXInitTexObjCI(GXTexObj*, void*, u16, u16, GXCITexFmt, GXTexWrapMode, GXTexWrapMode, GXBool,
|
||||
u32);
|
||||
void GXSetNumChans(u8);
|
||||
void GXSetNumTevStages(u8);
|
||||
void GXSetNumTexGens(u8);
|
||||
void GXSetTevOrder(GXTevStageID, GXTexCoordID, GXTexMapID, GXChannelID);
|
||||
void GXSetChanCtrl(GXChannelID, GXBool, GXColorSrc, GXColorSrc, u32, GXDiffuseFn, GXAttnFn);
|
||||
void GXSetTevOp(GXTevStageID, GXTevMode);
|
||||
void GXSetTevColor(GXTevRegID, GXColor);
|
||||
void GXSetTevColorIn(GXTevStageID, GXTevColorArg, GXTevColorArg, GXTevColorArg, GXTevColorArg);
|
||||
void GXSetTevAlphaIn(GXTevStageID, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg);
|
||||
void GXSetTevColorOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, GXBool, GXTevRegID);
|
||||
void GXSetTevAlphaOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, GXBool, GXTevRegID);
|
||||
void GXSetTevIndirect(GXTevStageID, _GXIndTexStageID, GXIndTexFormat, GXIndTexBiasSel,
|
||||
GXIndTexMtxID, GXIndTexWrap, GXIndTexWrap, GXBool, GXBool, GXIndTexAlphaSel);
|
||||
void GXSetBlendMode(GXBlendMode, GXBlendFactor, GXBlendFactor, GXLogicOp);
|
||||
void GXSetVtxAttrFmt(GXVtxFmt, GXAttr, GXCompCnt, GXCompType, u32);
|
||||
void GXClearVtxDesc(void);
|
||||
void GXSetVtxDesc(GXAttr, GXAttrType);
|
||||
void GXSetArray(GXAttr, void*, u8);
|
||||
typedef void (*GXDrawDoneCallback)(void);
|
||||
void GXSetDrawDoneCallback(GXDrawDoneCallback);
|
||||
void GXDrawDone(void);
|
||||
void GXAbortFrame(void);
|
||||
void GXFlush(void);
|
||||
void GXSetCopyClear(GXColor, u32);
|
||||
void GXSetDispCopySrc(u16, u16, u16, u16);
|
||||
void GXSetDispCopyDst(u16, u16);
|
||||
u32 GXSetDispCopyYScale(f32);
|
||||
void GXSetCopyClamp(GXFBClamp);
|
||||
void GXSetDispCopyGamma(GXGamma);
|
||||
void GXCopyDisp(void*, GXBool);
|
||||
void GXSetPixelFmt(GXPixelFmt, GXZFmt16);
|
||||
|
||||
struct OSThread;
|
||||
OSThread* GXSetCurrentGXThread(void);
|
||||
OSThread* GXGetCurrentGXThread(void);
|
||||
|
||||
void GXCopyTex(void*, GXBool);
|
||||
void GXGetProjectionv(f32*);
|
||||
u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, GXBool is_mip_map, u8 max_lod);
|
||||
void GXGetViewportv(f32*);
|
||||
void GXInitLightColor(GXLightObj*, GXColor);
|
||||
void GXInitLightDir(GXLightObj*, f32, f32, f32);
|
||||
void GXInitLightDistAttn(GXLightObj*, f32, f32, GXDistAttnFn);
|
||||
void GXInitLightPos(GXLightObj*, f32, f32, f32);
|
||||
void GXInitLightSpot(GXLightObj*, f32, GXSpotFn);
|
||||
void GXInvalidateTexAll(void);
|
||||
void GXInitLightAttn(GXLightObj*, f32, f32, f32, f32, f32, f32);
|
||||
void GXLoadLightObjImm(GXLightObj*, GXLightID);
|
||||
void GXLoadPosMtxImm(Mtx, u32);
|
||||
void GXLoadNrmMtxImm(Mtx, u32);
|
||||
void GXLoadTexMtxImm(Mtx, u32, GXTexMtxType);
|
||||
void GXPixModeSync(void);
|
||||
void GXProject(f32, f32, f32, Mtx, f32*, f32*, f32*, f32*, f32*);
|
||||
void GXSetAlphaCompare(GXCompare, u8, GXAlphaOp, GXCompare, u8);
|
||||
void GXSetAlphaUpdate(GXBool);
|
||||
void GXSetChanAmbColor(GXChannelID, GXColor);
|
||||
void GXSetChanMatColor(GXChannelID, GXColor);
|
||||
void GXSetClipMode(GXClipMode);
|
||||
void GXSetCoPlanar(GXBool);
|
||||
void GXSetColorUpdate(GXBool);
|
||||
void GXSetCopyFilter(GXBool, u8[12][2], GXBool, u8[7]);
|
||||
void GXSetCullMode(GXCullMode);
|
||||
void GXSetCurrentMtx(u32);
|
||||
void GXSetDither(GXBool);
|
||||
void GXSetFog(GXFogType, f32, f32, f32, f32, GXColor);
|
||||
void GXSetFogRangeAdj(GXBool, u16, GXFogAdjTable*);
|
||||
void GXSetNumIndStages(u8);
|
||||
void GXSetProjection(Mtx44, GXProjectionType);
|
||||
void GXSetScissor(u32, u32, u32, u32);
|
||||
void GXSetTevColorS10(GXTevRegID, GXColorS10);
|
||||
void GXSetTevKAlphaSel(GXTevStageID, GXTevKAlphaSel);
|
||||
void GXSetTevSwapMode(GXTevStageID, GXTevSwapSel, GXTevSwapSel);
|
||||
void GXSetTevSwapModeTable(GXTevSwapSel, GXTevColor, GXTevColor, GXTevColor, GXTevColor);
|
||||
void GXSetTexCoordGen2(GXTexCoordID, GXTexGenType, GXTexGenSrc, u32, GXBool, u32);
|
||||
void GXSetTexCopyDst(u16, u16, GXTexFmt, GXBool);
|
||||
void GXSetTexCopySrc(u16, u16, u16, u16);
|
||||
void GXSetViewport(f32, f32, f32, f32, f32, f32);
|
||||
void GXSetZCompLoc(GXBool);
|
||||
void GXSetZMode(GXBool, GXCompare, GXBool);
|
||||
void GXSetZTexture(GXZTexOp, GXTexFmt, u32);
|
||||
void GXSetPointSize(u8, GXTexOffset);
|
||||
void GXSetLineWidth(u8, GXTexOffset);
|
||||
void GXSetTevDirect(GXTevStageID);
|
||||
void GXSetTevKColor(GXTevKColorID, GXColor);
|
||||
void GXSetTevKColorSel(GXTevStageID, GXTevKColorSel);
|
||||
void GXGetScissor(u32*, u32*, u32*, u32*);
|
||||
void GXSetIndTexMtx(GXIndTexMtxID, Mtx23, s8);
|
||||
void GXSetIndTexCoordScale(GXIndTexStageID, GXIndTexScale, GXIndTexScale);
|
||||
void GXSetIndTexOrder(GXIndTexStageID, GXTexCoordID, GXTexMapID);
|
||||
void GXEnableTexOffsets(GXTexCoordID, GXBool, GXBool);
|
||||
void GXSetDstAlpha(GXBool, u8);
|
||||
u32 GXGetFifoSize(GXFifoObj*);
|
||||
void* GXGetFifoBase(GXFifoObj*);
|
||||
GXFifoObj* GXInit(void*, u32);
|
||||
GXFifoObj* GXGetCPUFifo(void);
|
||||
void GXGetGPStatus(GXBool*, GXBool*, GXBool*, GXBool*, GXBool*);
|
||||
void GXReadXfRasMetric(u32*, u32*, u32*, u32*);
|
||||
void GXInitFifoBase(GXFifoObj*, void*, u32);
|
||||
void GXInitFifoPtrs(GXFifoObj*, void*, void*);
|
||||
void GXSaveCPUFifo(GXFifoObj*);
|
||||
void GXSetMisc(u32 opt, u32 val);
|
||||
void GXInitTexCacheRegion(GXTexRegion* region, GXBool, u32, GXTexCacheSize, u32, GXTexCacheSize);
|
||||
void GXPeekZ(u16 x, u16 y, u32* dst);
|
||||
void __GXSetDirtyState(void);
|
||||
void __GXSendFlushPrim(void);
|
||||
volatile PPCWGPipe GXFIFO : 0xCC008000;
|
||||
|
||||
#define GFX_FIFO(T) (*(volatile T*)0xCC008000)
|
||||
|
||||
|
||||
@@ -1,6 +1,39 @@
|
||||
#ifndef GXATTR_H
|
||||
#define GXATTR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GXVtxDescList {
|
||||
/* 0x0 */ GXAttr attr;
|
||||
/* 0x4 */ GXAttrType type;
|
||||
} GXVtxDescList; // Size: 0x08
|
||||
|
||||
typedef struct _GXVtxAttrFmtList {
|
||||
/* 0x00 */ GXAttr mAttrib;
|
||||
/* 0x04 */ GXCompCnt mCompCnt;
|
||||
/* 0x08 */ GXCompType mCompType;
|
||||
/* 0x0C */ u8 mCompShift;
|
||||
} GXVtxAttrFmtList; // Size: 0x10
|
||||
|
||||
void GXSetVtxDesc(GXAttr attr, GXAttrType type);
|
||||
void GXSetVtxDescv(GXVtxDescList* list);
|
||||
void __GXSetVCD(void);
|
||||
void __GXCalculateVLim(void);
|
||||
void GXClearVtxDesc(void);
|
||||
void GXSetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt cnt, GXCompType type, u32);
|
||||
void GXSetVtxAttrFmtv(GXVtxFmt fmt, GXVtxAttrFmtList* list);
|
||||
void __GXSetVAT(void);
|
||||
void GXSetArray(GXAttr attr, void* base, u8);
|
||||
void GXInvalidateVtxCache(void);
|
||||
void GXSetTexCoordGen2(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx, GXBool renormalize, u32 pt_mtx);
|
||||
void GXSetNumTexGens(u8 numTexGens);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXATTR_H */
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
#ifndef GXBUMP_H
|
||||
#define GXBUMP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetTevIndirect(GXTevStageID tevStage, GXIndTexStageID texStage, GXIndTexFormat texFmt,
|
||||
GXIndTexBiasSel biasSel, GXIndTexMtxID mtxID, GXIndTexWrap wrapS,
|
||||
GXIndTexWrap wrapT, u8 addPrev, u8 utcLod, GXIndTexAlphaSel alphaSel);
|
||||
void GXSetIndTexMtx(GXIndTexMtxID mtxID, f32 offset[6], s8 scale_exp);
|
||||
void GXSetIndTexCoordScale(GXIndTexStageID texStage, GXIndTexScale scaleS, GXIndTexScale scaleT);
|
||||
void GXSetIndTexOrder(GXIndTexStageID stage, GXTexCoordID coord, GXTexMapID map);
|
||||
void GXSetNumIndStages(u8 num);
|
||||
void GXSetTevDirect(GXTevStageID stage);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXBUMP_H */
|
||||
|
||||
@@ -3,10 +3,16 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXBeginDisplayList(void* list, u32 capacity);
|
||||
void GXEndDisplayList(void);
|
||||
void GXCallDisplayList(void* list, u32 nbytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXDISPLAYLIST_H */
|
||||
|
||||
@@ -20,12 +20,14 @@ typedef enum _GXCullMode {
|
||||
/* 0x3 */ GX_CULL_ALL
|
||||
} GXCullMode;
|
||||
|
||||
typedef enum _GXBool {
|
||||
typedef enum _GXBoolVal {
|
||||
/* 0x0 */ GX_FALSE,
|
||||
/* 0x1 */ GX_TRUE,
|
||||
/* 0x0 */ GX_DISABLE = 0,
|
||||
/* 0x1 */ GX_ENABLE
|
||||
} GXBool;
|
||||
} GXBoolVal;
|
||||
|
||||
typedef u8 GXBool;
|
||||
|
||||
typedef enum _GXTexMapID {
|
||||
/* 0x000 */ GX_TEXMAP0,
|
||||
@@ -429,11 +431,11 @@ typedef enum _GXAnisotropy {
|
||||
/* 0x3 */ GX_MAX_ANISOTROPY,
|
||||
} GXAnisotropy;
|
||||
|
||||
enum GXCITexFmt {
|
||||
typedef enum _GXCITexFmt {
|
||||
/* 0x8 */ GX_TF_C4 = 8,
|
||||
/* 0x8 */ GX_TF_C8,
|
||||
/* 0xA */ GX_TF_C14X2
|
||||
};
|
||||
} GXCITexFmt;
|
||||
|
||||
typedef enum _GXTexMtxType {
|
||||
/* 0x0 */ GX_MTX3x4,
|
||||
@@ -619,9 +621,11 @@ typedef enum _GXIndTexMtxID {
|
||||
/* 0x1 */ GX_ITM_0,
|
||||
/* 0x2 */ GX_ITM_1,
|
||||
/* 0x3 */ GX_ITM_2,
|
||||
/* 0x4 */ GX_ITM_3,
|
||||
/* 0x5 */ GX_ITM_S0 = 5,
|
||||
/* 0x6 */ GX_ITM_S1,
|
||||
/* 0x7 */ GX_ITM_S2,
|
||||
/* 0x8 */ GX_ITM_S3,
|
||||
/* 0x9 */ GX_ITM_T0 = 9,
|
||||
/* 0xA */ GX_ITM_T1,
|
||||
/* 0xB */ GX_ITM_T2,
|
||||
@@ -711,7 +715,7 @@ typedef enum _GXTexMtx {
|
||||
GX_TEXMTX8 = 30 + 8 * 3,
|
||||
GX_TEXMTX9 = 30 + 9 * 3,
|
||||
GX_IDENTITY = 60,
|
||||
};
|
||||
} GXTexMtx;
|
||||
|
||||
typedef enum _GXPTTexMtx {
|
||||
GX_PTTEXMTX0 = 64 + 0 * 3,
|
||||
@@ -735,7 +739,7 @@ typedef enum _GXPTTexMtx {
|
||||
GX_PTTEXMTX18 = 64 + 18 * 3,
|
||||
GX_PTTEXMTX19 = 64 + 19 * 3,
|
||||
GX_PTIDENTITY = 125,
|
||||
};
|
||||
} GXPTTexMtx;
|
||||
|
||||
typedef enum _GXFBClamp {
|
||||
/* 0x0 */ GX_CLAMP_NONE,
|
||||
@@ -776,4 +780,30 @@ typedef enum _GXClipMode {
|
||||
/* 0x1 */ GX_CLIP_DISABLE,
|
||||
} GXClipMode;
|
||||
|
||||
typedef enum _GXCopyMode {
|
||||
/* 0x0 */ GX_COPY_PROGRESSIVE,
|
||||
/* 0x1 */ GX_COPY_INTLC_EVEN,
|
||||
/* 0x2 */ GX_COPY_INTLC_ODD,
|
||||
} GXCopyMode;
|
||||
|
||||
typedef enum _GXAlphaReadMode {
|
||||
/* 0x0 */ GX_READ_00,
|
||||
/* 0x1 */ GX_READ_FF,
|
||||
/* 0x2 */ GX_READ_NONE,
|
||||
} GXAlphaReadMode;
|
||||
|
||||
typedef enum _GXTlutSize {
|
||||
/* 0x001 */ GX_TLUT_16 = 1,
|
||||
/* 0x002 */ GX_TLUT_32 = 2,
|
||||
/* 0x004 */ GX_TLUT_64 = 4,
|
||||
/* 0x008 */ GX_TLUT_128 = 8,
|
||||
/* 0x010 */ GX_TLUT_256 = 16,
|
||||
/* 0x020 */ GX_TLUT_512 = 32,
|
||||
/* 0x040 */ GX_TLUT_1K = 64,
|
||||
/* 0x080 */ GX_TLUT_2K = 128,
|
||||
/* 0x100 */ GX_TLUT_4K = 256,
|
||||
/* 0x200 */ GX_TLUT_8K = 512,
|
||||
/* 0x400 */ GX_TLUT_16K = 1024,
|
||||
} GXTlutSize;
|
||||
|
||||
#endif /* GXENUM_H */
|
||||
@@ -1,6 +1,38 @@
|
||||
#ifndef GXFIFO_H
|
||||
#define GXFIFO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXInitFifoBase(GXFifoObj* fifo, void* base, u32 size);
|
||||
void GXInitFifoPtrs(GXFifoObj* fifo, void* read_ptr, void* write_ptr);
|
||||
void GXSetCPUFifo(void);
|
||||
void GXSetGPFifo(void);
|
||||
void GXSaveCPUFifo(GXFifoObj* fifo);
|
||||
void __GXSaveCPUFifoAux(GXFifoObj* fifo);
|
||||
void GXGetGPStatus(GXBool* overhi, GXBool* underlo, GXBool* read_idle, GXBool* cmd_idle, GXBool* breakpoint);
|
||||
void* GXGetFifoBase(GXFifoObj* fifo);
|
||||
u32 GXGetFifoSize(GXFifoObj* fifo);
|
||||
void GXSetBreakPtCallback(void);
|
||||
void __GXFifoInit(void);
|
||||
void __GXFifoReadEnable(void);
|
||||
void __GXFifoReadDisable(void);
|
||||
void __GXFifoLink(u8);
|
||||
void __GXWriteFifoIntEnable(u8, u8);
|
||||
void __GXWriteFifoIntReset(u8, u8);
|
||||
void __GXCleanGPFifo(void);
|
||||
OSThread* GXSetCurrentGXThread(void);
|
||||
OSThread* GXGetCurrentGXThread(void);
|
||||
GXFifoObj* GXGetCPUFifo(void);
|
||||
u32 GXGetGPFifo(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXFIFO_H */
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
#ifndef GXFRAMEBUF_H
|
||||
#define GXFRAMEBUF_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetDispCopySrc(u16 left, u16 top, u16 width, u16 height);
|
||||
void GXSetTexCopySrc(u16 left, u16 top, u16 width, u16 height);
|
||||
void GXSetDispCopyDst(u16 width, u16 height);
|
||||
void GXSetTexCopyDst(u16 width, u16 height, GXTexFmt fmt, GXBool mipmap);
|
||||
void GXSetDispCopyFrame2Field(GXCopyMode mode);
|
||||
void GXSetCopyClamp(GXFBClamp clamp);
|
||||
u16 GXGetNumXfbLines(u32 efb_height, f32 y_scale);
|
||||
f32 GXGetYScaleFactor(u16 efb_height, u16 xfb_height);
|
||||
u32 GXSetDispCopyYScale(f32 y_scale);
|
||||
void GXSetCopyClear(GXColor color, u32 clear_z);
|
||||
void GXSetCopyFilter(GXBool antialias, u8 pattern[12][2], GXBool vf, u8 vfilter[7]);
|
||||
void GXSetDispCopyGamma(GXGamma gamma);
|
||||
void GXCopyDisp(void* dst, GXBool clear);
|
||||
void GXCopyTex(void* dst, GXBool clear);
|
||||
void GXClearBoundingBox(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXFRAMEBUF_H */
|
||||
|
||||
@@ -1,6 +1,25 @@
|
||||
#ifndef GXGEOMETRY_H
|
||||
#define GXGEOMETRY_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __GXSetDirtyState(void);
|
||||
void GXBegin(GXPrimitive type, GXVtxFmt fmt, u16 vert_num);
|
||||
void __GXSendFlushPrim(void);
|
||||
void GXSetLineWidth(u8 width, GXTexOffset offsets);
|
||||
void GXSetPointSize(u8 size, GXTexOffset offsets);
|
||||
void GXEnableTexOffsets(GXTexCoordID coord, GXBool line, GXBool point);
|
||||
void GXSetCullMode(GXCullMode mode);
|
||||
void GXSetCoPlanar(GXBool enable);
|
||||
void __GXSetGenMode(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXGEOMETRY_H */
|
||||
|
||||
+113
-1
@@ -1,6 +1,118 @@
|
||||
#ifndef GXINIT_H
|
||||
#define GXINIT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
#include "global.h"
|
||||
|
||||
typedef GXTexRegion (*GXTexRegionCallback)(GXTexObj* obj);
|
||||
typedef GXTlutRegion* (*GXTlutRegionCallback)(u32 name);
|
||||
|
||||
typedef struct _GXData {
|
||||
/* 0x000 */ u16 field_0x0;
|
||||
/* 0x002 */ u16 field_0x2;
|
||||
/* 0x004 */ u16 field_0x4;
|
||||
/* 0x006 */ u16 field_0x6;
|
||||
/* 0x008 */ u32 field_0x8;
|
||||
/* 0x00C */ u32 field_0xc;
|
||||
/* 0x010 */ u32 field_0x10;
|
||||
/* 0x014 */ u32 field_0x14;
|
||||
/* 0x018 */ GXAttrType field_0x18;
|
||||
/* 0x01C */ GXCompCnt field_0x1c[8];
|
||||
/* 0x03C */ GXCompCnt field_0x3c[8];
|
||||
/* 0x05C */ u32 field_0x5c[8];
|
||||
/* 0x07C */ u32 field_0x7c;
|
||||
/* 0x080 */ u32 field_0x80;
|
||||
/* 0x084 */ u32 field_0x84;
|
||||
/* 0x088 */ u8 field_0x88[0xA8 - 0x88];
|
||||
/* 0x0A8 */ GXColor ambColors[2];
|
||||
/* 0x0B0 */ GXColor matColors[2];
|
||||
/* 0x0B8 */ u32 field_0xb8[8]; // GX_MAX_TEXCOORD
|
||||
/* 0x0D8 */ u32 field_0xd8[8]; // GX_MAX_TEXCOORD
|
||||
/* 0x0F8 */ u32 field_0xf8;
|
||||
/* 0x0FC */ u32 field_0xfc;
|
||||
/* 0x100 */ u32 field_0x100[GX_MAX_TEVSTAGE / 2];
|
||||
/* 0x120 */ u32 field_0x120;
|
||||
/* 0x124 */ u32 field_0x124;
|
||||
/* 0x128 */ u32 field_0x128;
|
||||
/* 0x12C */ u32 field_0x12c;
|
||||
/* 0x130 */ u32 field_0x130[GX_MAX_TEVSTAGE];
|
||||
/* 0x170 */ u32 field_0x170[GX_MAX_TEVSTAGE];
|
||||
/* 0x1B0 */ u32 field_0x1b0[GX_MAX_TEVSTAGE / 2];
|
||||
/* 0x1D0 */ u32 field_0x1d0;
|
||||
/* 0x1D4 */ u32 field_0x1d4;
|
||||
/* 0x1D8 */ u32 field_0x1d8;
|
||||
/* 0x1DC */ u32 field_0x1dc;
|
||||
/* 0x1E0 */ u32 field_0x1e0;
|
||||
/* 0x1E4 */ u32 field_0x1e4;
|
||||
/* 0x1E8 */ u32 field_0x1e8;
|
||||
/* 0x1EC */ u32 field_0x1ec;
|
||||
/* 0x1F0 */ u32 field_0x1f0;
|
||||
/* 0x1F4 */ u32 field_0x1f4;
|
||||
/* 0x1F8 */ u32 field_0x1f8;
|
||||
/* 0x1FC */ u32 field_0x1fc;
|
||||
/* 0x200 */ u8 field_0x200;
|
||||
/* 0x204 */ u32 field_0x204;
|
||||
/* 0x208 */ GXTexRegion field_0x208[8];
|
||||
/* 0x288 */ GXTexRegion field_0x288[8];
|
||||
/* 0x308 */ GXTexRegion field_0x308[8];
|
||||
/* 0x388 */ GXTlutRegion field_0x388[16];
|
||||
/* 0x488 */ GXTlutRegion field_0x488[4];
|
||||
/* 0x4C8 */ GXTexRegionCallback field_0x4c8;
|
||||
/* 0x4CC */ GXTlutRegionCallback field_0x4cc;
|
||||
/* 0x4D0 */ GXAttrType field_0x4d0;
|
||||
/* 0x4D4 */ u8 field_0x4d4;
|
||||
/* 0x4D5 */ u8 field_0x4d5;
|
||||
/* 0x4D8 */ GXProjectionType field_0x4d8;
|
||||
/* 0x4DC */ Mtx field_0x4dc;
|
||||
/* 0x50C */ f32 field_0x50c;
|
||||
/* 0x510 */ f32 field_0x510;
|
||||
/* 0x514 */ u32 field_0x514[8];
|
||||
/* 0x534 */ u32 field_0x534[8];
|
||||
/* 0x554 */ u32 field_0x554;
|
||||
/* 0x558 */ u32 field_0x558[8];
|
||||
/* 0x578 */ u8 field_0x578[0x594 - 0x578];
|
||||
/* 0x594 */ u32 field_0x594;
|
||||
/* 0x598 */ u32 field_0x598;
|
||||
/* 0x59C */ u32 field_0x59c;
|
||||
/* 0x5A0 */ u8 field_0x5a0[4];
|
||||
/* 0x5A4 */ u32 field_0x5a4;
|
||||
/* 0x5A8 */ u8 field_0x5a8;
|
||||
/* 0x5A9 */ u8 field_0x5a9;
|
||||
/* 0x5AA */ u8 field_0x5aa;
|
||||
/* 0x5AB */ u8 field_0x5ab;
|
||||
/* 0x5AC */ u32 field_0x5ac;
|
||||
} GXData; // Size: 0x5B0
|
||||
|
||||
STATIC_ASSERT(sizeof(GXData) == 0x5B0);
|
||||
|
||||
extern GXData* __GXData;
|
||||
|
||||
extern u32* __piReg;
|
||||
extern u16* __cpReg;
|
||||
extern u8 __peReg[4];
|
||||
extern u8 __memReg[4];
|
||||
|
||||
inline void GXSetWasteFlags() {
|
||||
GXData* data = __GXData;
|
||||
data->field_0x5ac |= 0x3;
|
||||
data->field_0x2 = 0;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GXTexRegion* __GXDefaultTexRegionCallback(GXTexObj* obj, GXTexMapID mapID);
|
||||
GXTlutRegion* __GXDefaultTlutRegionCallback(u32 tlut);
|
||||
void __GXShutdown(s32);
|
||||
void __GXInitRevisionBits(void);
|
||||
GXFifoObj* GXInit(void* base, u32 size);
|
||||
void __GXInitGX(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXINIT_H */
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
#ifndef GXLIGHT_H
|
||||
#define GXLIGHT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXInitLightAttn(GXLightObj* obj, f32 a0, f32 a1, f32 a2, f32 k0, f32 k1, f32 k2);
|
||||
void GXInitLightSpot(GXLightObj* obj, f32 cutoff, GXSpotFn spot_fn);
|
||||
void GXInitLightDistAttn(GXLightObj* obj, f32 dist, f32 brightness, GXDistAttnFn dist_fn);
|
||||
void GXInitLightPos(GXLightObj* obj, f32 x, f32 y, f32 z);
|
||||
void GXInitLightDir(GXLightObj* obj, f32 x, f32 y, f32 z);
|
||||
void GXInitLightColor(GXLightObj* obj, GXColor color);
|
||||
void GXLoadLightObjImm(GXLightObj* obj, GXLightID light);
|
||||
void GXSetChanAmbColor(GXChannelID channel, GXColor color);
|
||||
void GXSetChanMatColor(GXChannelID channel, GXColor color);
|
||||
void GXSetNumChans(u8 chan_num);
|
||||
void GXSetChanCtrl(GXChannelID channel, GXBool enable, GXColorSrc amb_src, GXColorSrc mat_src, u32 light_mask, GXDiffuseFn diff_fn, GXAttnFn attn_fn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXLIGHT_H */
|
||||
|
||||
@@ -1,6 +1,38 @@
|
||||
#ifndef GXMISC_H
|
||||
#define GXMISC_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetMisc(u32 id, u32 value);
|
||||
void GXFlush(void);
|
||||
void __GXAbort(void);
|
||||
void GXAbortFrame(void);
|
||||
void GXSetDrawDone(void);
|
||||
void GXDrawDone(void);
|
||||
void GXPixModeSync(void);
|
||||
void GXPokeAlphaMode(GXCompare comp, u8 threshold);
|
||||
void GXPokeAlphaRead(GXAlphaReadMode mode);
|
||||
void GXPokeAlphaUpdate(GXBool enable_update);
|
||||
void GXPokeBlendMode(GXBlendMode mode, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp op);
|
||||
void GXPokeColorUpdate(GXBool enable_update);
|
||||
void GXPokeDstAlpha(GXBool enable, u8 alpha);
|
||||
void GXPokeDither(GXBool enable);
|
||||
void GXPokeZMode(GXBool enable_compare, GXCompare comp);
|
||||
void GXPeekZ(u16 x, u16 y, u32* z);
|
||||
|
||||
typedef void (*GXDrawSyncCallback)(u16 token);
|
||||
void GXSetDrawSyncCallback(GXDrawSyncCallback callback);
|
||||
|
||||
typedef void (*GXDrawDoneCallback)(void);
|
||||
void GXSetDrawDoneCallback(GXDrawDoneCallback callback);
|
||||
void __GXPEInit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXMISC_H */
|
||||
|
||||
@@ -3,4 +3,16 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetGPMetric(u32 perf0, u32 perf1);
|
||||
void GXClearGPMetric(void);
|
||||
void GXReadXfRasMetric(u32*, u32*, u32*, u32*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXPERF_H */
|
||||
|
||||
@@ -1,6 +1,28 @@
|
||||
#ifndef GXPIXEL_H
|
||||
#define GXPIXEL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, GXColor color);
|
||||
void GXSetFogRangeAdj(GXBool enable, u16 center, GXFogAdjTable* table);
|
||||
void GXSetBlendMode(GXBlendMode mode, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp op);
|
||||
void GXSetColorUpdate(GXBool enable_update);
|
||||
void GXSetAlphaUpdate(GXBool enable_update);
|
||||
void GXSetZMode(GXBool enable_compare, GXCompare comp, GXBool enable_update);
|
||||
void GXSetZCompLoc(GXBool z_buf_before_tex);
|
||||
void GXSetPixelFmt(GXPixelFmt pixel_fmt, GXZFmt16 z_fmt);
|
||||
void GXSetDither(GXBool enable_dither);
|
||||
void GXSetDstAlpha(GXBool enable, u8 alpha);
|
||||
void GXSetFieldMask(GXBool odd_mask, GXBool even_mask);
|
||||
void GXSetFieldMode(GXBool field_mode, GXBool half_aspect_ratio);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXPIXEL_H */
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef struct _GXRenderModeObj {
|
||||
/* 0x32 */ u8 vfilter[7];
|
||||
} GXRenderModeObj;
|
||||
|
||||
STATIC_ASSERT(sizeof(_GXRenderModeObj) == 60);
|
||||
STATIC_ASSERT(sizeof(GXRenderModeObj) == 60);
|
||||
|
||||
typedef struct _GXTexObj {
|
||||
/* 0x00 */ u32 texture_filter;
|
||||
@@ -56,7 +56,20 @@ typedef struct _GXTlutObj {
|
||||
} GXTlutObj;
|
||||
|
||||
typedef struct _GXLightObj {
|
||||
/* 0x0 */ u32 data[16];
|
||||
/* 0x00 */ u8 field_0x0[0xc];
|
||||
/* 0x0C */ GXColor color;
|
||||
/* 0x10 */ f32 a0;
|
||||
/* 0x14 */ f32 a1;
|
||||
/* 0x18 */ f32 a2;
|
||||
/* 0x1C */ f32 k0;
|
||||
/* 0x20 */ f32 k1;
|
||||
/* 0x24 */ f32 k2;
|
||||
/* 0x28 */ f32 posX;
|
||||
/* 0x2C */ f32 posY;
|
||||
/* 0x30 */ f32 posZ;
|
||||
/* 0x34 */ f32 dirX;
|
||||
/* 0x38 */ f32 dirY;
|
||||
/* 0x3C */ f32 dirZ;
|
||||
} GXLightObj;
|
||||
|
||||
typedef struct _GXFogAdjTable {
|
||||
|
||||
@@ -1,6 +1,37 @@
|
||||
#ifndef GXTEV_H
|
||||
#define GXTEV_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetTevOp(GXTevStageID id, GXTevMode mode);
|
||||
void GXSetTevColorIn(GXTevStageID stage, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c,
|
||||
GXTevColorArg d);
|
||||
void GXSetTevAlphaIn(GXTevStageID stage, GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c,
|
||||
GXTevAlphaArg d);
|
||||
void GXSetTevColorOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp,
|
||||
GXTevRegID out_reg);
|
||||
void GXSetTevAlphaOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp,
|
||||
GXTevRegID out_reg);
|
||||
void GXSetTevColor(GXTevRegID id, GXColor color);
|
||||
void GXSetTevColorS10(GXTevRegID id, GXColorS10 color);
|
||||
void GXSetTevKColor(GXTevKColorID id, GXColor color);
|
||||
void GXSetTevKColorSel(GXTevStageID stage, GXTevKColorSel color_sel);
|
||||
void GXSetTevKAlphaSel(GXTevStageID stage, GXTevKAlphaSel alpha_sel);
|
||||
void GXSetTevSwapMode(GXTevStageID stage, GXTevSwapSel ras_sel, GXTevSwapSel tex_sel);
|
||||
void GXSetTevSwapModeTable(GXTevSwapSel select, GXTevColor r, GXTevColor g, GXTevColor b,
|
||||
GXTevColor a);
|
||||
void GXSetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1);
|
||||
void GXSetZTexture(GXZTexOp op, GXTexFmt fmt, u32 bias);
|
||||
void GXSetTevOrder(GXTevStageID stage, GXTexCoordID coord, GXTexMapID map, GXChannelID color);
|
||||
void GXSetNumTevStages(u8 num_stages);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXTEV_H */
|
||||
|
||||
@@ -1,6 +1,49 @@
|
||||
#ifndef GXTEXTURE_H
|
||||
#define GXTEXTURE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/gx/GXInit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, GXBool mipmap, u8 max_lod);
|
||||
void __GetImageTileCount();
|
||||
void GXInitTexObj(GXTexObj* obj, void* image, u16 width, u16 height, GXTexFmt fmt,
|
||||
GXTexWrapMode wrapS, GXTexWrapMode wrapT, GXBool mipmap);
|
||||
void GXInitTexObjCI(GXTexObj* obj, void* image, u16 width, u16 height, GXCITexFmt format,
|
||||
GXTexWrapMode wrapS, GXTexWrapMode wrapT, GXBool mipmap, u32 tlut_name);
|
||||
void GXInitTexObjLOD(GXTexObj* obj, GXTexFilter min_filter, GXTexFilter max_filter, f32 min_lod,
|
||||
f32 max_lod, f32 lod_bias, GXBool bias_clamp, GXBool edge_lod,
|
||||
GXAnisotropy aniso);
|
||||
u16 GXGetTexObjWidth(GXTexObj* obj);
|
||||
u16 GXGetTexObjHeight(GXTexObj* obj);
|
||||
GXTexFmt GXGetTexObjFmt(GXTexObj* obj);
|
||||
GXTexWrapMode GXGetTexObjWrapS(GXTexObj* obj);
|
||||
GXTexWrapMode GXGetTexObjWrapT(GXTexObj* obj);
|
||||
GXBool GXGetTexObjMipMap(GXTexObj* obj);
|
||||
u32 GXGetTexObjTlut(GXTexObj* obj);
|
||||
void GXLoadTexObj(GXTexObj* obj, GXTexMapID id);
|
||||
void GXInitTlutObj(GXTlutObj* obj, void* lut, GXTlutFmt fmt, u16 entry_num);
|
||||
void GXLoadTlut(GXTlutObj* obj, u32 tlut_name);
|
||||
void GXInitTexCacheRegion(GXTexRegion* region, GXBool is_32b_mipmap, u32 tmem_even,
|
||||
GXTexCacheSize size_even, u32 tmem_odd, GXTexCacheSize size_odd);
|
||||
void GXInitTlutRegion(GXTlutRegion* region, u32 tmem_addr, GXTlutSize tlut_size);
|
||||
void GXInvalidateTexAll(void);
|
||||
|
||||
GXTexRegionCallback GXSetTexRegionCallback(GXTexRegionCallback callback);
|
||||
GXTlutRegionCallback GXSetTlutRegionCallback(GXTlutRegionCallback callback);
|
||||
|
||||
void GXSetTexCoordScaleManually(GXTexCoordID coord, GXBool enable, u16 s_scale, u16 t_scale);
|
||||
|
||||
void __SetSURegs();
|
||||
void __GXSetSUTexRegs();
|
||||
void __GXSetTmemConfig();
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXTEXTURE_H */
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
#ifndef GXTRANSFORM_H
|
||||
#define GXTRANSFORM_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXProject(f32 model_x, f32 model_y, f32 model_z, Mtx model_mtx, f32* proj_mtx, f32* viewpoint,
|
||||
f32* screen_x, f32* screen_y, f32* screen_z);
|
||||
void GXSetProjection(Mtx44 mtx, GXProjectionType type);
|
||||
void GXSetProjectionv(f32* p);
|
||||
void GXGetProjectionv(f32* p);
|
||||
void GXLoadPosMtxImm(Mtx mtx, u32 id);
|
||||
void GXLoadNrmMtxImm(Mtx mtx, u32 id);
|
||||
void GXSetCurrentMtx(u32 id);
|
||||
void GXLoadTexMtxImm(Mtx mtx, u32 id, GXTexMtxType type);
|
||||
void GXSetViewport(f32 x_orig, f32 y_orig, f32 width, f32 height, f32 near_z, f32 far_z);
|
||||
void GXGetViewportv(f32* p);
|
||||
void GXSetScissor(u32 left, u32 top, u32 width, u32 height);
|
||||
void GXGetScissor(u32* left, u32* top, u32* width, u32* height);
|
||||
void GXSetScissorBoxOffset(u32 x_offset, u32 y_offset);
|
||||
void GXSetClipMode(GXClipMode mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* GXTRANSFORM_H */
|
||||
|
||||
+11
-11
@@ -6,13 +6,16 @@
|
||||
#include "dolphin/mtx/vec.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef f32 Mtx[3][4];
|
||||
typedef f32 Mtx33[3][3];
|
||||
typedef f32 Mtx23[2][3];
|
||||
typedef f32 (*MtxP)[4];
|
||||
typedef const f32 (*CMtxP)[4]; // Change name later?
|
||||
|
||||
extern "C" {
|
||||
void PSMTXIdentity(Mtx m);
|
||||
void PSMTXCopy(const Mtx src, Mtx dst);
|
||||
void PSMTXConcat(const Mtx a, const Mtx b, Mtx ab);
|
||||
@@ -21,23 +24,20 @@ void PSMTXRotRad(Mtx m, u8 axis, f32 rad);
|
||||
void PSMTXRotTrig(Mtx m, u8 axis, f32 sin, f32 cos);
|
||||
f64 __PSMTXRotAxisRadInternal(f64 param_1, f64 param_2, int param_3, int param_4);
|
||||
void PSMTXRotAxisRad(Mtx m, const Vec* axis, f32 rad);
|
||||
void PSMTXTrans(Mtx m, f32 x_trans, f32 y_trans, f32 z_trans);
|
||||
void PSMTXTrans(Mtx m, f32 x, f32 y, f32 z);
|
||||
void PSMTXTransApply(const Mtx src, Mtx dst, f32 x, f32 y, f32 z);
|
||||
void PSMTXScale(Mtx m, f32 x_scale, f32 y_scale, f32 z_scale);
|
||||
void PSMTXScaleApply(const Mtx src, Mtx dst, f32 x_scale, f32 y_scale, f32 z_scale);
|
||||
void PSMTXScale(Mtx m, f32 x, f32 y, f32 z);
|
||||
void PSMTXScaleApply(const Mtx src, Mtx dst, f32 x, f32 y, f32 z);
|
||||
void PSMTXQuat(Mtx m, const Quaternion* q);
|
||||
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
||||
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
||||
|
||||
void C_MTXLookAt(Mtx m, const Vec* camPos, const Vec* camUp, const Vec* target);
|
||||
void C_MTXLightPerspective(Mtx m, f32 fovY, f32 aspect, f32 scale_s, f32 scale_t, f32 trans_s,
|
||||
f32 trans_t);
|
||||
void C_MTXLightOrtho(Mtx m, f32 top, f32 bottom, f32 left, f32 right, f32 scale_s, f32 scale_t,
|
||||
f32 trans_s, f32 trans_t);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* MTX_H */
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef float Mtx44[4][4];
|
||||
typedef f32 Mtx44[4][4];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void C_MTXPerspective(Mtx44 m, f32 fovy, f32 aspect, f32 near, f32 far);
|
||||
void C_MTXOrtho(Mtx44 m, f32 top, f32 bottom, f32 left, f32 right, f32 near, f32 far);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* MTX44_H */
|
||||
|
||||
@@ -2,14 +2,18 @@
|
||||
#define MTXVEC_H
|
||||
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
#include "dolphin/mtx/vec.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
void PSMTXMultVec(const Mtx matrix, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecArray(const Mtx matrix, const Vec* src, Vec* dst, u32 count);
|
||||
void PSMTXMultVecSR(const Mtx matrix, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecArraySR(const Mtx matrix, const Vec* src, Vec* dst, u32 count);
|
||||
}
|
||||
#endif
|
||||
|
||||
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
||||
void PSMTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* MTXVEC_H */
|
||||
|
||||
@@ -2,16 +2,21 @@
|
||||
#define QUAT_H
|
||||
|
||||
#include "dolphin/mtx/vec.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct Quaternion {
|
||||
f32 x, y, z, w;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
void PSQUATMultiply(const Quaternion* src_a, const Quaternion* src_b, Quaternion* dst);
|
||||
#endif
|
||||
|
||||
typedef struct Quaternion {
|
||||
f32 x, y, z, w;
|
||||
} Quaternion;
|
||||
|
||||
void PSQUATMultiply(const Quaternion* a, const Quaternion* b, Quaternion* ab);
|
||||
void C_QUATRotAxisRad(Quaternion* q, const Vec* axis, f32 rad);
|
||||
void C_QUATSlerp(const Quaternion* p, const Quaternion* q, Quaternion* r, f32 t);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* QUAT_H */
|
||||
|
||||
+12
-34
@@ -3,47 +3,22 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct Vec {
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct Vec {
|
||||
f32 x, y, z;
|
||||
f32 GetX() const { return x; }
|
||||
f32 GetY() const { return y; }
|
||||
f32 GetZ() const { return z; }
|
||||
f32 getXDiff(const Vec* other) const { return x - other->x; }
|
||||
f32 getYDiff(const Vec* other) const { return y - other->y; }
|
||||
f32 getZDiff(const Vec* other) const { return z - other->z; }
|
||||
void set(f32 pX, f32 pY, f32 pZ) {
|
||||
x = pX;
|
||||
y = pY;
|
||||
z = pZ;
|
||||
}
|
||||
void set(const Vec& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
};
|
||||
} Vec;
|
||||
|
||||
typedef Vec* VecPtr;
|
||||
typedef Vec Point3d;
|
||||
typedef Vec* Point3dPtr;
|
||||
|
||||
struct SVec {
|
||||
typedef struct SVec {
|
||||
s16 x, y, z;
|
||||
} SVec;
|
||||
|
||||
void set(s16 oX, s16 oY, s16 oZ) {
|
||||
x = oX;
|
||||
y = oY;
|
||||
z = oZ;
|
||||
}
|
||||
|
||||
void setall(s16 val) {
|
||||
x = val;
|
||||
y = val;
|
||||
z = val;
|
||||
}
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
void PSVECAdd(const Vec* a, const Vec* b, Vec* ab);
|
||||
void PSVECSubtract(const Vec* a, const Vec* b, Vec* a_b);
|
||||
void PSVECScale(const Vec* src, Vec* dst, f32 scale);
|
||||
@@ -57,6 +32,9 @@ f32 PSVECDistance(const Vec* a, const Vec* b);
|
||||
|
||||
void C_VECHalfAngle(const Vec* a, const Vec* b, Vec* half);
|
||||
void C_VECReflect(const Vec* src, const Vec* normal, Vec* dst);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* VEC_H */
|
||||
|
||||
+31
-5
@@ -2,6 +2,8 @@
|
||||
#define OS_H_
|
||||
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/dvd/dvd.h"
|
||||
|
||||
#include "dolphin/os/OSAlarm.h"
|
||||
#include "dolphin/os/OSAlloc.h"
|
||||
#include "dolphin/os/OSArena.h"
|
||||
@@ -35,6 +37,20 @@ extern "C" {
|
||||
#define OS_MESSAGE_NON_BLOCKING 0
|
||||
#define OS_MESSAGE_BLOCKING 1
|
||||
|
||||
volatile u16 __OSDeviceCode : 0x800030E6;
|
||||
|
||||
volatile u32 OS_PI_INTR_CAUSE : 0xCC003000;
|
||||
volatile u32 OS_PI_INTR_MASK : 0xCC003004;
|
||||
|
||||
volatile u16 OS_MI_INTR_MASK : 0xCC00401C;
|
||||
|
||||
volatile u16 OS_DSP_DMA_ADDR_HI : 0xCC005030;
|
||||
volatile u16 OS_DSP_DMA_ADDR_LO : 0xCC005032;
|
||||
volatile u16 OS_DSP_INTR_MASK : 0xCC00500A;
|
||||
|
||||
volatile u16 OS_ARAM_DMA_ADDR_HI : 0xCC005020;
|
||||
volatile u16 OS_ARAM_DMA_ADDR_LO : 0xCC005022;
|
||||
|
||||
BOOL OSIsThreadSuspended(OSThread* thread);
|
||||
|
||||
u32 OSGetConsoleType(void);
|
||||
@@ -58,20 +74,20 @@ void OSReportInit__Fv(void); // needed for inline asm
|
||||
|
||||
u8* OSGetStackPointer(void);
|
||||
void __OSFPRInit(void);
|
||||
static void InquiryCallback(u32 param_0, void* param_1);
|
||||
static void InquiryCallback(u32 param_0, DVDCommandBlock* param_1);
|
||||
void OSInit(void);
|
||||
static void OSExceptionInit(void);
|
||||
void __OSDBIntegrator(void);
|
||||
void __OSDBJump(void);
|
||||
|
||||
typedef void (*OSExceptionHandler)(OSException, OSContext*);
|
||||
OSExceptionHandler __OSSetExceptionHandler(OSException exception, OSExceptionHandler handler);
|
||||
OSExceptionHandler __OSGetExceptionHandler(OSException exception);
|
||||
OSExceptionHandler __OSSetExceptionHandler(__OSException exception, OSExceptionHandler handler);
|
||||
OSExceptionHandler __OSGetExceptionHandler(__OSException exception);
|
||||
static void OSExceptionVector(void);
|
||||
void __DBVECTOR();
|
||||
void __OSEVSetNumber();
|
||||
void __OSEVEnd();
|
||||
static void OSDefaultExceptionHandler(OSException exception, OSContext* context);
|
||||
static void OSDefaultExceptionHandler(__OSException exception, OSContext* context);
|
||||
void __OSPSInit(void);
|
||||
void __OSGetDIConfig(void);
|
||||
void OSRegisterVersion(char* version);
|
||||
@@ -132,7 +148,17 @@ inline void i_OSInitFastCast(void) {
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
#include "dolphin/dvd/dvd.h"
|
||||
typedef struct OSBootInfo {
|
||||
/* 0x00 */ DVDDiskID disk_info;
|
||||
/* 0x20 */ u32 boot_code;
|
||||
/* 0x24 */ u32 version;
|
||||
/* 0x28 */ u32 memory_size;
|
||||
/* 0x2C */ u32 console_type;
|
||||
/* 0x30 */ void* arena_lo;
|
||||
/* 0x34 */ void* arena_hi;
|
||||
/* 0x38 */ void* fst_location;
|
||||
/* 0x3C */ u32 fst_max_length;
|
||||
} OSBootInfo;
|
||||
|
||||
struct GLOBAL_MEMORY {
|
||||
DVDDiskID disk;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef OSALARM_H
|
||||
#define OSALARM_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSTime.h"
|
||||
#include "dolphin/os/OSError.h"
|
||||
|
||||
@@ -14,7 +13,8 @@ typedef struct OSAlarmLink {
|
||||
/* 0x4 */ struct OSAlarm* next;
|
||||
} OSAlarmLink;
|
||||
|
||||
typedef void (*OSAlarmHandler)(struct OSAlarm* alarm, struct OSContext* context);
|
||||
typedef struct OSAlarm;
|
||||
typedef void (*OSAlarmHandler)(struct OSAlarm* alarm, OSContext* context);
|
||||
|
||||
typedef struct OSAlarm {
|
||||
/* 0x00 */ OSAlarmHandler handler;
|
||||
@@ -31,8 +31,8 @@ static void InsertAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler);
|
||||
void OSSetAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler);
|
||||
void OSSetPeriodicAlarm(OSAlarm* alarm, s64 start, s64 period, OSAlarmHandler* handler);
|
||||
void OSCancelAlarm(OSAlarm* alarm);
|
||||
static void DecrementerExceptionCallback(OSException* exception, struct OSContext* context);
|
||||
static void DecrementerExceptionHandler(OSException* exception, struct OSContext* context);
|
||||
static void DecrementerExceptionCallback(__OSException exception, OSContext* context);
|
||||
static void DecrementerExceptionHandler(__OSException exception, OSContext* context);
|
||||
static s32 OnReset(s32 param_0);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -7,11 +7,34 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSHeapDescriptor {
|
||||
/* 0x0 */ s32 size;
|
||||
/* 0x4 */ struct OSHeapCell* freeList;
|
||||
/* 0x8 */ struct OSHeapCell* usedList;
|
||||
} OSHeapDescriptor;
|
||||
|
||||
typedef struct OSHeapCell {
|
||||
/* 0x00 */ struct OSHeapCell* prev;
|
||||
/* 0x04 */ struct OSHeapCell* next;
|
||||
/* 0x08 */ s32 size;
|
||||
/* 0x0C */ struct OSHeapDescriptor* hd;
|
||||
/* 0x10 */ s32 usedSize;
|
||||
/* 0x14 */ char field_0x14[0x20 - 0x14];
|
||||
} OSHeapCell;
|
||||
|
||||
typedef u32 OSHeapHandle;
|
||||
|
||||
static void* DLInsert(void* param_0, void* param_1);
|
||||
void OSFreeToHeap(OSHeapHandle heap, void* ptr);
|
||||
void OSSetCurrentHeap(OSHeapHandle heap);
|
||||
extern volatile s32 __OSCurrHeap;
|
||||
|
||||
#define OSRoundUp(x, align) (((x) + (align)-1) & (-(align)))
|
||||
#define OSRoundUpPtr(x, align) ((void*)((((u32)(x)) + (align)-1) & (~((align)-1))))
|
||||
|
||||
#define OSRoundDown(x, align) ((x) & (-(align)))
|
||||
#define OSRoundDownPtr(x, align) ((void*)(((u32)(x)) & (~((align)-1))))
|
||||
|
||||
static OSHeapCell* DLInsert(OSHeapCell* list, OSHeapCell* child);
|
||||
void OSFreeToHeap(OSHeapHandle handle, void* ptr);
|
||||
s32 OSSetCurrentHeap(OSHeapHandle handle);
|
||||
void* OSInitAlloc(void* lo, void* hi, s32 maxHeaps);
|
||||
OSHeapHandle OSCreateHeap(void* start, void* end);
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*OSSwitchThreadCallback)(struct OSThread* from, struct OSThread* to);
|
||||
|
||||
typedef struct OSContext {
|
||||
/* 0x000 */ u32 gpr[32];
|
||||
/* 0x080 */ u32 cr;
|
||||
@@ -16,7 +14,7 @@ typedef struct OSContext {
|
||||
/* 0x088 */ u32 ctr;
|
||||
/* 0x08C */ u32 xer;
|
||||
/* 0x090 */ f64 fpr[32];
|
||||
/* 0x190 */ u32 padding_1;
|
||||
/* 0x190 */ u32 field_0x190;
|
||||
/* 0x194 */ u32 fpscr;
|
||||
/* 0x198 */ u32 srr0;
|
||||
/* 0x19C */ u32 srr1;
|
||||
@@ -26,8 +24,11 @@ typedef struct OSContext {
|
||||
/* 0x1C4 */ f64 ps[32];
|
||||
} OSContext;
|
||||
|
||||
OSContext* OS_CURRENT_CONTEXT : 0x800000D4;
|
||||
OSContext* OS_CURRENT_FPU_CONTEXT : 0x800000D8;
|
||||
|
||||
void __OSLoadFPUContext(void);
|
||||
void __OSSaveFPUContext(OSContext* context);
|
||||
void __OSSaveFPUContext(s32 unused0, s32 unused1, OSContext* context);
|
||||
void OSSaveFPUContext(OSContext* context);
|
||||
void OSSetCurrentContext(OSContext* context);
|
||||
OSContext* OSGetCurrentContext(void);
|
||||
@@ -36,7 +37,7 @@ void OSLoadContext(OSContext* context);
|
||||
void OSClearContext(OSContext* context);
|
||||
void OSInitContext(OSContext* context, u32 pc, u32 lr);
|
||||
void OSDumpContext(OSContext* context);
|
||||
static void OSSwitchFPUContext(OSContext* context);
|
||||
static void OSSwitchFPUContext(u8 err, OSContext* context);
|
||||
void __OSContextInit(void);
|
||||
void OSFillFPUContext(OSContext* context);
|
||||
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
#ifndef OSERROR_H
|
||||
#define OSERROR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSContext.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct OSContext;
|
||||
|
||||
extern u32 __OSFpscrEnableBits;
|
||||
|
||||
typedef u16 OSError;
|
||||
typedef void (*OSErrorHandler)(OSError error, OSContext* context, u32, u32);
|
||||
|
||||
#define OS_ERROR_SYSTEM_RESET 0
|
||||
#define OS_ERROR_MACHINE_CHECK 1
|
||||
@@ -32,7 +28,7 @@ typedef void (*OSErrorHandler)(OSError error, OSContext* context, u32, u32);
|
||||
#define OS_ERROR_MEMORY_PROTECTION 15
|
||||
#define OS_ERROR_FLOATING_POINT_EXCEPTION 16
|
||||
|
||||
typedef enum OSException {
|
||||
typedef enum {
|
||||
EXCEPTION_SYSTEM_RESET,
|
||||
EXCEPTION_MACHINE_CHECK,
|
||||
EXCEPTION_DSI,
|
||||
@@ -52,6 +48,10 @@ typedef enum OSException {
|
||||
EXCEPTION_FLOATING_POINT_EXCEPTION,
|
||||
} OSException;
|
||||
|
||||
typedef u8 __OSException;
|
||||
|
||||
typedef void (*OSErrorHandler)(OSError error, OSContext* context, u32, u32);
|
||||
|
||||
OSErrorHandler OSSetErrorHandler(OSError error, OSErrorHandler handler);
|
||||
void __OSUnhandledException(OSException exception, OSContext* context, u32 dsisr, u32 dar);
|
||||
|
||||
|
||||
@@ -1,15 +1,52 @@
|
||||
#ifndef OSINTERRUPT_H
|
||||
#define OSINTERRUPT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSContext.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
OS_INTR_MEM_0,
|
||||
OS_INTR_MEM_1,
|
||||
OS_INTR_MEM_2,
|
||||
OS_INTR_MEM_3,
|
||||
OS_INTR_MEM_ADDRESS,
|
||||
OS_INTR_DSP_AI,
|
||||
OS_INTR_DSP_ARAM,
|
||||
OS_INTR_DSP_DSP,
|
||||
OS_INTR_AI_AI,
|
||||
OS_INTR_EXI_0_EXI,
|
||||
OS_INTR_EXI_0_TC,
|
||||
OS_INTR_EXI_0_EXT,
|
||||
OS_INTR_EXI_1_EXI,
|
||||
OS_INTR_EXI_1_TC,
|
||||
OS_INTR_EXI_1_EXT,
|
||||
OS_INTR_EXI_2_EXI,
|
||||
OS_INTR_EXI_2_TC,
|
||||
OS_INTR_PI_CP,
|
||||
OS_INTR_PI_PE_TOKEN,
|
||||
OS_INTR_PI_PE_FINISH,
|
||||
OS_INTR_PI_SI,
|
||||
OS_INTR_PI_DI,
|
||||
OS_INTR_PI_RSW,
|
||||
OS_INTR_PI_ERROR,
|
||||
OS_INTR_PI_VI,
|
||||
OS_INTR_PI_DEBUG,
|
||||
OS_INTR_PI_HSP,
|
||||
OS_INTR_PI_ACR,
|
||||
OS_INTR_28,
|
||||
OS_INTR_29,
|
||||
OS_INTR_30,
|
||||
OS_INTR_31,
|
||||
|
||||
OS_INTR_MAX
|
||||
} OSInterruptType;
|
||||
|
||||
typedef s16 OSInterrupt;
|
||||
typedef u32 OSInterruptMask;
|
||||
typedef void (*OSInterruptHandler)(OSInterrupt interrupt, struct OSContext* context);
|
||||
typedef void (*OSInterruptHandler)(OSInterrupt interrupt, OSContext* context);
|
||||
|
||||
BOOL OSDisableInterrupts(void);
|
||||
void __RAS_OSDisableInterrupts_end(void);
|
||||
@@ -21,8 +58,11 @@ void __OSInterruptInit(void);
|
||||
static OSInterruptMask SetInterruptMask(OSInterruptMask param_0, OSInterruptMask param_1);
|
||||
OSInterruptMask __OSMaskInterrupts(OSInterruptMask mask);
|
||||
OSInterruptMask __OSUnmaskInterrupts(OSInterruptMask mask);
|
||||
void __OSDispatchInterrupt(OSInterrupt interrupt, struct OSContext* context);
|
||||
static void ExternalInterruptHandler(OSInterrupt interrupt, struct OSContext* context);
|
||||
void __OSDispatchInterrupt(OSInterrupt interrupt, OSContext* context);
|
||||
static void ExternalInterruptHandler(OSInterrupt interrupt, OSContext* context);
|
||||
|
||||
void __RAS_OSDisableInterrupts_begin(void);
|
||||
void __RAS_OSDisableInterrupts_end(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSModuleQueue {
|
||||
int* first;
|
||||
int* last;
|
||||
} OSModuleQueue;
|
||||
|
||||
OSModuleQueue __OSModuleList : 0x800030C8;
|
||||
void* __OSStringTable : 0x800030D0;
|
||||
|
||||
typedef struct OSSectionInfo {
|
||||
u32 mOffset;
|
||||
u32 mSize;
|
||||
|
||||
@@ -13,7 +13,7 @@ static void MEMIntrruptHandler(OSInterrupt interrupt, struct OSContext* context)
|
||||
void OSProtectRange(u32 channel, void* address, u32 nBytes, u32 control);
|
||||
static void Config24MB(void);
|
||||
static void Config48MB(void);
|
||||
static void RealMode(void);
|
||||
static void RealMode(void* config);
|
||||
void __OSInitMemoryProtection(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef OSMESSAGE_H
|
||||
#define OSMESSAGE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSThread.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
#ifndef OSMUTEX_H
|
||||
#define OSMUTEX_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSThread.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void OSInitMutex(struct OSMutex* mutex);
|
||||
void OSLockMutex(struct OSMutex* mutex);
|
||||
void OSUnlockMutex(struct OSMutex* mutex);
|
||||
void __OSUnlockAllMutex(struct OSThread* thread);
|
||||
s32 OSTryLockMutex(struct OSMutex* mutex);
|
||||
void OSInitCond(struct OSCond* cond);
|
||||
void OSWaitCond(struct OSCond* cond, struct OSMutex* mutex);
|
||||
void OSSignalCond(struct OSCond* cond);
|
||||
s32 __OSCheckMutex(struct OSThread* thread);
|
||||
BOOL __OSCheckDeadLock(struct OSThread* thread);
|
||||
BOOL __OSCheckMutexes(struct OSThread* thread);
|
||||
typedef struct OSMutex {
|
||||
/* 0x00 */ OSThreadQueue queue;
|
||||
/* 0x08 */ OSThread* thread;
|
||||
/* 0x0C */ s32 count;
|
||||
/* 0x10 */ OSMutexLink link;
|
||||
} OSMutex; // Size: 0x18
|
||||
|
||||
void OSInitMutex(OSMutex* mutex);
|
||||
void OSLockMutex(OSMutex* mutex);
|
||||
void OSUnlockMutex(OSMutex* mutex);
|
||||
void __OSUnlockAllMutex(OSThread* thread);
|
||||
s32 OSTryLockMutex(OSMutex* mutex);
|
||||
void OSInitCond(OSCond* cond);
|
||||
void OSWaitCond(OSCond* cond, OSMutex* mutex);
|
||||
void OSSignalCond(OSCond* cond);
|
||||
s32 __OSCheckMutex(OSThread* thread);
|
||||
BOOL __OSCheckDeadLock(OSThread* thread);
|
||||
BOOL __OSCheckMutexes(OSThread* thread);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ extern "C" {
|
||||
|
||||
void __OSReboot(u32 param_0, u32 param_1);
|
||||
void OSSetSaveRegion(void* start, void* end);
|
||||
void OSGetSaveRegion(void* start, void* end);
|
||||
void OSGetSaveRegion(void** start, void** end);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
@@ -10,6 +10,8 @@ extern "C" {
|
||||
static void SystemCallVector(void);
|
||||
void __OSInitSystemCall(void);
|
||||
|
||||
void __OSSystemCallVectorEnd(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef OSTHREAD_H
|
||||
#define OSTHREAD_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSMutex.h"
|
||||
#include "dolphin/os/OSContext.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -16,24 +14,6 @@ typedef u16 OSThreadState;
|
||||
#define OS_THREAD_STATE_WAITING 4
|
||||
#define OS_THREAD_STATE_DEAD 8
|
||||
|
||||
typedef struct OSMutexLink {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexLink;
|
||||
|
||||
typedef struct OSMutexQueue {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexQueue;
|
||||
|
||||
typedef struct OSMutex {
|
||||
/* 0x00 */ //OSThreadQueue queue;
|
||||
/* 0x08 */ //OSThread* thread;
|
||||
/* 0x0C */ //s32 count;
|
||||
/* 0x10 */ //OSMutexLink link;
|
||||
u8 unk[24];
|
||||
} OSMutex; // Size: 0x18
|
||||
|
||||
typedef struct OSThreadLink {
|
||||
struct OSThread* prev;
|
||||
struct OSThread* next;
|
||||
@@ -44,32 +24,45 @@ typedef struct OSThreadQueue {
|
||||
/* 0x4 */ struct OSThread* tail;
|
||||
} OSThreadQueue;
|
||||
|
||||
typedef struct OSMutexLink {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexLink;
|
||||
|
||||
typedef struct OSMutexQueue {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexQueue;
|
||||
|
||||
typedef struct OSCond {
|
||||
struct OSThreadQueue queue;
|
||||
OSThreadQueue queue;
|
||||
} OSCond;
|
||||
|
||||
typedef void (*OSSwitchThreadCallback)(struct OSThread* from, struct OSThread* to);
|
||||
|
||||
typedef struct OSThread {
|
||||
struct OSContext context;
|
||||
OSContext context;
|
||||
OSThreadState state;
|
||||
u16 attributes;
|
||||
s32 suspend_count;
|
||||
u32 effective_priority;
|
||||
s32 effective_priority;
|
||||
u32 base_priority;
|
||||
void* exit_value;
|
||||
struct OSThreadQueue* queue;
|
||||
struct OSThreadLink link;
|
||||
struct OSThreadQueue join_queue;
|
||||
OSThreadQueue* queue;
|
||||
OSThreadLink link;
|
||||
OSThreadQueue join_queue;
|
||||
struct OSMutex* mutex;
|
||||
OSMutexQueue owned_mutexes;
|
||||
struct OSThreadLink active_threads_link;
|
||||
OSThreadLink active_threads_link;
|
||||
u8* stack_base;
|
||||
u8* stack_end;
|
||||
u8* error_code;
|
||||
void* data[2];
|
||||
} OSThread;
|
||||
|
||||
typedef void (*OSSwitchThreadCallback)(OSThread* from, OSThread* to);
|
||||
|
||||
OSThreadQueue OS_THREAD_QUEUE : 0x800000DC;
|
||||
OSThread* OS_CURRENT_THREAD : 0x800000E4;
|
||||
|
||||
static void DefaultSwitchThreadCallback(OSThread* from, OSThread* to);
|
||||
OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback func);
|
||||
void __OSThreadInit(void);
|
||||
|
||||
@@ -10,6 +10,8 @@ extern "C" {
|
||||
typedef s64 OSTime;
|
||||
typedef u32 OSTick;
|
||||
|
||||
OSTime OS_SYSTEM_TIME : 0x800030D8;
|
||||
|
||||
typedef struct OSCalendarTime {
|
||||
/* 0x00 */ s32 seconds;
|
||||
/* 0x04 */ s32 minutes;
|
||||
|
||||
+11
-10
@@ -3,12 +3,11 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef enum PADMask {
|
||||
// PAD_CHAN3_BIT = (1 << 0),
|
||||
// PAD_CHAN2_BIT = (1 << 1),
|
||||
// PAD_CHAN1_BIT = (1 << 2),
|
||||
// PAD_CHAN0_BIT = (1 << 3),
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum PADMask {
|
||||
PAD_CHAN3_BIT = (1 << 28),
|
||||
PAD_CHAN2_BIT = (1 << 29),
|
||||
PAD_CHAN1_BIT = (1 << 30),
|
||||
@@ -28,16 +27,18 @@ typedef struct PADStatus {
|
||||
/* 0xA */ s8 error;
|
||||
} PADStatus;
|
||||
|
||||
extern "C" {
|
||||
u32 PADInit(void);
|
||||
void PADSetAnalogMode(u32 mode);
|
||||
void PADSetSpec(int spec);
|
||||
s32 PADReset(PADMask mask);
|
||||
BOOL PADReset(u32 mask);
|
||||
void PADClampCircle(PADStatus* status);
|
||||
void PADClamp(PADStatus* status);
|
||||
u32 PADRead(PADStatus* status);
|
||||
void PADRead(PADStatus* status);
|
||||
void PADControlMotor(s32 channel, u32 command);
|
||||
s32 PADRecalibrate(PADMask mask);
|
||||
}
|
||||
BOOL PADRecalibrate(u32 mask);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* PAD_H */
|
||||
|
||||
+19
-11
@@ -4,18 +4,26 @@
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*VIRetraceCallback)(u32);
|
||||
|
||||
extern "C" void VIWaitForRetrace(void);
|
||||
extern "C" void VISetNextFrameBuffer(void*);
|
||||
extern "C" VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback);
|
||||
extern "C" VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback);
|
||||
extern "C" void VIInit();
|
||||
extern "C" void VIConfigure(GXRenderModeObj*);
|
||||
extern "C" void VIFlush();
|
||||
extern "C" void* VIGetNextFrameBuffer();
|
||||
extern "C" void* VIGetCurrentFrameBuffer();
|
||||
extern "C" void VISetBlack(BOOL);
|
||||
extern "C" u32 VIGetRetraceCount();
|
||||
void VIWaitForRetrace(void);
|
||||
void VISetNextFrameBuffer(void*);
|
||||
VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback);
|
||||
VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback);
|
||||
void VIInit();
|
||||
void VIConfigure(GXRenderModeObj*);
|
||||
void VIFlush();
|
||||
void* VIGetNextFrameBuffer();
|
||||
void* VIGetCurrentFrameBuffer();
|
||||
void VISetBlack(BOOL);
|
||||
u32 VIGetRetraceCount();
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* VI_H */
|
||||
|
||||
Reference in New Issue
Block a user