Skip to content
Merged
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def MatchingFor(*versions):
Object(NonMatching, "SB/Game/zParticleCustom.cpp"),
Object(NonMatching, "SB/Core/gc/iWad.cpp"),
Object(NonMatching, "SB/Core/gc/iTRC.cpp"),
Object(NonMatching, "SB/Core/gc/iException.cpp"),
Object(Matching, "SB/Core/gc/iException.cpp"),
Object(NonMatching, "SB/Core/gc/iScrFX.cpp"),
Object(NonMatching, "SB/Core/gc/iARAMTmp.cpp"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ long abs(long n);
}
#endif

#endif
#endif
16 changes: 16 additions & 0 deletions src/SB/Core/gc/iAnim.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef IANIM_H
#define IANIM_H

#include "xMath3.h"

extern U8* giAnimScratch;

void iAnimInit();
F32 iAnimDuration(void* RawData);
U32 iAnimBoneCount(void* RawData);
void iAnimBlend(F32 BlendFactor, F32 BlendRecip, U16* BlendTimeOffset, F32* BoneTable,
U32 BoneCount, xVec3* Tran1, xQuat* Quat1, xVec3* Tran2, xQuat* Quat2,
xVec3* TranDest, xQuat* QuatDest);
void iAnimEval(void* RawData, float time, unsigned int flags, class xVec3* tran, class xQuat* quat);

#endif
26 changes: 26 additions & 0 deletions src/SB/Core/gc/iAnimSKB.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef IANIMSKB_H
#define IANIMSKB_H

#include "xMath3.h"

struct iAnimSKBHeader
{
U32 Magic;
U32 Flags;
U16 BoneCount;
U16 TimeCount;
U32 KeyCount;
F32 Scale[3];
};

struct iAnimSKBKey
{
U16 TimeIndex;
S16 Quat[4];
S16 Tran[3];
};

void iAnimEvalSKB(iAnimSKBHeader* data, F32 time, U32 flags, xVec3* tran, xQuat* quat);
F32 iAnimDurationSKB(iAnimSKBHeader* data);

#endif
17 changes: 17 additions & 0 deletions src/SB/Core/gc/iCollide.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef ICOLLIDE_H
#define ICOLLIDE_H

#include "xMath3.h"
#include "xModel.h"
#include "xEnv.h"
#include "xCollide.h"

void iBoxForModelLocal(xBox* o, const xModelInstance* m);
void iBoxForModel(xBox* o, const xModelInstance* m);
S32 iSphereHitsEnv3(const xSphere* b, const xEnv* env, xCollis* colls, U8 ncolls, F32 sth);
S32 iSphereHitsModel3(const xSphere* b, const xModelInstance* m, xCollis* colls, U8 ncolls,
F32 sth);
U32 iRayHitsModel(const xRay3* r, const xModelInstance* m, xCollis* coll);
void iCollideInit(xScene* sc);

#endif
8 changes: 8 additions & 0 deletions src/SB/Core/gc/iCollideFast.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef ICOLLIDEFAST_H
#define ICOLLIDEFAST_H

#include "xScene.h"

void iCollideFastInit(xScene* sc);

#endif
23 changes: 23 additions & 0 deletions src/SB/Core/gc/iColor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef ICOLOR_H
#define ICOLOR_H

#include <types.h>

struct iColor_tag
{
U8 r;
U8 g;
U8 b;
U8 a;

iColor_tag& operator=(const iColor_tag& rhs)
{
this->r = rhs.r;
this->g = rhs.g;
this->b = rhs.b;
this->a = rhs.a;
return *this;
};
};

#endif
15 changes: 15 additions & 0 deletions src/SB/Core/gc/iCutscene.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef ICUTSCENE_H
#define ICUTSCENE_H

#include "xCutscene.h"
#include "xSnd.h"

void iCSSoundSetup(xCutscene* csn);
void* iCSSoundGetData(xSndVoiceInfo* vp, U32* size);
U32 iCSFileOpen(xCutscene* csn);
void iCSFileAsyncRead(xCutscene* csn, void* dest, U32 size);
void iCSFileAsyncSkip(xCutscene* csn, U32 amount);
void iCSFileClose(xCutscene* csn);
S32 iCSLoadStep(xCutscene* csn);

#endif
10 changes: 10 additions & 0 deletions src/SB/Core/gc/iDraw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef IDRAW_H
#define IDRAW_H

#include <types.h>

void iDrawSetFBMSK(U32 abgr);
void iDrawBegin();
void iDrawEnd();

#endif
30 changes: 30 additions & 0 deletions src/SB/Core/gc/iEnv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef IENV_H
#define IENV_H

#include "xJSP.h"

#include <rwcore.h>
#include <rpworld.h>

struct iEnv
{
RpWorld* world;
RpWorld* collision;
RpWorld* fx;
RpWorld* camera;
xJSPHeader* jsp;
RpLight* light[2];
RwFrame* light_frame[2];
S32 memlvl;
};

struct xEnvAsset;

void iEnvLoad(iEnv* env, const void* data, U32 datasize, S32 dataType);
void iEnvFree(iEnv* env);
void iEnvDefaultLighting(iEnv*);
void iEnvLightingBasics(iEnv*, xEnvAsset*);
void iEnvRender(iEnv* env);
void iEnvEndRenderFX(iEnv*);

#endif
8 changes: 8 additions & 0 deletions src/SB/Core/gc/iException.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "iException.h"

void iExceptionMemCrash(const char* loc, U32 size, const char* arg3)
{
OSReport("Out of memory crash, Loc=%s Size=%d\n", loc, size);
OSReport("%s\n", arg3);
OSPanic("iException.cpp", 25, "");
}
8 changes: 8 additions & 0 deletions src/SB/Core/gc/iException.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef IEXCEPTION_H
#define IEXCEPTION_H

#include "dolphin.h"
#include "dolphin/os.h"
#include <types.h>

#endif
29 changes: 29 additions & 0 deletions src/SB/Core/gc/iFMV.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef IFMV_H
#define IFMV_H

#include <types.h>
#include <bink.h>
#include <size_t.h>

struct _GXRenderModeObj;

struct iFMV
{
static void* mXFBs[2];
static void* mCurrentFrameBuffer;
static _GXRenderModeObj* mRenderMode;
static U8 mFirstFrame;

static void InitDisplay(_GXRenderModeObj*);
static void InitGX();
static void InitVI();
static void Suspend();
static void Resume();
};

void* iFMVmalloc(size_t size);
void iFMVfree(void* mem);
U32 iFMVPlay(char* filename, U32 buttons, F32 time, bool skippable, bool lockController);
static void Setup_surface_array();
void Decompress_frame(HBINK bnk, HRAD3DIMAGE rad_image, long flags);
#endif
4 changes: 4 additions & 0 deletions src/SB/Core/gc/iFX.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#ifndef IFX_H
#define IFX_H

#endif
71 changes: 71 additions & 0 deletions src/SB/Core/gc/iFile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#ifndef IFILE_H
#define IFILE_H

#include <types.h>
#include <dolphin.h>

enum IFILE_READSECTOR_STATUS
{
IFILE_RDSTAT_NOOP,
IFILE_RDSTAT_INPROG,
IFILE_RDSTAT_DONE,
IFILE_RDSTAT_FAIL,
IFILE_RDSTAT_QUEUED,
IFILE_RDSTAT_EXPIRED
};

#ifdef GAMECUBE
struct tag_iFile
{
U32 flags;
char path[128];
S32 entrynum;
DVDFileInfo fileInfo;
S32 unkC4;
S32 asynckey;
S32 unknown[7];
S32 unkE8;
S32 offset;
};
#else
#ifdef PS2
struct tag_iFile
{
U32 flags;
char path[128];
S32 fd;
S32 offset;
S32 length;
};
#endif
#endif

#define IFILE_OPEN_READ 0x1
#define IFILE_OPEN_WRITE 0x2
#define IFILE_OPEN_ABSPATH 0x4

#define IFILE_SEEK_SET 0
#define IFILE_SEEK_CUR 1
#define IFILE_SEEK_END 2

struct tag_xFile;

void iFileInit();
void iFileExit();
U32* iFileLoad(char* name, U32* buffer, U32* size);
U32 iFileOpen(const char* name, S32 flags, tag_xFile* file);
S32 iFileSeek(tag_xFile* file, S32 offset, S32 whence);
U32 iFileRead(tag_xFile* file, void* buf, U32 size);
S32 iFileReadAsync(tag_xFile* file, void* buf, U32 aSize, void (*callback)(tag_xFile*),
S32 priority);
IFILE_READSECTOR_STATUS iFileReadAsyncStatus(S32 key, S32* amtToFar);
U32 iFileClose(tag_xFile* file);
U32 iFileGetSize(tag_xFile* file);
void iFileReadStop();
void iFileFullPath(const char* relname, char* fullname);
void iFileSetPath(char* path);
U32 iFileFind(const char* name, int, tag_xFile* file);
void iFileGetInfo(tag_xFile* file, U32* addr, U32* length);
void iFileAsyncService();

#endif
49 changes: 49 additions & 0 deletions src/SB/Core/gc/iLight.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#ifndef ILIGHT_H
#define ILIGHT_H

#include "xFColor.h"
#include "xMath3.h"

#include <rwcore.h>
#include <rpworld.h>

#define ILIGHT_TYPE_NONE 0
#define ILIGHT_TYPE_POINT 1
#define ILIGHT_TYPE_SPOT 2
#define ILIGHT_TYPE_SPOTSOFT 3

#define ILIGHT_ENV_NONE 0
#define ILIGHT_ENV_ATOMIC 1
#define ILIGHT_ENV_WORLD 2
#define ILIGHT_ENV_ATOMICWORLD 3

// Size: 0x3C
struct iLight
{
// 0x0
U32 type;
RpLight* hw;

//0x8
xSphere sph;
F32 radius_sq;

//0x1C
_xFColor color;

//0x2C
xVec3 dir;
F32 coneangle;
};

extern RpWorld* gLightWorld;

void iLightInit(RpWorld* world);
iLight* iLightCreate(iLight* light, U32 type);
void iLightModify(iLight* light, U32 flags);
void iLightSetColor(iLight* light, _xFColor* col);
void iLightSetPos(iLight* light, xVec3* pos);
void iLightDestroy(iLight* light);
void iLightEnv(iLight* light, S32 env);

#endif
17 changes: 17 additions & 0 deletions src/SB/Core/gc/iMath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef IMATH_H
#define IMATH_H

#include <types.h>
#include <intrin.h>

#ifdef __MWERKS__
#define iabs(x) (float)(__fabs((float)x))
#else
#define iabs(x) fabsf(x)
#endif

F32 isin(F32 x);
F32 icos(F32 x);
F32 itan(F32 x);

#endif
30 changes: 30 additions & 0 deletions src/SB/Core/gc/iMath3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef IMATH3_H
#define IMATH3_H

#include "xMath3.h"
#include "xIsect.h"
#include "xRay3.h"

#include <rwcore.h>

union xiMat4x3Union
{
//xMat4x3 xm; CURRENTLY BROKEN. DONT KNOW WHY
RwMatrix im;
};

void iMath3Init();
void iSphereIsectVec(const xSphere* s, const xVec3* v, xIsect* isx);
void iSphereIsectRay(const xSphere* s, const xRay3* r, xIsect* isx);
void iSphereIsectSphere(const xSphere* s, const xSphere* p, xIsect* isx);
void iSphereInitBoundVec(xSphere* s, const xVec3* v);
void iSphereBoundVec(xSphere* o, const xSphere* s, const xVec3* v);
void iCylinderIsectVec(const xCylinder* c, const xVec3* v, xIsect* isx);
void iBoxVecDist(const xBox* box, const xVec3* v, xIsect* isx);
void iBoxIsectVec(const xBox* b, const xVec3* v, xIsect* isx);
void iBoxIsectRay(const xBox* b, const xRay3* r, xIsect* isx);
void iBoxIsectSphere(const xBox* box, const xSphere* p, xIsect* isx);
void iBoxInitBoundVec(xBox* b, const xVec3* v);
void iBoxBoundVec(xBox* o, const xBox* b, const xVec3* v);

#endif
Loading