Introduce support for gcc

This commit is contained in:
Ryan Dwyer
2022-10-12 22:26:19 +10:00
parent 4b7e93de8a
commit 17583575e4
266 changed files with 2277 additions and 1640 deletions
+6 -3
View File
@@ -23,9 +23,9 @@
#define ABS(val) ((val) > 0 ? (val) : -(val))
#define ABSF(val) ((val) > 0.0f ? (val) : -(val))
#define ALIGN2(val) (((val) | 1) ^ 0x1)
#define ALIGN8(val) (((val) + 0x7 | 0x7) ^ 0x7)
#define ALIGN16(val) (((val) + 0xf | 0xf) ^ 0xf)
#define ALIGN64(val) ((((u32)(val)) + 0x3f | 0x3f) ^ 0x3f)
#define ALIGN8(val) ((((val) + 0x7) | 0x7) ^ 0x7)
#define ALIGN16(val) ((((val) + 0xf) | 0xf) ^ 0xf)
#define ALIGN64(val) (((((u32)(val)) + 0x3f) | 0x3f) ^ 0x3f)
#define ARRAYCOUNT(a) (s32)(sizeof(a) / sizeof(a[0]))
#define CHRRACE(chr) (chr ? chr->race : RACE_HUMAN)
#define CRASH() *(u8 *)0 = 69
@@ -40,6 +40,9 @@
#define SECSTOTIME60(secs) (secs * 60)
#define PFS(device) (device == SAVEDEVICE_GAMEPAK ? NULL : &g_Pfses[device])
#define VALIDWEAPON() (g_Vars.currentplayer->gunctrl.weaponnum >= WEAPON_UNARMED && g_Vars.currentplayer->gunctrl.weaponnum <= WEAPON_COMBATBOOST)
#define FUNCISSEC() (VALIDWEAPON() && (g_PlayerConfigsArray[g_Vars.currentplayerstats->mpindex].gunfuncs[(g_Vars.currentplayer->gunctrl.weaponnum - 1) >> 3] & (1 << ((g_Vars.currentplayer->gunctrl.weaponnum - 1) & 7))))
#define USINGDEVICE(device) (!g_Vars.currentplayer->isdead \
&& !g_InCutscene \
&& EYESPYINACTIVE() \
+1 -1
View File
@@ -4,9 +4,9 @@
#include "data.h"
#include "types.h"
Gfx *creditsDraw(Gfx *gdl);
void creditsReset(void);
void creditsRequestAltTitle(void);
void credits0f13ae04(Mtxf *mtx);
#endif
+1
View File
@@ -28,6 +28,7 @@ bool debugIsChrStatsEnabled(void);
bool debug0f11ef80(void);
s32 dmenuGetSelectedOption(void);
void dmenuSetSelectedOption(s32 option);
void dmenuSetMenu(char **labels, s32 (*positions)[2], s32 *offsets);
void dmenuNavigateRight(void);
void dmenuNavigateLeft(void);
+1 -1
View File
@@ -16,6 +16,6 @@ Gfx *envStartFog(Gfx *gdl, bool xlupass);
Gfx *envStopFog(Gfx *gdl);
bool env0f1666f8(struct coord *pos, f32 arg1);
struct coord *env0f1667e8(void);
s32 env0f1667f4(struct prop *prop, f32 *arg1);
s32 env0f1667f4(struct prop *prop, f32 arg1[4]);
#endif
+1
View File
@@ -5,6 +5,7 @@
#include "types.h"
void langInit(void);
void langReset(s32 stagenum);
void langTick(void);
u32 langGetLangBankIndexFromStagenum(s32 stagenum);
+1 -1
View File
@@ -79,7 +79,7 @@ void dialogCalculatePosition(struct menudialog *dialog);
void menuClose(void);
void func0f0f8120(void);
void func0f0f820c(struct menudialogdef *dialogdef, s32 root);
bool menuSetBackground(s32 bg);
void menuSetBackground(s32 bg);
void func0f0f8300(void);
void menuPushRootDialog(struct menudialogdef *dialogdef, s32 arg1);
void func0f0f85e0(struct menudialogdef *dialogdef, s32 root);
+1 -1
View File
@@ -4,7 +4,7 @@
#include "data.h"
#include "types.h"
void modeldef0f1a7560(struct modelfiledata *modeldef, u16 filenum, u32 arg2, u32 arg3, struct texpool *arg4, bool arg5);
void modeldef0f1a7560(struct modelfiledata *modeldef, u16 filenum, u32 arg2, struct modelfiledata *modeldef2, struct texpool *texpool, bool arg5);
void modelPromoteTypeToPointer(struct modelfiledata *filedata);
struct modelfiledata *modeldefLoad(u16 fileid, u8 *arg1, s32 arg2, struct texpool *arg3);
struct modelfiledata *modeldefLoadToNew(u16 fileid);
+2
View File
@@ -8,6 +8,8 @@ extern f32 g_AutoAimScale;
void propsTick(void);
void propsStop(void);
void propsSort(void);
void propEnable(struct prop *prop);
void propDisable(struct prop *prop);
+1 -1
View File
@@ -88,7 +88,7 @@ s32 func0f068fc8(struct prop *prop, bool arg1);
void propCalculateShadeColour(struct prop *prop, u8 *nextcol, u16 floorcol);
void propCalculateShadeInfo(struct prop *prop, u8 *nextcol, u16 floorcol);
void colourTween(u8 *col, u8 *nextcol);
void func0f069750(s32 *arg0, s32 arg1, f32 *arg2);
void func0f069750(s32 *arg0, s32 arg1, f32 arg2[4]);
void func0f069850(struct defaultobj *obj, struct coord *pos, f32 rot[3][3], struct geocyl *cyl);
void func0f069b4c(struct defaultobj *obj);
void func0f069c1c(struct defaultobj *obj);
+1 -1
View File
@@ -5,7 +5,7 @@
#include "types.h"
void quaternion0f096ca0(struct coord *arg0, f32 quat[4]);
void quaternionToMtx(f32 *arg0, Mtxf *arg1);
void quaternionToMtx(f32 arg0[4], Mtxf *arg1);
void quaternion0f097044(Mtxf *matrix, f32 arg1[4]);
void quaternionToTransformMtx(struct coord *pos, f32 rot[4], Mtxf *matrix);
void quaternionSlerp(f32 q1[4], f32 q2[4], f32 t, f32 result[4]);
+1 -1
View File
@@ -19,7 +19,7 @@ s32 tex0f0b34d8(s32 width, s32 height, s32 lod);
s32 tex0f0b3548(s32 width, s32 height, s32 lod);
void texSetRenderMode(Gfx **gdlptr, s32 arg1, s32 numcycles, s32 arg3);
void texLoadFromConfig(struct textureconfig *config);
void texSelect(Gfx **gdl, struct textureconfig *tconfig, u32 arg2, s32 arg3, u32 arg4, bool arg5, struct texpool *pool);
void texSelect(Gfx **gdl, struct textureconfig *tconfig, u32 arg2, s32 arg3, u32 ulst, bool arg5, struct texpool *pool);
void tex0f173a08(void);
bool texSetLutMode(u32 value);
-3
View File
@@ -1,8 +1,5 @@
#ifndef _IN_GBIEX_H
#define _IN_GBIEX_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
#define G_SETCOLOR 0x07
#define G_TRI4 -79
+2
View File
@@ -9,6 +9,8 @@ void dhudInit(void);
void dhudReset(void);
void dhudClear(void);
void dhudSetPos(s32 x, s32 y);
void dhudSetFgColour(s32 r, s32 g, s32 b, s32 a);
void dhudSetBgColour(s32 r, s32 g, s32 b, s32 a);
void dhudPrintChar(u8 c);
void dhudPrintString(char *text);
Gfx *dhudRender(Gfx *gdl);
+1 -1
View File
@@ -105,6 +105,6 @@ void modelInit(struct model *model, struct modelfiledata *filedata, union modelr
void animInit(struct anim *anim);
void model00023108(struct model *model, struct modelfiledata *arg1, struct modelnode *node, struct modelfiledata *arg3);
void modelIterateDisplayLists(struct modelfiledata *filedata, struct modelnode **nodeptr, Gfx **gdlptr);
void modelNodeReplaceGdl(u32 arg0, struct modelnode *node, Gfx *find, Gfx *replacement);
void modelNodeReplaceGdl(struct modelfiledata *modeldef, struct modelnode *node, Gfx *find, Gfx *replacement);
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef _IN_LIB_PROFILE_H
#define _IN_LIB_PROFILE_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
void profileInit(void);
void profileTick(void);
void profileReset(void);
void profile00009a98(void);
void profileSetMarker(u32 arg0);
Gfx *profileRender(Gfx *gdl);
#endif
+1
View File
@@ -3,5 +3,6 @@
#include <ultra64.h>
void resetproc(void *data);
void resetThreadCreate(void);
#endif
+1
View File
@@ -14,6 +14,7 @@ void __scExec(OSSched *sc, OSScTask *sp, OSScTask *dp);
void __scMain(void *arg);
void __scYield(OSSched *sc);
void schedInitArtifacts(void);
void schedResetArtifacts(void);
struct artifact *schedGetWriteArtifacts(void);
struct artifact *schedGetFrontArtifacts(void);
void schedIncrementWriteArtifacts(void);
+6 -6
View File
@@ -4,15 +4,15 @@
#include "data.h"
#include "types.h"
char *strcpy(char *dst, char *src);
char *strncpy(char *dst, char *s2, s32 len);
char *strcat(char *dst, char *src);
s32 strcmp(char *s1, char *s2);
s32 strncmp(char *s1, char *s2, s32 len);
char *strcpy(char *dst, const char *src);
char *strncpy(char *dst, const char *src, s32 len);
char *strcat(char *dst, const char *src);
s32 strcmp(const char *s1, const char *s2);
s32 strncmp(const char *s1, const char *s2, s32 len);
char toupper(char c);
s32 isdigit(char c);
s32 isalpha(char c);
s32 isspace(char c);
s32 strtol(char *arg0, char **arg1, s32 arg2);
s32 strtol(const char *src, const char **endptr, s32 base);
#endif
+3 -6
View File
@@ -4,12 +4,6 @@
#include "data.h"
#include "types.h"
void profileInit(void);
void profileTick(void);
void profileReset(void);
void profile00009a98(void);
void profileSetMarker(u32 arg0);
Gfx *profileRender(Gfx *gdl);
void viConfigureForLogos(void);
void viConfigureForCopyright(u16 *fb);
void viConfigureForLegal(void);
@@ -19,6 +13,7 @@ void vi00009ed4(void);
void viUpdateMode(void);
void viShake(f32 intensity);
void viSetMode(s32 mode);
void viSet16Bit(void);
u16 *viGetBackBuffer(void);
u16 *viGetFrontBuffer(void);
Vp *viGetCurrentPlayerViewport(void);
@@ -54,5 +49,7 @@ f32 viGetFovY(void);
void viSetZRange(f32 arg0, f32 arg1);
void viGetZRange(struct zrange *zrange);
Gfx *viSetFillColour(Gfx *gdl, s32 r, s32 g, s32 b);
void viGrabJpg32(void);
void viGrabRgb32(void);
#endif
+10 -4
View File
@@ -4,10 +4,10 @@
#include <sched.h>
#include "n_libaudio.h"
#include "constants.h"
#include "gbiex.h"
#include "lang.h"
#include "pads.h"
#include "tiles.h"
#include "gbi.h"
#define bool s32
#define ubool u32
@@ -895,6 +895,13 @@ struct geocyl {
/*0x14*/ f32 radius;
};
union geounion {
struct geotilei tilei;
struct geotilef tilef;
struct geoblock block;
struct geocyl cyl;
};
struct act_stand {
/*0x2c*/ s32 prestand;
/*0x30*/ s32 flags;
@@ -3431,7 +3438,7 @@ union soundnumhack {
};
struct {
u16 hasconfig : 1;
u16 hasconfig2 : 1;
u16 unk02 : 2;
u16 mp3priority : 2;
u16 id : 11;
@@ -4232,8 +4239,7 @@ struct mpplayerconfig {
/*0x94*/ u8 medals;
/*0x95*/ u8 title;
/*0x96*/ u8 newtitle;
/*0x97*/ u8 gunfuncs[5];
/*0x9c*/ u8 unk9c;
/*0x97*/ u8 gunfuncs[6];
/*0x9d*/ u8 handicap;
};